Moving comment and commentsList components into the cardDetail folder
This commit is contained in:
parent
b4962c3b02
commit
8c285e5948
5 changed files with 20 additions and 18 deletions
|
@ -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'
|
||||
|
|
|
@ -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 = {
|
|
@ -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
|
||||
|
Loading…
Reference in a new issue