diff --git a/lang/default.json b/lang/default.json index a8ab374467..f6246138b9 100644 --- a/lang/default.json +++ b/lang/default.json @@ -440,6 +440,10 @@ "defaultMessage": "This tag is already taken", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "liked your deleted moment", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "Successfully delivered" }, @@ -971,6 +975,10 @@ "E048/V": { "defaultMessage": "Save as Draft" }, + "E0xjVb": { + "defaultMessage": "commented on a deleted moment", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "Moment", "description": "src/components/Forms/MomentForm/index.tsx" @@ -3059,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, + "qw7tLA": { + "defaultMessage": "liked your comment on a deleted moment", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "Drag" }, diff --git a/lang/en.json b/lang/en.json index 1f0039c5c9..6958c1ba9e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -440,6 +440,10 @@ "defaultMessage": "This tag is already taken", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "liked your deleted moment", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "Successfully delivered" }, @@ -971,6 +975,10 @@ "E048/V": { "defaultMessage": "Save as Draft" }, + "E0xjVb": { + "defaultMessage": "commented on a deleted moment", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "Moment", "description": "src/components/Forms/MomentForm/index.tsx" @@ -3059,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, + "qw7tLA": { + "defaultMessage": "liked your comment on a deleted moment", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "Drag" }, diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 8aa568f5c2..9987fe61cc 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -440,6 +440,10 @@ "defaultMessage": "标签名称已被使用", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "喜欢你已删除的动态", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "送出成功" }, @@ -971,6 +975,10 @@ "E048/V": { "defaultMessage": "存至草稿" }, + "E0xjVb": { + "defaultMessage": "在已删除动态中留言", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "动态", "description": "src/components/Forms/MomentForm/index.tsx" @@ -3059,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "支付请求已送出" }, + "qw7tLA": { + "defaultMessage": "喜欢你在已删除动态中的留言", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "拖拽" }, diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 4b7f8c7f41..b50d7d0e83 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -440,6 +440,10 @@ "defaultMessage": "標籤名稱已被使用", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "喜歡你已刪除的動態", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "送出成功" }, @@ -971,6 +975,10 @@ "E048/V": { "defaultMessage": "存至草稿" }, + "E0xjVb": { + "defaultMessage": "在已刪除動態中留言", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "動態", "description": "src/components/Forms/MomentForm/index.tsx" @@ -3059,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "支付請求已送出" }, + "qw7tLA": { + "defaultMessage": "喜歡你在已刪除動態中的留言", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "拖拽" }, diff --git a/package.json b/package.json index abfa795bf4..7e2a021cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "5.6.0", + "version": "5.6.1", "description": "codebase of Matters' website", "author": "Matters ", "engines": { diff --git a/src/components/Dialogs/MomentDetailDialog/Content.tsx b/src/components/Dialogs/MomentDetailDialog/Content.tsx index 7cba2afdcc..95f049a879 100644 --- a/src/components/Dialogs/MomentDetailDialog/Content.tsx +++ b/src/components/Dialogs/MomentDetailDialog/Content.tsx @@ -2,6 +2,7 @@ import { useQuery } from '@apollo/react-hooks' import { Editor } from '@matters/matters-editor' import classNames from 'classnames' import { useEffect, useState } from 'react' +import { FormattedMessage } from 'react-intl' import { ADD_MOMENT_COMMENT_MENTION, @@ -16,6 +17,8 @@ import { toPath, } from '~/common/utils' import { + BackToHomeButton, + Error, MomentDigestDetail, QueryError, useEventListener, @@ -24,7 +27,7 @@ import { import MomentCommentForm from '~/components/Forms/MomentCommentForm' import Assets from '~/components/MomentDigest/Assets' import LikeButton from '~/components/MomentDigest/FooterActions/LikeButton' -import { MomentDetailQuery } from '~/gql/graphql' +import { MomentDetailQuery, MomentState } from '~/gql/graphql' import Comments from './Comments' import { MOMENT_DETAIL } from './gql' @@ -99,6 +102,23 @@ const MomentDetailDialogContent = ({ return null } + if (data.moment.state === MomentState.Archived) { + return ( +
+ + } + > + + +
+ ) + } + const moment = data.moment const { content, assets } = moment diff --git a/src/components/Dialogs/MomentDetailDialog/styles.module.css b/src/components/Dialogs/MomentDetailDialog/styles.module.css index 331ca03720..636f10fb2e 100644 --- a/src/components/Dialogs/MomentDetailDialog/styles.module.css +++ b/src/components/Dialogs/MomentDetailDialog/styles.module.css @@ -146,3 +146,9 @@ } } } + +.error { + @media (--sm-up) { + padding: var(--sp24); + } +} diff --git a/src/components/Editor/Article/extensions/smartLink/utils.ts b/src/components/Editor/Article/extensions/smartLink/utils.ts index 9ee8340ced..f610cc7d27 100644 --- a/src/components/Editor/Article/extensions/smartLink/utils.ts +++ b/src/components/Editor/Article/extensions/smartLink/utils.ts @@ -10,7 +10,7 @@ export const makeSmartLinkOptions = ({ }) => { return { findRule: new RegExp( - `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}/a/(?[a-zA-Z0-9]+)`, + `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}/a/(?[a-zA-Z0-9]+)(?:\\?.*|#.*)?`, 'g' ), search: async ({ diff --git a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx index 25455998d4..cf5fc69fc1 100644 --- a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx +++ b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx @@ -2,7 +2,7 @@ import gql from 'graphql-tag' import { FormattedMessage } from 'react-intl' import { TEST_ID } from '~/common/enums' -import { CommentNoticeFragment } from '~/gql/graphql' +import { CommentNoticeFragment, MomentState } from '~/gql/graphql' import NoticeActorAvatar from '../NoticeActorAvatar' import NoticeArticleTitle from '../NoticeArticleTitle' @@ -23,6 +23,23 @@ const CommentLikedNotice = ({ notice }: { notice: CommentNoticeFragment }) => { ? notice.comment.node : undefined + if (isMoment && commentMoment?.state === MomentState.Archived) { + return ( + + } + content={} + testId={TEST_ID.NOTICE_COMMENT_LIKED} + /> + ) + } + return ( + } + content={} + testId={TEST_ID.NOTICE_MOMENT_NEW_COMMENT} + /> + ) + } + return ( { + if (notice.moment.state === MomentState.Archived) { + return ( + + } + testId={TEST_ID.NOTICE_MOMENT_LIKED} + /> + ) + } + return (