diff --git a/public/icons/static/emotion/alien-fill.svg b/public/icons/static/emotion/alien-fill.svg new file mode 100644 index 000000000..70401f099 --- /dev/null +++ b/public/icons/static/emotion/alien-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/containers/unit/Comments/Comment/Actions.tsx b/src/containers/unit/Comments/Comment/Actions.tsx index c84dcb56d..d8a301747 100755 --- a/src/containers/unit/Comments/Comment/Actions.tsx +++ b/src/containers/unit/Comments/Comment/Actions.tsx @@ -2,6 +2,9 @@ import React from 'react' import type { TAccount, TComment } from '@/spec' +import DotDivider from '@/components/DotDivider' +import { SpaceGrow } from '@/components/Common' + import { Wrapper, ReplyAction } from '../styles/comment/actions' import { openUpdateEditor, openReplyEditor, onDelete } from '../logic' @@ -23,6 +26,14 @@ const Actions: React.FC = ({ data, accountInfo }) => { return ( openReplyEditor(data)}>回复 + + 分享 + + 引用 + + 折叠 + + 举报 ) } diff --git a/src/containers/unit/Comments/Comment/DesktopView.tsx b/src/containers/unit/Comments/Comment/DesktopView.tsx index e58ab8010..ce4d1ee09 100644 --- a/src/containers/unit/Comments/Comment/DesktopView.tsx +++ b/src/containers/unit/Comments/Comment/DesktopView.tsx @@ -6,7 +6,7 @@ import { Global } from '@/utils' import MarkDownRender from '@/components/MarkDownRender' -import UpInfo from './UpInfo' +import Upvote from './Upvote' import Header from './Header' import ReplyBar from './ReplyBar' import DeleteMask from './DeleteMask' @@ -37,7 +37,7 @@ const Comment: React.FC = ({ data, tobeDeleteId, accountInfo }) => { - +
diff --git a/src/containers/unit/Comments/Comment/Emotion.tsx b/src/containers/unit/Comments/Comment/Emotion.tsx new file mode 100644 index 000000000..9a51b994c --- /dev/null +++ b/src/containers/unit/Comments/Comment/Emotion.tsx @@ -0,0 +1,13 @@ +import React from 'react' + +import { ICON } from '@/config' + +import { Wrapper, SelectorIcon } from '../styles/comment/emotion' + +const Emotion: React.FC = () => ( + + + +) + +export default React.memo(Emotion) diff --git a/src/containers/unit/Comments/Comment/Footer.tsx b/src/containers/unit/Comments/Comment/Footer.tsx index 8aa1f2ddd..77e3904a0 100755 --- a/src/containers/unit/Comments/Comment/Footer.tsx +++ b/src/containers/unit/Comments/Comment/Footer.tsx @@ -1,13 +1,14 @@ import React from 'react' -import TimeAgo from 'timeago-react' import type { TAccount, TComment } from '@/spec' -import { SpaceGrow } from '@/components/Common' + import DotDivider from '@/components/DotDivider' +import { SpaceGrow } from '@/components/Common' +import Emotion from './Emotion' import Actions from './Actions' -import { Wrapper, PublishDateWrapper } from '../styles/comment/footer' +import { Wrapper } from '../styles/comment/footer' type TProps = { data: TComment @@ -16,9 +17,7 @@ type TProps = { const Footer: React.FC = ({ data, accountInfo }) => ( - - - + diff --git a/src/containers/unit/Comments/Comment/Header.tsx b/src/containers/unit/Comments/Comment/Header.tsx index 2ba030ebb..81896a302 100755 --- a/src/containers/unit/Comments/Comment/Header.tsx +++ b/src/containers/unit/Comments/Comment/Header.tsx @@ -1,37 +1,23 @@ import React from 'react' -import { forEach, clone, pluck } from 'ramda' +import TimeAgo from 'timeago-react' import type { TComment } from '@/spec' import ImgFallback from '@/components/ImgFallback' -import AvatarsRow from '@/components/AvatarsRow' import DotDivider from '@/components/DotDivider' import { Wrapper, FloorNum, + CreateDate, Avatar, HeaderBaseInfo, - CommentUserName, - CommentHeaderFirst, - ReplyUsers, - ReplyTitle, + BaseInfo, + UserName, + AuthorTag, + ShortIntro, } from '../styles/comment/header' -import { previewReply } from '../logic' - -const getAuthors = (comment) => { - /* eslint-disable no-return-assign */ - const replies = forEach((reply) => { - /* @ts-ignore */ - return (reply.author.extraId = reply.id) - }, clone(comment.replies)) - /* eslint-enable */ - - /* @ts-ignore */ - return pluck('author', replies) -} - type TProps = { data: TComment } @@ -44,23 +30,18 @@ const CommentHeader: React.FC = ({ data }) => { fallback={} /> - - - {data.author.nickname} - - #{data.floor} - - {data.repliesCount !== 0 && ( - - 收到回复: - - - )} - + + +
{data.author.nickname}
+ 作者 +
+ #{data.floor} + + + + +
+ 1 号员工 / CEO at coderplanets
) diff --git a/src/containers/unit/Comments/Comment/MobileView/index.tsx b/src/containers/unit/Comments/Comment/MobileView/index.tsx index 5dec41bff..49cc6c613 100644 --- a/src/containers/unit/Comments/Comment/MobileView/index.tsx +++ b/src/containers/unit/Comments/Comment/MobileView/index.tsx @@ -3,7 +3,7 @@ import React from 'react' import { Br } from '@/components/Common' import MarkDownRender from '@/components/MarkDownRender' -import UpInfo from '../UpInfo' +import Upvote from '../Upvote' import ReplyBar from '../ReplyBar' import DeleteMask from '../DeleteMask' import Footer from '../Footer' @@ -40,7 +40,7 @@ const MobileView = ({ data, tobeDeleteId, accountInfo }) => {