diff --git a/webapp/src/components/cardDetail/cardDetail.tsx b/webapp/src/components/cardDetail/cardDetail.tsx index 101eed11e..e57a4f2f0 100644 --- a/webapp/src/components/cardDetail/cardDetail.tsx +++ b/webapp/src/components/cardDetail/cardDetail.tsx @@ -12,8 +12,8 @@ import Editable from '../../widgets/editable' import EmojiIcon from '../../widgets/icons/emoji' import BlockIconSelector from '../blockIconSelector' -import CommentsList from '../commentsList' +import CommentsList from './commentsList' import CardDetailContents from './cardDetailContents' import CardDetailContentsMenu from './cardDetailContentsMenu' import CardDetailProperties from './cardDetailProperties' diff --git a/webapp/src/components/comment.scss b/webapp/src/components/cardDetail/comment.scss similarity index 100% rename from webapp/src/components/comment.scss rename to webapp/src/components/cardDetail/comment.scss diff --git a/webapp/src/components/comment.tsx b/webapp/src/components/cardDetail/comment.tsx similarity index 82% rename from webapp/src/components/comment.tsx rename to webapp/src/components/cardDetail/comment.tsx index c852ff56f..8b5a97088 100644 --- a/webapp/src/components/comment.tsx +++ b/webapp/src/components/cardDetail/comment.tsx @@ -3,15 +3,16 @@ import React, {FC, useEffect, useState} from 'react' import {injectIntl, IntlShape} from 'react-intl' -import {IBlock} from '../blocks/block' -import mutator from '../mutator' -import {Utils} from '../utils' -import IconButton from '../widgets/buttons/iconButton' -import DeleteIcon from '../widgets/icons/delete' -import OptionsIcon from '../widgets/icons/options' -import Menu from '../widgets/menu' -import MenuWrapper from '../widgets/menuWrapper' -import {UserCache} from '../userCache' +import {IBlock} from '../../blocks/block' +import mutator from '../../mutator' +import {Utils} from '../../utils' +import IconButton from '../../widgets/buttons/iconButton' +import DeleteIcon from '../../widgets/icons/delete' +import OptionsIcon from '../../widgets/icons/options' +import Menu from '../../widgets/menu' +import MenuWrapper from '../../widgets/menuWrapper' +import {UserCache} from '../../userCache' + import './comment.scss' type Props = { diff --git a/webapp/src/components/commentsList.scss b/webapp/src/components/cardDetail/commentsList.scss similarity index 100% rename from webapp/src/components/commentsList.scss rename to webapp/src/components/cardDetail/commentsList.scss diff --git a/webapp/src/components/commentsList.tsx b/webapp/src/components/cardDetail/commentsList.tsx similarity index 88% rename from webapp/src/components/commentsList.tsx rename to webapp/src/components/cardDetail/commentsList.tsx index 3e3aed4c0..c1085c23e 100644 --- a/webapp/src/components/commentsList.tsx +++ b/webapp/src/components/cardDetail/commentsList.tsx @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useState, useMemo} from 'react' +import React, {useState} from 'react' import {FormattedMessage, injectIntl, IntlShape} from 'react-intl' -import {CommentBlock, MutableCommentBlock} from '../blocks/commentBlock' -import mutator from '../mutator' -import {Utils} from '../utils' -import Button from '../widgets/buttons/button' +import {CommentBlock, MutableCommentBlock} from '../../blocks/commentBlock' +import mutator from '../../mutator' +import {Utils} from '../../utils' +import Button from '../../widgets/buttons/button' + +import {MarkdownEditor} from '../markdownEditor' import Comment from './comment' import './commentsList.scss' -import {MarkdownEditor} from './markdownEditor' type Props = { comments: readonly CommentBlock[] @@ -22,7 +23,7 @@ type Props = { const CommentsList = React.memo((props: Props) => { const [newComment, setNewComment] = useState('') - const onSendClicked = useMemo(() => () => { + const onSendClicked = () => { const commentText = newComment if (commentText) { const {rootId, cardId} = props @@ -36,7 +37,7 @@ const CommentsList = React.memo((props: Props) => { mutator.insertBlock(comment, 'add comment') setNewComment('') } - }, []) + } const {comments, intl} = props