diff --git a/client/src/components/CardModal/Activities/CommentEdit.jsx b/client/src/components/CardModal/Activities/CommentEdit.jsx index cd088dfa..bdb4cc0b 100755 --- a/client/src/components/CardModal/Activities/CommentEdit.jsx +++ b/client/src/components/CardModal/Activities/CommentEdit.jsx @@ -10,7 +10,7 @@ import { focusEnd } from '../../../utils/element-helpers'; import styles from './CommentEdit.module.scss'; -const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref) => { +const CommentEdit = React.forwardRef(({ defaultData, onUpdate, text, actions }, ref) => { const [t] = useTranslation(); const [isOpened, setIsOpened] = useState(false); const [data, handleFieldChange, setData] = useForm(null); @@ -76,7 +76,12 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref) }, [isOpened]); if (!isOpened) { - return children; + return ( + <> + {actions} + {text} + + ); } return ( @@ -101,9 +106,10 @@ const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref) }); CommentEdit.propTypes = { - children: PropTypes.element.isRequired, defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types onUpdate: PropTypes.func.isRequired, + text: PropTypes.element.isRequired, + actions: PropTypes.element.isRequired, }; export default React.memo(CommentEdit); diff --git a/client/src/components/CardModal/Activities/ItemComment.jsx b/client/src/components/CardModal/Activities/ItemComment.jsx index fca47b31..51dad798 100755 --- a/client/src/components/CardModal/Activities/ItemComment.jsx +++ b/client/src/components/CardModal/Activities/ItemComment.jsx @@ -31,44 +31,51 @@ const ItemComment = React.memo(
-
- {user.name} - - {t(`format:${getDateFormat(createdAt)}`, { - postProcess: 'formatDate', - value: createdAt, - })} - -
- - <> + {data.text}
- {canEdit && ( - - - + } + actions={ +
+ + {user.name} + + {t(`format:${getDateFormat(createdAt)}`, { + postProcess: 'formatDate', + value: createdAt, + })} + + + {canEdit && ( + - - - )} - - + + + + + )} +
+ } + /> ); diff --git a/client/src/components/CardModal/Activities/ItemComment.module.scss b/client/src/components/CardModal/Activities/ItemComment.module.scss index 0153c9de..6e1c2d1e 100644 --- a/client/src/components/CardModal/Activities/ItemComment.module.scss +++ b/client/src/components/CardModal/Activities/ItemComment.module.scss @@ -38,6 +38,12 @@ .title { padding-bottom: 4px; + display: flex; + align-items: center; + justify-content: space-between; + position: sticky; + top: -1em; + background: #f5f6f7; } .user {