diff --git a/.env.dev b/.env.dev index dd632d4a6a..41d2e0e31d 100644 --- a/.env.dev +++ b/.env.dev @@ -33,7 +33,6 @@ NEXT_PUBLIC_NOMAD_MATTERS_CAMPAIGN_LINK=/@rsdyobw/22048-launching-the-nomad-matt NEXT_PUBLIC_BILLBOARD_ADDRESS=0x6a72820E1CCCba1B1FE02E37881cEa3F9Aa6375C NEXT_PUBLIC_BILLBOARD_TOKEN_ID=6 NEXT_PUBLIC_BILLBOARD_IMAGE_URL=matters-billboard-ad-dev.s3.ap-southeast-1.amazonaws.com/ -DEBUG=false PLAYWRIGHT_RUNTIME_ENV=ci PLAYWRIGHT_TEST_BASE_URL=https://web-develop.matters.town PLAYWRIGHT_TEST_API_URL=https://server-develop.matters.town/graphql diff --git a/.env.local.example b/.env.local.example index f2967e4106..46192aa2de 100644 --- a/.env.local.example +++ b/.env.local.example @@ -29,7 +29,6 @@ NEXT_PUBLIC_NOMAD_MATTERS_CAMPAIGN_LINK=/@rsdyobw/22048-launching-the-nomad-matt NEXT_PUBLIC_BILLBOARD_ADDRESS=0x6a72820E1CCCba1B1FE02E37881cEa3F9Aa6375C NEXT_PUBLIC_BILLBOARD_TOKEN_ID=6 NEXT_PUBLIC_BILLBOARD_IMAGE_URL=matters-billboard-ad-dev.s3.ap-southeast-1.amazonaws.com/ -DEBUG=false PLAYWRIGHT_RUNTIME_ENV=local PLAYWRIGHT_TEST_BASE_URL=https://web-develop.matters.town PLAYWRIGHT_TEST_API_URL=https://server-develop.matters.town/graphql diff --git a/.env.prod b/.env.prod index abfffed1cf..809d2910da 100644 --- a/.env.prod +++ b/.env.prod @@ -26,7 +26,6 @@ NEXT_PUBLIC_TRAVELOGGERS_URL=https://traveloggers.matters.town NEXT_PUBLIC_LOGBOOKS_URL=https://logbook.matters.town NEXT_PUBLIC_ALCHEMY_KEY=bOu-fCphi9mvePsxg968Qe-pidHQNdlT NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=0x4AAAAAAAKVODkJMwfIxG78 -DEBUG=false NEXT_PUBLIC_GOOGLE_CLIENT_ID=751677068109-rkml7q9ujf8ems09cclh7qckf14svcgs.apps.googleusercontent.com NEXT_PUBLIC_TWITTER_CLIENT_ID=cmdKbUlyd1ZZZDZYa3dTampidGo6MTpjaQ NEXT_PUBLIC_FACEBOOK_CLIENT_ID=687698420193159 diff --git a/lang/default.json b/lang/default.json index 751e69d498..f8aede7a65 100644 --- a/lang/default.json +++ b/lang/default.json @@ -88,10 +88,6 @@ "defaultMessage": "Unknown error. Please try again later.", "description": "UNKNOWN_ERROR" }, - "/agKbX": { - "defaultMessage": "Write a comment", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "/cyuh2": { "defaultMessage": "Go to Authorization" }, @@ -104,6 +100,10 @@ "/jJLYy": { "defaultMessage": "Transactions" }, + "/kUr1+": { + "defaultMessage": "Unpin", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "/pnYHM": { "defaultMessage": "Circle not found", "description": "CIRCLE_NOT_FOUND" @@ -461,6 +461,9 @@ "defaultMessage": "Set threshold for circle (per month)", "description": "src/components/Forms/CreateCircleForm/Init.tsx" }, + "6BbPcY": { + "defaultMessage": "The comment has been forcibly hidden" + }, "6CQaLH": { "defaultMessage": "Please select or enter amount" }, @@ -515,6 +518,10 @@ "defaultMessage": "Cancelled", "description": "src/components/Transaction/State/index.tsx" }, + "6vgoSf": { + "defaultMessage": "Edit", + "description": "src/components/CircleComment/DropdownActions/EditButton.tsx" + }, "70UCEy": { "defaultMessage": "Have wallet questions on mobile device ? Click the", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -526,14 +533,6 @@ "76yoL6": { "defaultMessage": "Moonlight Dream" }, - "77tYPg": { - "defaultMessage": "After deletion, the {commentType} will be removed immediately", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, - "78qsg6": { - "defaultMessage": "Author", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "79Ydsg": { "defaultMessage": "Payout Canceled", "description": "src/components/Transaction/index.tsx" @@ -591,6 +590,10 @@ "8cv9D4": { "defaultMessage": "Next Step" }, + "8gRHks": { + "defaultMessage": "Pin Broadcast", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "8iciCA": { "defaultMessage": "Entity not found", "description": "ENTITY_NOT_FOUND" @@ -618,6 +621,10 @@ "9+Ddtu": { "defaultMessage": "Next" }, + "9+vzKn": { + "defaultMessage": "Edit", + "description": "src/components/CircleComment/DropdownActions/index.tsx" + }, "91IQdk": { "defaultMessage": "Followed", "description": "src/components/Buttons/FollowUser/Unfollow.tsx" @@ -637,10 +644,6 @@ "9J0iCw": { "defaultMessage": "Deleted user" }, - "9OIqBr": { - "defaultMessage": "Edit Comment", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "9SXN7s": { "defaultMessage": "No more comments", "description": "src/views/ArticleDetail/Comments/LatestComments/index.tsx" @@ -696,10 +699,6 @@ "AGDFGs": { "defaultMessage": "Discrimination, insult, or hatred" }, - "AGcU5J": { - "defaultMessage": "Pin Broadcast", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "ANA7sk": { "defaultMessage": "Maintain", "description": "src/views/TagDetail/Owner/index.tsx" @@ -805,10 +804,6 @@ "CPvyYN": { "defaultMessage": "Incorrect password" }, - "Cdkhl8": { - "defaultMessage": "Delete {commentType}", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "CnPG8j": { "defaultMessage": "Featured" }, @@ -857,6 +852,10 @@ "defaultMessage": "Badges", "description": "src/components/UserProfile/index.tsx" }, + "DZaTBr": { + "defaultMessage": "Supporter", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "DjIpR6": { "defaultMessage": "Set Cover" }, @@ -871,6 +870,10 @@ "defaultMessage": "Unblock", "description": "src/views/Me/Settings/Blocked/ToggleBlockButton.tsx" }, + "DrBuEI": { + "defaultMessage": "Unpin Broadcast", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "DyuHBH": { "defaultMessage": "Unpin from profile", "description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx" @@ -1064,6 +1067,9 @@ "HYW0fI": { "defaultMessage": "After publication, your work cannot be deleted." }, + "HbEL82": { + "defaultMessage": "Comment has been deleted" + }, "HkozYU": { "defaultMessage": "Switch wallet", "description": "src/components/Forms/WalletAuthForm/Connect.tsx" @@ -1100,10 +1106,6 @@ "HzB4Lk": { "defaultMessage": "Tell readers why you edited this time..." }, - "I8+06z": { - "defaultMessage": "Comment has been hidden", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "IKPYe9": { "defaultMessage": "View", "description": "src/components/Dialogs/CollectionSelectDialog/index.tsx" @@ -1206,10 +1208,6 @@ "KQi/UZ": { "defaultMessage": "Archive works" }, - "KTg17G": { - "defaultMessage": "Unpin", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "KWDSxB": { "defaultMessage": "Save revisions" }, @@ -1276,10 +1274,6 @@ "LWE7oq": { "defaultMessage": "Saving draft, are you sure you want to leave?" }, - "LYl9+i": { - "defaultMessage": "Edit", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "LaI+XV": { "defaultMessage": "By connecting ENS, benefits are:" }, @@ -1337,6 +1331,10 @@ "defaultMessage": "Operation failed, please try again later.", "description": "ACTION_FAILED" }, + "MRn08S": { + "defaultMessage": "Reply", + "description": "src/components/CircleComment/FooterActions/ReplyButton/index.tsx" + }, "MV0JlP": { "defaultMessage": "to receive more support" }, @@ -1403,6 +1401,10 @@ "defaultMessage": "Number of supporters", "description": "src/components/ArticleDigest/Published/FooterActions/index.tsx" }, + "NlX31w": { + "defaultMessage": "After deletion, the {commentType} will be removed immediately", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "NmhF45": { "defaultMessage": "Adding tags helps readers find your articles. Add or create new tags." }, @@ -1418,6 +1420,9 @@ "defaultMessage": "Forgot password?", "description": "src/components/Forms/EmailLoginForm/Buttons.tsx" }, + "O7ozeo": { + "defaultMessage": "Update profile" + }, "OIj8pQ": { "defaultMessage": "Invitation Sent", "description": "src/views/Circle/Settings/ManageInvitation/AddInvitationDialog/Sent.tsx" @@ -1437,6 +1442,10 @@ "OQ/lbb": { "defaultMessage": "Successfully linked. It would take couple hours to resolve. View transaction on {explorerName} ." }, + "OjC4aZ": { + "defaultMessage": "Author", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "Onjs6P": { "defaultMessage": "Unordered list" }, @@ -1549,10 +1558,6 @@ "defaultMessage": "Notice", "description": "src/views/Me/DraftDetail/SettingsButton/ConfirmPublishDialogContent/index.tsx" }, - "RFzVUD": { - "defaultMessage": "Unpin Broadcast", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "RGEpvx": { "defaultMessage": "Support setting", "description": "src/views/ArticleDetail/SupportWidget/EditCopyButton/index.tsx" @@ -1569,6 +1574,9 @@ "defaultMessage": "Please add email first", "description": "src/views/Me/Settings/Notifications/GeneralSettings/Email.tsx" }, + "RPH69U": { + "defaultMessage": "The author has disabled comments for this circle" + }, "RU5NDB": { "defaultMessage": "Please confirm transaction password", "description": "src/components/Forms/PaymentForm/SetPassword/index.tsx" @@ -1739,10 +1747,6 @@ "defaultMessage": "Move to bottom", "description": "src/components/ArticleDigest/DropdownActions/SetBottomCollectionButton.tsx" }, - "UgpqlF": { - "defaultMessage": "Reply", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "UjKkhq": { "defaultMessage": "Tags added", "description": "src/views/TagDetail/DropdownActions/index.tsx" @@ -1821,6 +1825,10 @@ "WFCO2w": { "defaultMessage": "Set Collection" }, + "WIOxG+": { + "defaultMessage": "Collapse", + "description": "src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx" + }, "WNxQX0": { "defaultMessage": "Add Tags" }, @@ -1855,9 +1863,9 @@ "WxhsrG": { "defaultMessage": "Please connect email" }, - "X+Xvgq": { - "defaultMessage": "Unpin Comment", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" + "XH1s8E": { + "defaultMessage": "Delete {commentType}", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" }, "XHMco9": { "defaultMessage": "subscribers", @@ -1954,6 +1962,9 @@ "defaultMessage": "My Works - Archived", "description": "src/views/Me/Works/Archived/index.tsx" }, + "YjW2MT": { + "defaultMessage": "Comment has been hidden" + }, "YlPCRU": { "defaultMessage": "connected", "description": "src/components/Notice/ArticleArticleNotice/ArticleNewCollectedNotice.tsx" @@ -1996,10 +2007,6 @@ "defaultMessage": "Edit", "description": "src/components/ArticleDigest/DropdownActions/EditButton.tsx" }, - "ZYvVYX": { - "defaultMessage": "Supporter", - "description": "src/components/Comment/DonatorLabel/index.tsx" - }, "ZZ9zIR": { "defaultMessage": "Downvote" }, @@ -2101,6 +2108,10 @@ "bSqeXm": { "defaultMessage": "{ext, select, gif {GIF format i} other {I} }mages have a {sizeInMB} megabyte (MB) size limit." }, + "bTNYGv": { + "defaultMessage": "Comment", + "description": "src/components/Forms/ArticleCommentForm/index.tsx" + }, "beLe/F": { "defaultMessage": "Broadcast" }, @@ -2118,10 +2129,6 @@ "cE4Hfw": { "defaultMessage": "Discover" }, - "cO0im6": { - "defaultMessage": "Featured", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "cPIKU2": { "defaultMessage": "Following" }, @@ -2198,6 +2205,10 @@ "defaultMessage": "Comments and replies", "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" }, + "ddJbkg": { + "defaultMessage": "Pin", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "deEeEI": { "defaultMessage": "Register" }, @@ -2297,6 +2308,10 @@ "fxhue9": { "defaultMessage": "Article will be published to IPFS, others can not tamper with it, and you own the copyright." }, + "g//2O2": { + "defaultMessage": "Uncollapse", + "description": "src/components/CircleComment/DropdownActions/UncollapseButton.tsx" + }, "g5pX+a": { "defaultMessage": "About" }, @@ -2315,10 +2330,6 @@ "gS1u3d": { "defaultMessage": "{left} modifications available" }, - "gW/KWu": { - "defaultMessage": "Comments has been pinned", - "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" - }, "gczcC5": { "defaultMessage": "Subscribe" }, @@ -2350,10 +2361,6 @@ "h9CB9m": { "defaultMessage": "The result is mainly based on the records on the chain and will be synchronized to Matters later." }, - "h9CG9E": { - "defaultMessage": "{commentType} has been deleted", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "hASeng": { "defaultMessage": "Blocked Users", "description": "src/views/Me/Settings/Misc/BlockedUsers.tsx" @@ -2376,10 +2383,6 @@ "defaultMessage": "are following", "description": "src/views/TagDetail/Followers/index.tsx" }, - "hgjjhO": { - "defaultMessage": "Comment", - "description": "src/components/Forms/CommentFormBeta/index.tsx" - }, "hk2aiz": { "defaultMessage": "followed your circle", "description": "src/components/Notice/CircleNotice/CircleNewUserNotice.tsx" @@ -2452,14 +2455,6 @@ "defaultMessage": "Sign up with email", "description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx" }, - "jJ1Brc": { - "defaultMessage": "Pin Comment", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, - "jc3mW/": { - "defaultMessage": "Supporter", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "jiB0Z2": { "defaultMessage": "Unable to bind wallet", "description": "src/components/Forms/PaymentForm/BindWallet/index.tsx" @@ -2478,10 +2473,6 @@ "k0ooDW": { "defaultMessage": "Tag Description" }, - "k1SWZ2": { - "defaultMessage": "Uncollapse", - "description": "src/components/Comment/DropdownActions/UncollapseButton.tsx" - }, "k2veDA": { "defaultMessage": "Write" }, @@ -2644,10 +2635,6 @@ "me1nR+": { "defaultMessage": "Copy Address" }, - "mikY/9": { - "defaultMessage": "Edit", - "description": "src/components/Comment/DropdownActions/EditButton.tsx" - }, "ml3SZN": { "defaultMessage": "Minimum 8 characters. Uppercase/lowercase letters, numbers and symbols are allowed" }, @@ -2699,9 +2686,6 @@ "nWhqw9": { "defaultMessage": "Publish Now" }, - "nYrKWp": { - "defaultMessage": "Edit profile" - }, "nhkx3t": { "defaultMessage": "IPFS is a decentralized storage technology that has the advantages of being decentralized, easy to survive, and difficult to be censored. Every article published on Matters is uploaded to IPFS. IPFS will incur certain storage fees, which are currently borne by Matters. (Go to the IPFS official website ipfs.com to learn more)" }, @@ -2751,10 +2735,6 @@ "pKkpI9": { "defaultMessage": "The wallet address is not the one you bound to account. Please switch it in the wallet or reconnect as:" }, - "pRV+UD": { - "defaultMessage": "Collapse", - "description": "src/components/Comment/DropdownActions/CollapseComment/Button.tsx" - }, "phAZoj": { "defaultMessage": "Collection" }, @@ -2800,6 +2780,10 @@ "defaultMessage": "Reset successful", "description": "src/components/Forms/PaymentForm/ResetPassword/Confirm.tsx" }, + "qTHZmd": { + "defaultMessage": "Only one comment can be pinned to the top", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "qVhxp5": { "defaultMessage": "Enter", "description": "src/components/Buttons/UniversalAuth/index.tsx" @@ -2828,10 +2812,6 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, - "qxKjcm": { - "defaultMessage": "Pin", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "r5pj/5": { "defaultMessage": "Drag" }, @@ -2942,10 +2922,6 @@ "defaultMessage": "Add up to 5 tags", "description": "TOO_MANY_TAGS_FOR_ARTICLE" }, - "tnWWrj": { - "defaultMessage": "The comment has been forcibly hidden", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "tqEGfa": { "defaultMessage": "Your work has been published. Share it on different platforms" }, @@ -3090,6 +3066,10 @@ "w+6UiO": { "defaultMessage": "Add Invitation" }, + "wAccv4": { + "defaultMessage": "{commentType} has been deleted", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "wCgTu5": { "defaultMessage": "Comments" }, @@ -3108,6 +3088,9 @@ "defaultMessage": "Continue", "description": "src/components/Forms/EmailSignUpForm/Init.tsx" }, + "wLSBAX": { + "defaultMessage": "After deletion, the comment will be removed immediately" + }, "wMNZJa": { "defaultMessage": "Notification not found", "description": "NOTICE_NOT_FOUND" @@ -3115,6 +3098,9 @@ "wNJjR5": { "defaultMessage": "Support setting updated" }, + "wOZRKW": { + "defaultMessage": "Delete comment" + }, "wSZR47": { "defaultMessage": "Submit" }, @@ -3240,10 +3226,6 @@ "defaultMessage": "Enter", "description": "src/components/CircleDigest/Price/index.tsx" }, - "yexhgj": { - "defaultMessage": "Only one comment can be pinned to the top", - "description": "src/components/CommentBeta/DropdownActions/PinButton.tsx" - }, "yoRaUc": { "defaultMessage": "Refund", "description": "src/components/Transaction/index.tsx" @@ -3292,10 +3274,6 @@ "zb8Kx1": { "defaultMessage": "Announcement, reminder, chattering..." }, - "zkmfjn": { - "defaultMessage": "Pinned", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "zllCbU": { "defaultMessage": "left a comment in {circleName}", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" diff --git a/lang/en.json b/lang/en.json index f6af07d81c..05df546638 100644 --- a/lang/en.json +++ b/lang/en.json @@ -88,10 +88,6 @@ "defaultMessage": "Unknown error. Please try again later.", "description": "UNKNOWN_ERROR" }, - "/agKbX": { - "defaultMessage": "Write a comment", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "/cyuh2": { "defaultMessage": "Go to Authorization" }, @@ -104,6 +100,10 @@ "/jJLYy": { "defaultMessage": "Transactions" }, + "/kUr1+": { + "defaultMessage": "Unpin", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "/pnYHM": { "defaultMessage": "Circle not found", "description": "CIRCLE_NOT_FOUND" @@ -461,6 +461,9 @@ "defaultMessage": "Set threshold for circle (per month)", "description": "src/components/Forms/CreateCircleForm/Init.tsx" }, + "6BbPcY": { + "defaultMessage": "The comment has been forcibly hidden" + }, "6CQaLH": { "defaultMessage": "Please select or enter amount" }, @@ -515,6 +518,10 @@ "defaultMessage": "Cancelled", "description": "src/components/Transaction/State/index.tsx" }, + "6vgoSf": { + "defaultMessage": "Edit", + "description": "src/components/CircleComment/DropdownActions/EditButton.tsx" + }, "70UCEy": { "defaultMessage": "Have wallet questions on mobile device ? Click the", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -526,14 +533,6 @@ "76yoL6": { "defaultMessage": "Moonlight Dream" }, - "77tYPg": { - "defaultMessage": "After deletion, the {commentType} will be removed immediately", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, - "78qsg6": { - "defaultMessage": "Author", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "79Ydsg": { "defaultMessage": "Payout Canceled", "description": "src/components/Transaction/index.tsx" @@ -591,6 +590,10 @@ "8cv9D4": { "defaultMessage": "Next Step" }, + "8gRHks": { + "defaultMessage": "Pin Broadcast", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "8iciCA": { "defaultMessage": "Entity not found", "description": "ENTITY_NOT_FOUND" @@ -618,6 +621,10 @@ "9+Ddtu": { "defaultMessage": "Next" }, + "9+vzKn": { + "defaultMessage": "Edit", + "description": "src/components/CircleComment/DropdownActions/index.tsx" + }, "91IQdk": { "defaultMessage": "Followed", "description": "src/components/Buttons/FollowUser/Unfollow.tsx" @@ -637,10 +644,6 @@ "9J0iCw": { "defaultMessage": "Deleted user" }, - "9OIqBr": { - "defaultMessage": "Edit Comment", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "9SXN7s": { "defaultMessage": "No more comments", "description": "src/views/ArticleDetail/Comments/LatestComments/index.tsx" @@ -696,10 +699,6 @@ "AGDFGs": { "defaultMessage": "Discrimination, insult, or hatred" }, - "AGcU5J": { - "defaultMessage": "Pin Broadcast", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "ANA7sk": { "defaultMessage": "Maintain", "description": "src/views/TagDetail/Owner/index.tsx" @@ -805,10 +804,6 @@ "CPvyYN": { "defaultMessage": "Incorrect password" }, - "Cdkhl8": { - "defaultMessage": "Delete {commentType}", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "CnPG8j": { "defaultMessage": "Featured" }, @@ -857,6 +852,10 @@ "defaultMessage": "Badges", "description": "src/components/UserProfile/index.tsx" }, + "DZaTBr": { + "defaultMessage": "Supporter", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "DjIpR6": { "defaultMessage": "Set Cover" }, @@ -871,6 +870,10 @@ "defaultMessage": "Unblock", "description": "src/views/Me/Settings/Blocked/ToggleBlockButton.tsx" }, + "DrBuEI": { + "defaultMessage": "Unpin Broadcast", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "DyuHBH": { "defaultMessage": "Unpin from profile", "description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx" @@ -1064,6 +1067,9 @@ "HYW0fI": { "defaultMessage": "After publication, your work cannot be deleted." }, + "HbEL82": { + "defaultMessage": "Comment has been deleted" + }, "HkozYU": { "defaultMessage": "Switch wallet", "description": "src/components/Forms/WalletAuthForm/Connect.tsx" @@ -1100,10 +1106,6 @@ "HzB4Lk": { "defaultMessage": "Tell readers why you edited this time..." }, - "I8+06z": { - "defaultMessage": "Comment has been hidden", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "IKPYe9": { "defaultMessage": "View", "description": "src/components/Dialogs/CollectionSelectDialog/index.tsx" @@ -1206,10 +1208,6 @@ "KQi/UZ": { "defaultMessage": "Archive works" }, - "KTg17G": { - "defaultMessage": "Unpin", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "KWDSxB": { "defaultMessage": "Save revisions" }, @@ -1276,10 +1274,6 @@ "LWE7oq": { "defaultMessage": "Saving draft, are you sure you want to leave?" }, - "LYl9+i": { - "defaultMessage": "Edit", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "LaI+XV": { "defaultMessage": "By connecting ENS, benefits are:" }, @@ -1337,6 +1331,10 @@ "defaultMessage": "Operation failed, please try again later.", "description": "ACTION_FAILED" }, + "MRn08S": { + "defaultMessage": "Reply", + "description": "src/components/CircleComment/FooterActions/ReplyButton/index.tsx" + }, "MV0JlP": { "defaultMessage": "to receive more support" }, @@ -1403,6 +1401,10 @@ "defaultMessage": "Number of supporters", "description": "src/components/ArticleDigest/Published/FooterActions/index.tsx" }, + "NlX31w": { + "defaultMessage": "After deletion, the {commentType} will be removed immediately", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "NmhF45": { "defaultMessage": "Adding tags helps readers find your articles. Add or create new tags." }, @@ -1418,6 +1420,9 @@ "defaultMessage": "Forgot password?", "description": "src/components/Forms/EmailLoginForm/Buttons.tsx" }, + "O7ozeo": { + "defaultMessage": "Update profile" + }, "OIj8pQ": { "defaultMessage": "Invitation Sent", "description": "src/views/Circle/Settings/ManageInvitation/AddInvitationDialog/Sent.tsx" @@ -1437,6 +1442,10 @@ "OQ/lbb": { "defaultMessage": "Successfully linked. It would take couple hours to resolve. View transaction on {explorerName} ." }, + "OjC4aZ": { + "defaultMessage": "Author", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "Onjs6P": { "defaultMessage": "Unordered list" }, @@ -1549,10 +1558,6 @@ "defaultMessage": "Notice", "description": "src/views/Me/DraftDetail/SettingsButton/ConfirmPublishDialogContent/index.tsx" }, - "RFzVUD": { - "defaultMessage": "Unpin Broadcast", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "RGEpvx": { "defaultMessage": "Support setting", "description": "src/views/ArticleDetail/SupportWidget/EditCopyButton/index.tsx" @@ -1569,6 +1574,9 @@ "defaultMessage": "Please add email first", "description": "src/views/Me/Settings/Notifications/GeneralSettings/Email.tsx" }, + "RPH69U": { + "defaultMessage": "The author has disabled comments for this circle" + }, "RU5NDB": { "defaultMessage": "Please confirm transaction password", "description": "src/components/Forms/PaymentForm/SetPassword/index.tsx" @@ -1739,10 +1747,6 @@ "defaultMessage": "Move to bottom", "description": "src/components/ArticleDigest/DropdownActions/SetBottomCollectionButton.tsx" }, - "UgpqlF": { - "defaultMessage": "Reply", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "UjKkhq": { "defaultMessage": "Tags added", "description": "src/views/TagDetail/DropdownActions/index.tsx" @@ -1821,6 +1825,10 @@ "WFCO2w": { "defaultMessage": "Set Collection" }, + "WIOxG+": { + "defaultMessage": "Collapse", + "description": "src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx" + }, "WNxQX0": { "defaultMessage": "Add Tags" }, @@ -1855,9 +1863,9 @@ "WxhsrG": { "defaultMessage": "Please connect email" }, - "X+Xvgq": { - "defaultMessage": "Unpin Comment", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" + "XH1s8E": { + "defaultMessage": "Delete {commentType}", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" }, "XHMco9": { "defaultMessage": "subscribers", @@ -1954,6 +1962,9 @@ "defaultMessage": "My Works - Archived", "description": "src/views/Me/Works/Archived/index.tsx" }, + "YjW2MT": { + "defaultMessage": "Comment has been hidden" + }, "YlPCRU": { "defaultMessage": "connected", "description": "src/components/Notice/ArticleArticleNotice/ArticleNewCollectedNotice.tsx" @@ -1996,10 +2007,6 @@ "defaultMessage": "Edit", "description": "src/components/ArticleDigest/DropdownActions/EditButton.tsx" }, - "ZYvVYX": { - "defaultMessage": "Supporter", - "description": "src/components/Comment/DonatorLabel/index.tsx" - }, "ZZ9zIR": { "defaultMessage": "Downvote" }, @@ -2101,6 +2108,10 @@ "bSqeXm": { "defaultMessage": "{ext, select, gif {GIF format i} other {I} }mages have a {sizeInMB} megabyte (MB) size limit." }, + "bTNYGv": { + "defaultMessage": "Comment", + "description": "src/components/Forms/ArticleCommentForm/index.tsx" + }, "beLe/F": { "defaultMessage": "Broadcast" }, @@ -2118,10 +2129,6 @@ "cE4Hfw": { "defaultMessage": "Discover" }, - "cO0im6": { - "defaultMessage": "Featured", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "cPIKU2": { "defaultMessage": "Following" }, @@ -2198,6 +2205,10 @@ "defaultMessage": "Comments and replies", "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" }, + "ddJbkg": { + "defaultMessage": "Pin", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "deEeEI": { "defaultMessage": "Register" }, @@ -2297,6 +2308,10 @@ "fxhue9": { "defaultMessage": "Article will be published to IPFS, others can not tamper with it, and you own the copyright." }, + "g//2O2": { + "defaultMessage": "Uncollapse", + "description": "src/components/CircleComment/DropdownActions/UncollapseButton.tsx" + }, "g5pX+a": { "defaultMessage": "About" }, @@ -2315,10 +2330,6 @@ "gS1u3d": { "defaultMessage": "{left} modifications available" }, - "gW/KWu": { - "defaultMessage": "Comments has been pinned", - "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" - }, "gczcC5": { "defaultMessage": "Subscribe" }, @@ -2350,10 +2361,6 @@ "h9CB9m": { "defaultMessage": "The result is mainly based on the records on the chain and will be synchronized to Matters later." }, - "h9CG9E": { - "defaultMessage": "{commentType} has been deleted", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "hASeng": { "defaultMessage": "Blocked Users", "description": "src/views/Me/Settings/Misc/BlockedUsers.tsx" @@ -2376,10 +2383,6 @@ "defaultMessage": "are following", "description": "src/views/TagDetail/Followers/index.tsx" }, - "hgjjhO": { - "defaultMessage": "Comment", - "description": "src/components/Forms/CommentFormBeta/index.tsx" - }, "hk2aiz": { "defaultMessage": "followed your circle", "description": "src/components/Notice/CircleNotice/CircleNewUserNotice.tsx" @@ -2452,14 +2455,6 @@ "defaultMessage": "Sign up with email", "description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx" }, - "jJ1Brc": { - "defaultMessage": "Pin Comment", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, - "jc3mW/": { - "defaultMessage": "Supporter", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "jiB0Z2": { "defaultMessage": "Unable to bind wallet", "description": "src/components/Forms/PaymentForm/BindWallet/index.tsx" @@ -2478,10 +2473,6 @@ "k0ooDW": { "defaultMessage": "Tag Description" }, - "k1SWZ2": { - "defaultMessage": "Uncollapse", - "description": "src/components/Comment/DropdownActions/UncollapseButton.tsx" - }, "k2veDA": { "defaultMessage": "Write" }, @@ -2644,10 +2635,6 @@ "me1nR+": { "defaultMessage": "Copy Address" }, - "mikY/9": { - "defaultMessage": "Edit", - "description": "src/components/Comment/DropdownActions/EditButton.tsx" - }, "ml3SZN": { "defaultMessage": "Minimum 8 characters. Uppercase/lowercase letters, numbers and symbols are allowed" }, @@ -2699,9 +2686,6 @@ "nWhqw9": { "defaultMessage": "Publish Now" }, - "nYrKWp": { - "defaultMessage": "Edit profile" - }, "nhkx3t": { "defaultMessage": "IPFS is a decentralized storage technology that has the advantages of being decentralized, easy to survive, and difficult to be censored. Every article published on Matters is uploaded to IPFS. IPFS will incur certain storage fees, which are currently borne by Matters. (Go to the IPFS official website ipfs.com to learn more)" }, @@ -2751,10 +2735,6 @@ "pKkpI9": { "defaultMessage": "The wallet address is not the one you bound to account. Please switch it in the wallet or reconnect as:" }, - "pRV+UD": { - "defaultMessage": "Collapse", - "description": "src/components/Comment/DropdownActions/CollapseComment/Button.tsx" - }, "phAZoj": { "defaultMessage": "Collection" }, @@ -2800,6 +2780,10 @@ "defaultMessage": "Reset successful", "description": "src/components/Forms/PaymentForm/ResetPassword/Confirm.tsx" }, + "qTHZmd": { + "defaultMessage": "Only one comment can be pinned to the top", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "qVhxp5": { "defaultMessage": "Enter", "description": "src/components/Buttons/UniversalAuth/index.tsx" @@ -2828,10 +2812,6 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, - "qxKjcm": { - "defaultMessage": "Pin", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "r5pj/5": { "defaultMessage": "Drag" }, @@ -2942,10 +2922,6 @@ "defaultMessage": "Add up to 5 tags", "description": "TOO_MANY_TAGS_FOR_ARTICLE" }, - "tnWWrj": { - "defaultMessage": "The comment has been forcibly hidden", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "tqEGfa": { "defaultMessage": "Your work has been published. Share it on different platforms" }, @@ -3090,6 +3066,10 @@ "w+6UiO": { "defaultMessage": "Add Invitation" }, + "wAccv4": { + "defaultMessage": "{commentType} has been deleted", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "wCgTu5": { "defaultMessage": "Comments" }, @@ -3108,6 +3088,9 @@ "defaultMessage": "Continue", "description": "src/components/Forms/EmailSignUpForm/Init.tsx" }, + "wLSBAX": { + "defaultMessage": "After deletion, the comment will be removed immediately" + }, "wMNZJa": { "defaultMessage": "Notification not found", "description": "NOTICE_NOT_FOUND" @@ -3115,6 +3098,9 @@ "wNJjR5": { "defaultMessage": "Support setting updated" }, + "wOZRKW": { + "defaultMessage": "Delete comment" + }, "wSZR47": { "defaultMessage": "Submit" }, @@ -3240,10 +3226,6 @@ "defaultMessage": "Enter", "description": "src/components/CircleDigest/Price/index.tsx" }, - "yexhgj": { - "defaultMessage": "Only one comment can be pinned to the top", - "description": "src/components/CommentBeta/DropdownActions/PinButton.tsx" - }, "yoRaUc": { "defaultMessage": "Refund", "description": "src/components/Transaction/index.tsx" @@ -3292,10 +3274,6 @@ "zb8Kx1": { "defaultMessage": "Announcement, reminder, chattering..." }, - "zkmfjn": { - "defaultMessage": "Pinned", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "zllCbU": { "defaultMessage": "left a comment in {circleName}", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 255c4f4c01..441ba8ed8c 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -88,10 +88,6 @@ "defaultMessage": "不知道哪里出错了,过几分钟看看", "description": "UNKNOWN_ERROR" }, - "/agKbX": { - "defaultMessage": "回复评论", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "/cyuh2": { "defaultMessage": "前往授权" }, @@ -104,6 +100,10 @@ "/jJLYy": { "defaultMessage": "交易记录" }, + "/kUr1+": { + "defaultMessage": "取消置顶", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "/pnYHM": { "defaultMessage": "围炉不存在", "description": "CIRCLE_NOT_FOUND" @@ -461,6 +461,9 @@ "defaultMessage": "设定围炉门槛(每月)", "description": "src/components/Forms/CreateCircleForm/Init.tsx" }, + "6BbPcY": { + "defaultMessage": "评论已被强制隐藏" + }, "6CQaLH": { "defaultMessage": "请选择或输入金额" }, @@ -515,6 +518,10 @@ "defaultMessage": "已取消", "description": "src/components/Transaction/State/index.tsx" }, + "6vgoSf": { + "defaultMessage": "编辑评论", + "description": "src/components/CircleComment/DropdownActions/EditButton.tsx" + }, "70UCEy": { "defaultMessage": "在行动装置上使用问题,参考 ", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -526,14 +533,6 @@ "76yoL6": { "defaultMessage": "月之梦" }, - "77tYPg": { - "defaultMessage": "确认删除后,{commentType}会立即消失。", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, - "78qsg6": { - "defaultMessage": "作者", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "79Ydsg": { "defaultMessage": "提现撤销", "description": "src/components/Transaction/index.tsx" @@ -591,6 +590,10 @@ "8cv9D4": { "defaultMessage": "下一步" }, + "8gRHks": { + "defaultMessage": "置顶", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "8iciCA": { "defaultMessage": "实体不存在", "description": "ENTITY_NOT_FOUND" @@ -618,6 +621,10 @@ "9+Ddtu": { "defaultMessage": "下一步" }, + "9+vzKn": { + "defaultMessage": "编辑评论", + "description": "src/components/CircleComment/DropdownActions/index.tsx" + }, "91IQdk": { "defaultMessage": "已追踪", "description": "src/components/Buttons/FollowUser/Unfollow.tsx" @@ -637,10 +644,6 @@ "9J0iCw": { "defaultMessage": "已注销用户" }, - "9OIqBr": { - "defaultMessage": "编辑评论", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "9SXN7s": { "defaultMessage": "没有更多", "description": "src/views/ArticleDetail/Comments/LatestComments/index.tsx" @@ -696,10 +699,6 @@ "AGDFGs": { "defaultMessage": "歧视、侮辱或仇恨" }, - "AGcU5J": { - "defaultMessage": "置顶", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "ANA7sk": { "defaultMessage": "主理", "description": "src/views/TagDetail/Owner/index.tsx" @@ -805,10 +804,6 @@ "CPvyYN": { "defaultMessage": "密码错误" }, - "Cdkhl8": { - "defaultMessage": "刪除{commentType}", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "CnPG8j": { "defaultMessage": "精选" }, @@ -857,6 +852,10 @@ "defaultMessage": "徽章", "description": "src/components/UserProfile/index.tsx" }, + "DZaTBr": { + "defaultMessage": "支持者", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "DjIpR6": { "defaultMessage": "设置封面" }, @@ -871,6 +870,10 @@ "defaultMessage": "解除屏蔽", "description": "src/views/Me/Settings/Blocked/ToggleBlockButton.tsx" }, + "DrBuEI": { + "defaultMessage": "取消置顶", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "DyuHBH": { "defaultMessage": "取消代表作", "description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx" @@ -1064,6 +1067,9 @@ "HYW0fI": { "defaultMessage": "上链后,作品不可删除,去中心化保存" }, + "HbEL82": { + "defaultMessage": "评论已刪除" + }, "HkozYU": { "defaultMessage": "更换钱包", "description": "src/components/Forms/WalletAuthForm/Connect.tsx" @@ -1100,10 +1106,6 @@ "HzB4Lk": { "defaultMessage": "告知读者你此次编辑的更动有哪些⋯" }, - "I8+06z": { - "defaultMessage": "评论已隐藏", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "IKPYe9": { "defaultMessage": "查看", "description": "src/components/Dialogs/CollectionSelectDialog/index.tsx" @@ -1206,10 +1208,6 @@ "KQi/UZ": { "defaultMessage": "归档作品" }, - "KTg17G": { - "defaultMessage": "取消置顶", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "KWDSxB": { "defaultMessage": "保存编辑" }, @@ -1276,10 +1274,6 @@ "LWE7oq": { "defaultMessage": "草稿保存中,确定要离开吗?" }, - "LYl9+i": { - "defaultMessage": "编辑", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "LaI+XV": { "defaultMessage": "关联 ENS 名后,可以:" }, @@ -1337,6 +1331,10 @@ "defaultMessage": "操作失败,请稍候重试", "description": "ACTION_FAILED" }, + "MRn08S": { + "defaultMessage": "回复评论", + "description": "src/components/CircleComment/FooterActions/ReplyButton/index.tsx" + }, "MV0JlP": { "defaultMessage": "吸引更多人为你拍手!" }, @@ -1403,6 +1401,10 @@ "defaultMessage": "支持者数量", "description": "src/components/ArticleDigest/Published/FooterActions/index.tsx" }, + "NlX31w": { + "defaultMessage": "确认删除后,{commentType}会立即消失。", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "NmhF45": { "defaultMessage": "通过添加标签帮助读者更好地找到你的作品。如果没有合适的标签,你可以创建新的。" }, @@ -1418,6 +1420,9 @@ "defaultMessage": "忘记密码?", "description": "src/components/Forms/EmailLoginForm/Buttons.tsx" }, + "O7ozeo": { + "defaultMessage": "修改个人资料" + }, "OIj8pQ": { "defaultMessage": "成功发送邀请", "description": "src/views/Circle/Settings/ManageInvitation/AddInvitationDialog/Sent.tsx" @@ -1437,6 +1442,10 @@ "OQ/lbb": { "defaultMessage": "已成功关联,稍后完成。在 {explorerName} 查看记录" }, + "OjC4aZ": { + "defaultMessage": "作者", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "Onjs6P": { "defaultMessage": "无序列表" }, @@ -1549,10 +1558,6 @@ "defaultMessage": "發布须知", "description": "src/views/Me/DraftDetail/SettingsButton/ConfirmPublishDialogContent/index.tsx" }, - "RFzVUD": { - "defaultMessage": "取消置顶", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "RGEpvx": { "defaultMessage": "修改文案", "description": "src/views/ArticleDetail/SupportWidget/EditCopyButton/index.tsx" @@ -1569,6 +1574,9 @@ "defaultMessage": "请先绑定邮箱", "description": "src/views/Me/Settings/Notifications/GeneralSettings/Email.tsx" }, + "RPH69U": { + "defaultMessage": "作者已关闭评论区" + }, "RU5NDB": { "defaultMessage": "请再次输入交易密码", "description": "src/components/Forms/PaymentForm/SetPassword/index.tsx" @@ -1739,10 +1747,6 @@ "defaultMessage": "移至底部", "description": "src/components/ArticleDigest/DropdownActions/SetBottomCollectionButton.tsx" }, - "UgpqlF": { - "defaultMessage": "回复", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "UjKkhq": { "defaultMessage": "作品已添加标签", "description": "src/views/TagDetail/DropdownActions/index.tsx" @@ -1821,6 +1825,10 @@ "WFCO2w": { "defaultMessage": "关联作品" }, + "WIOxG+": { + "defaultMessage": "取消折叠", + "description": "src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx" + }, "WNxQX0": { "defaultMessage": "添加标签" }, @@ -1855,9 +1863,9 @@ "WxhsrG": { "defaultMessage": "请先绑定邮箱" }, - "X+Xvgq": { - "defaultMessage": "取消精选", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" + "XH1s8E": { + "defaultMessage": "刪除{commentType}", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" }, "XHMco9": { "defaultMessage": "人", @@ -1954,6 +1962,9 @@ "defaultMessage": "我的创作 - 已归档", "description": "src/views/Me/Works/Archived/index.tsx" }, + "YjW2MT": { + "defaultMessage": "评论已隐藏" + }, "YlPCRU": { "defaultMessage": "关联了", "description": "src/components/Notice/ArticleArticleNotice/ArticleNewCollectedNotice.tsx" @@ -1996,10 +2007,6 @@ "defaultMessage": "修改", "description": "src/components/ArticleDigest/DropdownActions/EditButton.tsx" }, - "ZYvVYX": { - "defaultMessage": "支持者", - "description": "src/components/Comment/DonatorLabel/index.tsx" - }, "ZZ9zIR": { "defaultMessage": "点踩" }, @@ -2101,6 +2108,10 @@ "bSqeXm": { "defaultMessage": "{ext, select, gif {GIF 格式} other {} }图片大小不得超过 {sizeInMB}MB" }, + "bTNYGv": { + "defaultMessage": "评论", + "description": "src/components/Forms/ArticleCommentForm/index.tsx" + }, "beLe/F": { "defaultMessage": "广播" }, @@ -2118,10 +2129,6 @@ "cE4Hfw": { "defaultMessage": "发现" }, - "cO0im6": { - "defaultMessage": "作者精选", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "cPIKU2": { "defaultMessage": "追踪中" }, @@ -2198,6 +2205,10 @@ "defaultMessage": "评论和回复", "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" }, + "ddJbkg": { + "defaultMessage": "置顶", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "deEeEI": { "defaultMessage": "注册" }, @@ -2297,6 +2308,10 @@ "fxhue9": { "defaultMessage": "作品将发布至 IPFS,无法被他人删改,创作权归你所有。" }, + "g//2O2": { + "defaultMessage": "取消折叠", + "description": "src/components/CircleComment/DropdownActions/取消折叠Button.tsx" + }, "g5pX+a": { "defaultMessage": "关于" }, @@ -2315,10 +2330,6 @@ "gS1u3d": { "defaultMessage": "你还可以修改 {left} 次" }, - "gW/KWu": { - "defaultMessage": "评论被精选", - "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" - }, "gczcC5": { "defaultMessage": "订阅" }, @@ -2350,10 +2361,6 @@ "h9CB9m": { "defaultMessage": "结果以链上记录为主,稍后同步至 Matters" }, - "h9CG9E": { - "defaultMessage": "{commentType}已刪除", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "hASeng": { "defaultMessage": "已屏蔽用户", "description": "src/views/Me/Settings/Misc/BlockedUsers.tsx" @@ -2376,10 +2383,6 @@ "defaultMessage": "人追踪", "description": "src/views/TagDetail/Followers/index.tsx" }, - "hgjjhO": { - "defaultMessage": "评论", - "description": "src/components/Forms/CommentFormBeta/index.tsx" - }, "hk2aiz": { "defaultMessage": "追踪了你的围炉", "description": "src/components/Notice/CircleNotice/CircleNewUserNotice.tsx" @@ -2452,14 +2455,6 @@ "defaultMessage": "邮箱注册", "description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx" }, - "jJ1Brc": { - "defaultMessage": "喜欢回应", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, - "jc3mW/": { - "defaultMessage": "支持者", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "jiB0Z2": { "defaultMessage": "无法绑定钱包", "description": "src/components/Forms/PaymentForm/BindWallet/index.tsx" @@ -2478,10 +2473,6 @@ "k0ooDW": { "defaultMessage": "标签描述" }, - "k1SWZ2": { - "defaultMessage": "取消折叠", - "description": "src/components/Comment/DropdownActions/UncollapseButton.tsx" - }, "k2veDA": { "defaultMessage": "创作" }, @@ -2644,10 +2635,6 @@ "me1nR+": { "defaultMessage": "复制地址" }, - "mikY/9": { - "defaultMessage": "编辑", - "description": "src/components/Comment/DropdownActions/EditButton.tsx" - }, "ml3SZN": { "defaultMessage": "至少 8 个字符,支持英文大小写字母、数字和特殊符号" }, @@ -2699,9 +2686,6 @@ "nWhqw9": { "defaultMessage": "立即发布" }, - "nYrKWp": { - "defaultMessage": "编辑个人信息" - }, "nhkx3t": { "defaultMessage": "IPFS 是一种分散式储存技术,具有去中心、易存续、不易被审查等优点。 每一篇在 Matters 发布的文章都会上传到 IPFS。 IPFS 会产生一定储存费用,目前暂时由 Matters 承担。 (到 IPFS 官网 ipfs.com 可以了解更多)" }, @@ -2751,10 +2735,6 @@ "pKkpI9": { "defaultMessage": "The wallet address is not the one you bound to account. Please switch it in the wallet or reconnect as:" }, - "pRV+UD": { - "defaultMessage": "折叠", - "description": "src/components/Comment/DropdownActions/CollapseComment/Button.tsx" - }, "phAZoj": { "defaultMessage": "选集" }, @@ -2800,6 +2780,10 @@ "defaultMessage": "交易密码重置成功", "description": "src/components/Forms/PaymentForm/ResetPassword/Confirm.tsx" }, + "qTHZmd": { + "defaultMessage": "仅能置顶一则评论", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "qVhxp5": { "defaultMessage": "进入", "description": "src/components/Buttons/UniversalAuth/index.tsx" @@ -2828,10 +2812,6 @@ "quRPwZ": { "defaultMessage": "支付请求已送出" }, - "qxKjcm": { - "defaultMessage": "置顶", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "r5pj/5": { "defaultMessage": "拖拽" }, @@ -2942,10 +2922,6 @@ "defaultMessage": "标签添加最多至 5 个", "description": "TOO_MANY_TAGS_FOR_ARTICLE" }, - "tnWWrj": { - "defaultMessage": "评论已被强制隐藏", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "tqEGfa": { "defaultMessage": "作品发布成功,快把作品分享到不同渠道," }, @@ -3090,6 +3066,10 @@ "w+6UiO": { "defaultMessage": "新增邀请" }, + "wAccv4": { + "defaultMessage": "{commentType}已刪除", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "wCgTu5": { "defaultMessage": "评论" }, @@ -3108,6 +3088,9 @@ "defaultMessage": "注册", "description": "src/components/Forms/EmailSignUpForm/Init.tsx" }, + "wLSBAX": { + "defaultMessage": "确认删除后,评论会立即消失。" + }, "wMNZJa": { "defaultMessage": "通知不存在", "description": "NOTICE_NOT_FOUND" @@ -3115,6 +3098,9 @@ "wNJjR5": { "defaultMessage": "支持反馈设置成功" }, + "wOZRKW": { + "defaultMessage": "刪除评论" + }, "wSZR47": { "defaultMessage": "提交" }, @@ -3240,10 +3226,6 @@ "defaultMessage": "进入围炉", "description": "src/components/CircleDigest/Price/index.tsx" }, - "yexhgj": { - "defaultMessage": "仅能置顶一则评论", - "description": "src/components/CommentBeta/DropdownActions/PinButton.tsx" - }, "yoRaUc": { "defaultMessage": "退款", "description": "src/components/Transaction/index.tsx" @@ -3292,10 +3274,6 @@ "zb8Kx1": { "defaultMessage": "公告、提醒、碎碎念…" }, - "zkmfjn": { - "defaultMessage": "置頂", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "zllCbU": { "defaultMessage": "在 {circleName} 中留言", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index c1b71e6453..09a7988e67 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -88,10 +88,6 @@ "defaultMessage": "不知道哪裏出錯了,過幾分鐘看看", "description": "UNKNOWN_ERROR" }, - "/agKbX": { - "defaultMessage": "回覆評論", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "/cyuh2": { "defaultMessage": "前往授權" }, @@ -104,6 +100,10 @@ "/jJLYy": { "defaultMessage": "交易紀錄" }, + "/kUr1+": { + "defaultMessage": "取消置頂", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "/pnYHM": { "defaultMessage": "圍爐不存在", "description": "CIRCLE_NOT_FOUND" @@ -461,6 +461,9 @@ "defaultMessage": "設定圍爐門檻(每月)", "description": "src/components/Forms/CreateCircleForm/Init.tsx" }, + "6BbPcY": { + "defaultMessage": "因違反社區約章,評論已被隱藏" + }, "6CQaLH": { "defaultMessage": "請選擇或輸入金額" }, @@ -515,6 +518,10 @@ "defaultMessage": "已取消", "description": "src/components/Transaction/State/index.tsx" }, + "6vgoSf": { + "defaultMessage": "編輯", + "description": "src/components/CircleComment/DropdownActions/EditButton.tsx" + }, "70UCEy": { "defaultMessage": "在行動裝置上使用問題,參考 ", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -526,14 +533,6 @@ "76yoL6": { "defaultMessage": "月之夢" }, - "77tYPg": { - "defaultMessage": "確認刪除後,{commentType}會立即消失。", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, - "78qsg6": { - "defaultMessage": "作者", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "79Ydsg": { "defaultMessage": "提現撤銷", "description": "src/components/Transaction/index.tsx" @@ -591,6 +590,10 @@ "8cv9D4": { "defaultMessage": "下一步" }, + "8gRHks": { + "defaultMessage": "置頂", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "8iciCA": { "defaultMessage": "實體不存在", "description": "ENTITY_NOT_FOUND" @@ -618,6 +621,10 @@ "9+Ddtu": { "defaultMessage": "下一步" }, + "9+vzKn": { + "defaultMessage": "編輯", + "description": "src/components/CircleComment/DropdownActions/index.tsx" + }, "91IQdk": { "defaultMessage": "已追蹤", "description": "src/components/Buttons/FollowUser/Unfollow.tsx" @@ -637,10 +644,6 @@ "9J0iCw": { "defaultMessage": "已註銷用戶" }, - "9OIqBr": { - "defaultMessage": "編輯評論", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "9SXN7s": { "defaultMessage": "沒有更多", "description": "src/views/ArticleDetail/Comments/LatestComments/index.tsx" @@ -696,10 +699,6 @@ "AGDFGs": { "defaultMessage": "歧視、侮辱或仇恨" }, - "AGcU5J": { - "defaultMessage": "置頂", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "ANA7sk": { "defaultMessage": "主理", "description": "src/views/TagDetail/Owner/index.tsx" @@ -805,10 +804,6 @@ "CPvyYN": { "defaultMessage": "密碼錯誤" }, - "Cdkhl8": { - "defaultMessage": "刪除{commentType}", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "CnPG8j": { "defaultMessage": "精選" }, @@ -857,6 +852,10 @@ "defaultMessage": "徽章", "description": "src/components/UserProfile/index.tsx" }, + "DZaTBr": { + "defaultMessage": "支持者", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "DjIpR6": { "defaultMessage": "設置封面" }, @@ -871,6 +870,10 @@ "defaultMessage": "解除封鎖", "description": "src/views/Me/Settings/Blocked/ToggleBlockButton.tsx" }, + "DrBuEI": { + "defaultMessage": "取消置頂", + "description": "src/components/CircleComment/DropdownActions/PinButton.tsx" + }, "DyuHBH": { "defaultMessage": "取消代表作", "description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx" @@ -1064,6 +1067,9 @@ "HYW0fI": { "defaultMessage": "上鏈後,作品不可刪除,去中心化保存" }, + "HbEL82": { + "defaultMessage": "評論已刪除" + }, "HkozYU": { "defaultMessage": "更換錢包", "description": "src/components/Forms/WalletAuthForm/Connect.tsx" @@ -1100,10 +1106,6 @@ "HzB4Lk": { "defaultMessage": "告知讀者你此次編輯的更動有哪些⋯" }, - "I8+06z": { - "defaultMessage": "評論已隱藏", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "IKPYe9": { "defaultMessage": "查看", "description": "src/components/Dialogs/CollectionSelectDialog/index.tsx" @@ -1206,10 +1208,6 @@ "KQi/UZ": { "defaultMessage": "封存作品" }, - "KTg17G": { - "defaultMessage": "取消置頂", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "KWDSxB": { "defaultMessage": "保存編輯" }, @@ -1276,10 +1274,6 @@ "LWE7oq": { "defaultMessage": "草稿保存中,確定要離開嗎?" }, - "LYl9+i": { - "defaultMessage": "編輯", - "description": "src/components/Comment/DropdownActions/index.tsx" - }, "LaI+XV": { "defaultMessage": "關聯 ENS 名後,可以:" }, @@ -1337,6 +1331,10 @@ "defaultMessage": "操作失敗,請稍候重試", "description": "ACTION_FAILED" }, + "MRn08S": { + "defaultMessage": "回覆", + "description": "src/components/CircleComment/FooterActions/ReplyButton/index.tsx" + }, "MV0JlP": { "defaultMessage": "吸引更多人為你拍手!" }, @@ -1403,6 +1401,10 @@ "defaultMessage": "支持者數量", "description": "src/components/ArticleDigest/Published/FooterActions/index.tsx" }, + "NlX31w": { + "defaultMessage": "確認刪除後,{commentType}會立即消失。", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "NmhF45": { "defaultMessage": "通過添加標籤幫助讀者更好地找到你的作品。如果沒有合適的標籤,你可以創建新的。" }, @@ -1418,6 +1420,9 @@ "defaultMessage": "忘記密碼?", "description": "src/components/Forms/EmailLoginForm/Buttons.tsx" }, + "O7ozeo": { + "defaultMessage": "修改個人資料" + }, "OIj8pQ": { "defaultMessage": "成功發送邀請", "description": "src/views/Circle/Settings/ManageInvitation/AddInvitationDialog/Sent.tsx" @@ -1437,6 +1442,10 @@ "OQ/lbb": { "defaultMessage": "已成功關聯,稍後完成。在 {explorerName} 查看紀錄" }, + "OjC4aZ": { + "defaultMessage": "作者", + "description": "src/components/ArticleComment/RoleLabel/index.tsx" + }, "Onjs6P": { "defaultMessage": "無序清單" }, @@ -1549,10 +1558,6 @@ "defaultMessage": "發布須知", "description": "src/views/Me/DraftDetail/SettingsButton/ConfirmPublishDialogContent/index.tsx" }, - "RFzVUD": { - "defaultMessage": "取消置頂", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "RGEpvx": { "defaultMessage": "修改文案", "description": "src/views/ArticleDetail/SupportWidget/EditCopyButton/index.tsx" @@ -1569,6 +1574,9 @@ "defaultMessage": "請先綁定郵箱", "description": "src/views/Me/Settings/Notifications/GeneralSettings/Email.tsx" }, + "RPH69U": { + "defaultMessage": "作者已關閉評論區" + }, "RU5NDB": { "defaultMessage": "請再次輸入交易密碼", "description": "src/components/Forms/PaymentForm/SetPassword/index.tsx" @@ -1739,10 +1747,6 @@ "defaultMessage": "移至底部", "description": "src/components/ArticleDigest/DropdownActions/SetBottomCollectionButton.tsx" }, - "UgpqlF": { - "defaultMessage": "回覆", - "description": "src/components/Comment/FooterActions/ReplyButton/index.tsx" - }, "UjKkhq": { "defaultMessage": "作品已添加標籤", "description": "src/views/TagDetail/DropdownActions/index.tsx" @@ -1821,6 +1825,10 @@ "WFCO2w": { "defaultMessage": "關聯作品" }, + "WIOxG+": { + "defaultMessage": "闔上", + "description": "src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx" + }, "WNxQX0": { "defaultMessage": "添加標籤" }, @@ -1855,9 +1863,9 @@ "WxhsrG": { "defaultMessage": "請先綁定電子郵件" }, - "X+Xvgq": { - "defaultMessage": "取消精選", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" + "XH1s8E": { + "defaultMessage": "刪除{commentType}", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" }, "XHMco9": { "defaultMessage": "人", @@ -1954,6 +1962,9 @@ "defaultMessage": "我的創作 - 已封存", "description": "src/views/Me/Works/Archived/index.tsx" }, + "YjW2MT": { + "defaultMessage": "評論已隱藏" + }, "YlPCRU": { "defaultMessage": "關聯了", "description": "src/components/Notice/ArticleArticleNotice/ArticleNewCollectedNotice.tsx" @@ -1996,10 +2007,6 @@ "defaultMessage": "修改", "description": "src/components/ArticleDigest/DropdownActions/EditButton.tsx" }, - "ZYvVYX": { - "defaultMessage": "支持者", - "description": "src/components/Comment/DonatorLabel/index.tsx" - }, "ZZ9zIR": { "defaultMessage": "點踩" }, @@ -2101,6 +2108,10 @@ "bSqeXm": { "defaultMessage": "{ext, select, gif {GIF 格式} other {} }圖片大小不得超過 {sizeInMB}MB" }, + "bTNYGv": { + "defaultMessage": "評論", + "description": "src/components/Forms/ArticleCommentForm/index.tsx" + }, "beLe/F": { "defaultMessage": "廣播" }, @@ -2118,10 +2129,6 @@ "cE4Hfw": { "defaultMessage": "發現" }, - "cO0im6": { - "defaultMessage": "作者精選", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "cPIKU2": { "defaultMessage": "追蹤中" }, @@ -2198,6 +2205,10 @@ "defaultMessage": "評論和回覆", "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" }, + "ddJbkg": { + "defaultMessage": "置頂", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "deEeEI": { "defaultMessage": "註冊" }, @@ -2297,6 +2308,10 @@ "fxhue9": { "defaultMessage": "作品將發布至 IPFS,無法被他人刪改,創作權歸你所有。" }, + "g//2O2": { + "defaultMessage": "取消闔上", + "description": "src/components/CircleComment/DropdownActions/UncollapseButton.tsx" + }, "g5pX+a": { "defaultMessage": "關於" }, @@ -2315,10 +2330,6 @@ "gS1u3d": { "defaultMessage": "你還可以修改 {left} 次" }, - "gW/KWu": { - "defaultMessage": "評論被精選", - "description": "src/views/Me/Settings/Notifications/GeneralSettings/index.tsx" - }, "gczcC5": { "defaultMessage": "訂閱" }, @@ -2350,10 +2361,6 @@ "h9CB9m": { "defaultMessage": "結果以鏈上紀錄為主,稍後同步至 Matters" }, - "h9CG9E": { - "defaultMessage": "{commentType}已刪除", - "description": "src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx" - }, "hASeng": { "defaultMessage": "已封鎖用戶", "description": "src/views/Me/Settings/Misc/BlockedUsers.tsx" @@ -2376,10 +2383,6 @@ "defaultMessage": "人追蹤", "description": "src/views/TagDetail/Followers/index.tsx" }, - "hgjjhO": { - "defaultMessage": "評論", - "description": "src/components/Forms/CommentFormBeta/index.tsx" - }, "hk2aiz": { "defaultMessage": "追蹤了你的圍爐", "description": "src/components/Notice/CircleNotice/CircleNewUserNotice.tsx" @@ -2452,14 +2455,6 @@ "defaultMessage": "電子郵件註冊", "description": "src/components/Forms/SelectAuthMethodForm/NormalFeed.tsx" }, - "jJ1Brc": { - "defaultMessage": "喜歡回應", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, - "jc3mW/": { - "defaultMessage": "支持者", - "description": "src/components/Comment/RoleLabel/index.tsx" - }, "jiB0Z2": { "defaultMessage": "無法綁定錢包", "description": "src/components/Forms/PaymentForm/BindWallet/index.tsx" @@ -2478,10 +2473,6 @@ "k0ooDW": { "defaultMessage": "標籤描述" }, - "k1SWZ2": { - "defaultMessage": "取消闔上", - "description": "src/components/Comment/DropdownActions/UncollapseButton.tsx" - }, "k2veDA": { "defaultMessage": "創作" }, @@ -2644,10 +2635,6 @@ "me1nR+": { "defaultMessage": "複製地址" }, - "mikY/9": { - "defaultMessage": "編輯", - "description": "src/components/Comment/DropdownActions/EditButton.tsx" - }, "ml3SZN": { "defaultMessage": "至少 8 個字元,支持英文大小寫字母、數字和特殊符號" }, @@ -2699,9 +2686,6 @@ "nWhqw9": { "defaultMessage": "立即發布" }, - "nYrKWp": { - "defaultMessage": "編輯個人資料" - }, "nhkx3t": { "defaultMessage": "IPFS 是一種分散式儲存技術,具有去中心、易存續、不易被審查等優點。 每一篇在 Matters 發佈的文章都會上傳到 IPFS。 IPFS 會產生一定儲存費用,目前暫時由 Matters 承擔。 (到 IPFS 官網 ipfs.com 可以了解更多)" }, @@ -2751,10 +2735,6 @@ "pKkpI9": { "defaultMessage": "The wallet address is not the one you bound to account. Please switch it in the wallet or reconnect as:" }, - "pRV+UD": { - "defaultMessage": "闔上", - "description": "src/components/Comment/DropdownActions/CollapseComment/Button.tsx" - }, "phAZoj": { "defaultMessage": "選集" }, @@ -2800,6 +2780,10 @@ "defaultMessage": "交易密碼重置成功", "description": "src/components/Forms/PaymentForm/ResetPassword/Confirm.tsx" }, + "qTHZmd": { + "defaultMessage": "僅能置頂一則評論", + "description": "src/components/ArticleComment/DropdownActions/PinButton.tsx" + }, "qVhxp5": { "defaultMessage": "進入", "description": "src/components/Buttons/UniversalAuth/index.tsx" @@ -2828,10 +2812,6 @@ "quRPwZ": { "defaultMessage": "支付請求已送出" }, - "qxKjcm": { - "defaultMessage": "置頂", - "description": "src/components/Comment/DropdownActions/PinButton.tsx" - }, "r5pj/5": { "defaultMessage": "拖拽" }, @@ -2942,10 +2922,6 @@ "defaultMessage": "標籤添加最多至 5 個", "description": "TOO_MANY_TAGS_FOR_ARTICLE" }, - "tnWWrj": { - "defaultMessage": "因違反社區約章,評論已被隱藏", - "description": "src/components/CommentBeta/Content/index.tsx" - }, "tqEGfa": { "defaultMessage": "作品發佈成功,快把作品分享到不同渠道," }, @@ -3090,6 +3066,10 @@ "w+6UiO": { "defaultMessage": "新增邀請" }, + "wAccv4": { + "defaultMessage": "{commentType}已刪除", + "description": "src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx" + }, "wCgTu5": { "defaultMessage": "評論" }, @@ -3108,6 +3088,9 @@ "defaultMessage": "註冊", "description": "src/components/Forms/EmailSignUpForm/Init.tsx" }, + "wLSBAX": { + "defaultMessage": "確認刪除後,評論會立即消失。" + }, "wMNZJa": { "defaultMessage": "通知不存在", "description": "NOTICE_NOT_FOUND" @@ -3115,6 +3098,9 @@ "wNJjR5": { "defaultMessage": "支持反饋設置成功" }, + "wOZRKW": { + "defaultMessage": "刪除評論" + }, "wSZR47": { "defaultMessage": "提交" }, @@ -3240,10 +3226,6 @@ "defaultMessage": "進入圍爐", "description": "src/components/CircleDigest/Price/index.tsx" }, - "yexhgj": { - "defaultMessage": "僅能置頂一則評論", - "description": "src/components/CommentBeta/DropdownActions/PinButton.tsx" - }, "yoRaUc": { "defaultMessage": "退款", "description": "src/components/Transaction/index.tsx" @@ -3292,10 +3274,6 @@ "zb8Kx1": { "defaultMessage": "公告、提醒、碎碎念…" }, - "zkmfjn": { - "defaultMessage": "置頂", - "description": "src/components/Comment/PinnedLabel/index.tsx" - }, "zllCbU": { "defaultMessage": "在 {circleName} 中留言", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" diff --git a/package-lock.json b/package-lock.json index 9f0de6bdfa..adce68b632 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "matters-web", - "version": "5.1.1", + "version": "5.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "matters-web", - "version": "5.1.1", + "version": "5.1.3", "license": "Apache-2.0", "dependencies": { "@apollo/react-common": "^3.1.3", @@ -15,7 +15,7 @@ "@artsy/fresnel": "^6.1.0", "@ensdomains/content-hash": "^2.5.7", "@matters/apollo-upload-client": "^11.1.0", - "@matters/matters-editor": "^0.2.5-alpha.4", + "@matters/matters-editor": "^0.2.5-alpha.6", "@next/bundle-analyzer": "^13.4.9", "@reach/alert": "^0.18.0", "@reach/dialog": "^0.18.0", @@ -28,15 +28,14 @@ "@tiptap/extension-bubble-menu": "^2.4.0", "@tiptap/extension-floating-menu": "^2.4.0", "@tiptap/extension-placeholder": "^2.4.0", + "@tiptap/suggestion": "^2.4.0", "@use-gesture/react": "^10.3.1", "apollo-cache-inmemory": "^1.6.6", - "apollo-cache-persist": "^0.1.1", "apollo-client": "^2.6.10", "apollo-link": "^1.2.14", "apollo-link-context": "^1.0.20", "apollo-link-error": "^1.1.13", "apollo-link-persisted-queries": "^0.2.5", - "apollo-link-ws": "^1.0.20", "apollo-utilities": "^1.3.4", "autosize": "^6.0.1", "classnames": "^2.3.2", @@ -56,7 +55,6 @@ "date-fns": "^2.30.0", "embla-carousel-react": "^7.1.0", "express": "^4.17.1", - "fastest-levenshtein": "^1.0.16", "file-type": "^16.5.4", "fingerprintjs2": "^2.1.4", "firebase": "^9.22.0", @@ -64,7 +62,6 @@ "graphql": "^14.7.0", "graphql-tag": "^2.12.6", "husky": "^8.0.3", - "identity-obj-proxy": "^3.0.0", "js-base64": "^3.7.5", "js-cookie": "^3.0.5", "jump.js": "^1.0.2", @@ -85,7 +82,6 @@ "react-intl": "^6.4.4", "react-markdown": "^8.0.7", "react-movable": "^3.0.4", - "react-remove-scroll": "^2.5.6", "react-spring": "^9.7.2", "react-stickynode": "^4.1.1", "url-loader": "^4.1.1", @@ -7517,9 +7513,9 @@ } }, "node_modules/@matters/matters-editor": { - "version": "0.2.5-alpha.4", - "resolved": "https://registry.npmjs.org/@matters/matters-editor/-/matters-editor-0.2.5-alpha.4.tgz", - "integrity": "sha512-Ehhf+yir+OmJf4CM8PKvz7ctNioXMC+/CM94A5hJtnyd4tOAKFBQ7INb7ZJlTpgZfHLeW+7FioDBHqctjMjDcQ==", + "version": "0.2.5-alpha.6", + "resolved": "https://registry.npmjs.org/@matters/matters-editor/-/matters-editor-0.2.5-alpha.6.tgz", + "integrity": "sha512-074GixLcKTQeUH0e9+NEKaiPy8uXAlckQkASOpUj2V8VslEA/v4xC3BJzANeFZpuNAnYleSzn7DdM10RyEUBHw==", "dependencies": { "@tiptap/core": "2.4.0", "@tiptap/extension-blockquote": "2.4.0", @@ -7561,6 +7557,7 @@ "remark-rehype": "^11.1.0", "remark-stringify": "^11.0.0", "unified": "^11.0.4", + "validator": "^13.12.0", "zeed-dom": "^0.13.3" }, "engines": { @@ -17906,11 +17903,6 @@ "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" } }, - "node_modules/apollo-cache-persist": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/apollo-cache-persist/-/apollo-cache-persist-0.1.1.tgz", - "integrity": "sha512-/7GAyblPR169ryW3ugbtHqiU0UGkhIt10NeaO2gn2ClxjLHF/nIkJD5mx/0OCF2vLNbbnzLZVDeIO1pf72TrEA==" - }, "node_modules/apollo-client": { "version": "2.6.10", "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", @@ -17987,18 +17979,6 @@ "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, - "node_modules/apollo-link-ws": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/apollo-link-ws/-/apollo-link-ws-1.0.20.tgz", - "integrity": "sha512-mjSFPlQxmoLArpHBeUb2Xj+2HDYeTaJqFGOqQ+I8NVJxgL9lJe84PDWcPah/yMLv3rB7QgBDSuZ0xoRFBPlySw==", - "dependencies": { - "apollo-link": "^1.2.14", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "subscriptions-transport-ws": "^0.9.0" - } - }, "node_modules/apollo-utilities": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", @@ -24904,6 +24884,7 @@ "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, "engines": { "node": ">= 4.9.1" } @@ -26710,11 +26691,6 @@ "node": ">=6" } }, - "node_modules/harmony-reflect": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.2.tgz", - "integrity": "sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==" - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -28521,17 +28497,6 @@ "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==" }, - "node_modules/identity-obj-proxy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", - "integrity": "sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==", - "dependencies": { - "harmony-reflect": "^1.4.6" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -38227,30 +38192,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-remove-scroll": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz", - "integrity": "sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==", - "dependencies": { - "react-remove-scroll-bar": "^2.3.4", - "react-style-singleton": "^2.2.1", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.0", - "use-sidecar": "^1.1.2" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/react-remove-scroll-bar": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz", @@ -38277,11 +38218,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, - "node_modules/react-remove-scroll/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, "node_modules/react-spring": { "version": "9.7.2", "resolved": "https://registry.npmjs.org/react-spring/-/react-spring-9.7.2.tgz", @@ -44347,9 +44283,9 @@ } }, "node_modules/validator": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", - "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", "engines": { "node": ">= 0.10" } @@ -51881,9 +51817,9 @@ } }, "@matters/matters-editor": { - "version": "0.2.5-alpha.4", - "resolved": "https://registry.npmjs.org/@matters/matters-editor/-/matters-editor-0.2.5-alpha.4.tgz", - "integrity": "sha512-Ehhf+yir+OmJf4CM8PKvz7ctNioXMC+/CM94A5hJtnyd4tOAKFBQ7INb7ZJlTpgZfHLeW+7FioDBHqctjMjDcQ==", + "version": "0.2.5-alpha.6", + "resolved": "https://registry.npmjs.org/@matters/matters-editor/-/matters-editor-0.2.5-alpha.6.tgz", + "integrity": "sha512-074GixLcKTQeUH0e9+NEKaiPy8uXAlckQkASOpUj2V8VslEA/v4xC3BJzANeFZpuNAnYleSzn7DdM10RyEUBHw==", "requires": { "@tiptap/core": "2.4.0", "@tiptap/extension-blockquote": "2.4.0", @@ -51925,6 +51861,7 @@ "remark-rehype": "^11.1.0", "remark-stringify": "^11.0.0", "unified": "^11.0.4", + "validator": "^13.12.0", "zeed-dom": "^0.13.3" }, "dependencies": { @@ -59206,11 +59143,6 @@ "tslib": "^1.10.0" } }, - "apollo-cache-persist": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/apollo-cache-persist/-/apollo-cache-persist-0.1.1.tgz", - "integrity": "sha512-/7GAyblPR169ryW3ugbtHqiU0UGkhIt10NeaO2gn2ClxjLHF/nIkJD5mx/0OCF2vLNbbnzLZVDeIO1pf72TrEA==" - }, "apollo-client": { "version": "2.6.10", "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", @@ -59275,15 +59207,6 @@ "hash.js": "^1.1.7" } }, - "apollo-link-ws": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/apollo-link-ws/-/apollo-link-ws-1.0.20.tgz", - "integrity": "sha512-mjSFPlQxmoLArpHBeUb2Xj+2HDYeTaJqFGOqQ+I8NVJxgL9lJe84PDWcPah/yMLv3rB7QgBDSuZ0xoRFBPlySw==", - "requires": { - "apollo-link": "^1.2.14", - "tslib": "^1.9.3" - } - }, "apollo-utilities": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", @@ -64611,7 +64534,8 @@ "fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==" + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true }, "fastq": { "version": "1.10.0", @@ -66005,11 +65929,6 @@ "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true }, - "harmony-reflect": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.2.tgz", - "integrity": "sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -67423,14 +67342,6 @@ "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==" }, - "identity-obj-proxy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", - "integrity": "sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==", - "requires": { - "harmony-reflect": "^1.4.6" - } - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -74507,25 +74418,6 @@ "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", "dev": true }, - "react-remove-scroll": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz", - "integrity": "sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==", - "requires": { - "react-remove-scroll-bar": "^2.3.4", - "react-style-singleton": "^2.2.1", - "tslib": "^2.1.0", - "use-callback-ref": "^1.3.0", - "use-sidecar": "^1.1.2" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - } - } - }, "react-remove-scroll-bar": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz", @@ -79062,9 +78954,9 @@ } }, "validator": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", - "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==" + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==" }, "valtio": { "version": "1.11.2", diff --git a/package.json b/package.json index 3e34a1917b..449ca19401 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "5.1.2", + "version": "5.1.3", "description": "codebase of Matters' website", "author": "Matters ", "engines": { @@ -45,7 +45,7 @@ "@artsy/fresnel": "^6.1.0", "@ensdomains/content-hash": "^2.5.7", "@matters/apollo-upload-client": "^11.1.0", - "@matters/matters-editor": "^0.2.5-alpha.4", + "@matters/matters-editor": "^0.2.5-alpha.6", "@next/bundle-analyzer": "^13.4.9", "@reach/alert": "^0.18.0", "@reach/dialog": "^0.18.0", @@ -58,15 +58,14 @@ "@tiptap/extension-bubble-menu": "^2.4.0", "@tiptap/extension-floating-menu": "^2.4.0", "@tiptap/extension-placeholder": "^2.4.0", + "@tiptap/suggestion": "^2.4.0", "@use-gesture/react": "^10.3.1", "apollo-cache-inmemory": "^1.6.6", - "apollo-cache-persist": "^0.1.1", "apollo-client": "^2.6.10", "apollo-link": "^1.2.14", "apollo-link-context": "^1.0.20", "apollo-link-error": "^1.1.13", "apollo-link-persisted-queries": "^0.2.5", - "apollo-link-ws": "^1.0.20", "apollo-utilities": "^1.3.4", "autosize": "^6.0.1", "classnames": "^2.3.2", @@ -86,7 +85,6 @@ "date-fns": "^2.30.0", "embla-carousel-react": "^7.1.0", "express": "^4.17.1", - "fastest-levenshtein": "^1.0.16", "file-type": "^16.5.4", "fingerprintjs2": "^2.1.4", "firebase": "^9.22.0", @@ -94,7 +92,6 @@ "graphql": "^14.7.0", "graphql-tag": "^2.12.6", "husky": "^8.0.3", - "identity-obj-proxy": "^3.0.0", "js-base64": "^3.7.5", "js-cookie": "^3.0.5", "jump.js": "^1.0.2", @@ -115,7 +112,6 @@ "react-intl": "^6.4.4", "react-markdown": "^8.0.7", "react-movable": "^3.0.4", - "react-remove-scroll": "^2.5.6", "react-spring": "^9.7.2", "react-stickynode": "^4.1.1", "url-loader": "^4.1.1", diff --git a/src/common/enums/article.ts b/src/common/enums/article.ts index 10d29e3050..8d53ba3cb8 100644 --- a/src/common/enums/article.ts +++ b/src/common/enums/article.ts @@ -1,3 +1,4 @@ export const COMMENTS_COUNT = 40 export const TOOLBAR_FIXEDTOOLBAR_ID = 'toolbar/fixedToolbar/id' export const COMMENT_FEED_ID_PREFIX = 'comment-feed-' +export const SUPPORT_TAB_PREFERENCE_KEY = 'support-tab-preference-key' diff --git a/src/common/enums/test.ts b/src/common/enums/test.ts index 973c9a152c..4f86afd00d 100644 --- a/src/common/enums/test.ts +++ b/src/common/enums/test.ts @@ -79,6 +79,8 @@ export enum TEST_ID { ARTICLE_TOOLBAR = 'article/toolbar', ARTICLE_BOOKMARK = 'article/bookmark', ARTICLE_COMMENT_FEED = 'article/comment/feed', + // circle + CIRCLE_COMMENT_FEED = 'circle/comment/feed', // payto PAY_TO_CURRENCY_CHOICE = 'payto/currency-choice', // comment diff --git a/src/common/styles/variables/typography.css b/src/common/styles/variables/typography.css index 5fe368db6e..f870c300c1 100644 --- a/src/common/styles/variables/typography.css +++ b/src/common/styles/variables/typography.css @@ -1,22 +1,16 @@ :root { /* Font Stack */ --font-sans-tc: -apple-system, blinkmacsystemfont, 'Helvetica Neue', - 'Segoe UI', roboto, arial, 'PingFang TC', 'PingFang SC', 'Noto Sans TC', - 'Noto Sans SC', 'Noto Sans CJK TC', 'Noto Sans CJK SC', 'Source Han Sans TW', - 'Source Han Sans CN', 'Microsoft JhengHei', 'Microsoft YaHei', - 'WenQuanYi Micro Hei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; + 'Segoe UI', roboto, arial, 'PingFang TC', 'PingFang SC', + 'Microsoft JhengHei', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji'; --font-sans-sc: -apple-system, blinkmacsystemfont, 'Helvetica Neue', - 'Segoe UI', roboto, arial, 'PingFang SC', 'PingFang TC', 'Noto Sans SC', - 'Noto Sans TC', 'Noto Sans CJK SC', 'Noto Sans CJK TC', 'Source Han Sans CN', - 'Source Han Sans TW', 'Microsoft YaHei', 'Microsoft JhengHei', - 'WenQuanYi Micro Hei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; - --font-serif-tc: 'Noto Serif', 'Noto Serif TC', 'Noto Serif SC', - 'Noto Serif CJK TC', 'Noto Serif CJK SC', 'Source Han Serif TW', - 'Source Han Serif CN', 'Songti TC', 'Songti SC', 'NSimSun', 'SimSun', serif, + 'Segoe UI', roboto, arial, 'PingFang SC', 'PingFang TC', 'Microsoft YaHei', + 'Microsoft JhengHei', 'WenQuanYi Micro Hei', sans-serif, 'Apple Color Emoji', + 'Segoe UI Emoji'; + --font-serif-tc: 'Songti TC', 'Songti SC', 'NSimSun', 'SimSun', serif, 'Apple Color Emoji', 'Segoe UI Emoji'; - --font-serif-sc: 'Noto Serif', 'Noto Serif SC', 'Noto Serif TC', - 'Noto Serif CJK SC', 'Noto Serif CJK TC', 'Source Han Sans CN', - 'Source Han Sans TW', 'Songti SC', 'Songti TC', 'NSimSun', 'SimSun', serif, + --font-serif-sc: 'Songti SC', 'Songti TC', 'NSimSun', 'SimSun', serif, 'Apple Color Emoji', 'Segoe UI Emoji'; --font-mono: menlo, 'SFMono-Regular', consolas, monaco, monospace, 'Apple Color Emoji', 'Segoe UI Emoji'; diff --git a/src/common/utils/comment.ts b/src/common/utils/comment.ts index 98afd1d0be..d63ca50662 100644 --- a/src/common/utils/comment.ts +++ b/src/common/utils/comment.ts @@ -15,6 +15,10 @@ interface Comment { } | null } +type Response = { + articleState?: string +} + const filterComment = (comment: Comment) => { // skip if comment's state is active or collapse if ( @@ -55,15 +59,17 @@ export function filterComments(comments: Comment[]): T[] { * * @param responses */ -export function filterResponses(responses: any[]): T[] { - return responses.filter((response) => { +export function filterResponses( + responses: T[] +): T[] { + return responses.filter((response: T) => { // article if (_has(response, 'articleState')) { return true } // comment - return filterComment(response) + return filterComment(response as Comment) }) } diff --git a/src/common/utils/cookie.ts b/src/common/utils/cookie.ts index 8a9337a021..1ef8e4b171 100644 --- a/src/common/utils/cookie.ts +++ b/src/common/utils/cookie.ts @@ -2,6 +2,8 @@ import Cookie, { CookieAttributes } from 'js-cookie' import { COOKIE_EXPIRES_IN_DAYS } from '~/common/enums' +const isLocal = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'local' + export const getCookieOptions = () => { return { expires: COOKIE_EXPIRES_IN_DAYS, @@ -22,7 +24,7 @@ export const getIsomorphicCookie = (cookie: string, name: string) => { } export const getCookie = (name: string) => { - if (process.env.DEBUG) { + if (isLocal) { console.log('[cookie:GET]', name) } return Cookie.get(name) @@ -33,7 +35,7 @@ export const setCookies = (cookies: { [name: string]: string }) => { const names = Object.keys(cookies) names.forEach((name) => { - if (process.env.DEBUG) { + if (isLocal) { console.log('[cookie:SET]', name, cookies[name]) } Cookie.set(name, cookies[name], options) @@ -43,7 +45,7 @@ export const setCookies = (cookies: { [name: string]: string }) => { export const removeCookies = (names: string[]) => { const options = getCookieOptions() names.forEach((name) => { - if (process.env.DEBUG) { + if (isLocal) { console.log('[cookie:REMOVE]', names) } Cookie.remove(name, options) diff --git a/src/common/utils/resolvers/clientPreference.ts b/src/common/utils/resolvers/clientPreference.ts index e9a83198a5..06d858c7a9 100644 --- a/src/common/utils/resolvers/clientPreference.ts +++ b/src/common/utils/resolvers/clientPreference.ts @@ -1,4 +1,4 @@ -const clientPreferenceResolver = (_: any) => { +const clientPreferenceResolver = (_: unknown) => { return { __typename: 'ClientPreference', id: 'local', diff --git a/src/common/utils/resolvers/commentDraft.ts b/src/common/utils/resolvers/commentDraft.ts deleted file mode 100644 index 4853c3aea2..0000000000 --- a/src/common/utils/resolvers/commentDraft.ts +++ /dev/null @@ -1,12 +0,0 @@ -const commentDraftResolver = ( - root: any, - { input: { id } }: { input: { id: string } } -) => { - return { - id, - content: root?.commentDraft?.content || '', - __typename: 'CommentDraft', - } -} - -export default commentDraftResolver diff --git a/src/common/utils/resolvers/index.ts b/src/common/utils/resolvers/index.ts index ef09c5c772..2434499555 100644 --- a/src/common/utils/resolvers/index.ts +++ b/src/common/utils/resolvers/index.ts @@ -1,11 +1,9 @@ import clientPreference from './clientPreference' -import commentDraft from './commentDraft' import gatewayUrls from './gatewayUrls' import lastFetchRandom from './lastFetchRandom' export const resolvers = { Query: { - commentDraft, clientPreference, lastFetchRandom, }, diff --git a/src/common/utils/resolvers/lastFetchRandom.ts b/src/common/utils/resolvers/lastFetchRandom.ts index 5736ba0b55..215e41a8c0 100644 --- a/src/common/utils/resolvers/lastFetchRandom.ts +++ b/src/common/utils/resolvers/lastFetchRandom.ts @@ -1,4 +1,4 @@ -const lastFetchRandomResolver = (_: any) => { +const lastFetchRandomResolver = (_: unknown) => { // time-based random for better homepage UX on SSR const minutes = new Date().getMinutes() const max = 10 diff --git a/src/common/utils/storage.ts b/src/common/utils/storage.ts index 2dc0e39d24..5ffe3edf7c 100644 --- a/src/common/utils/storage.ts +++ b/src/common/utils/storage.ts @@ -1,3 +1,5 @@ +const isLocal = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'local' + const parseJSON = (data: string | null) => { if (!data) { return null @@ -14,30 +16,60 @@ const parseJSON = (data: string | null) => { return returnData } +// via https://mmazzarolo.com/blog/2022-06-25-local-storage-status/ +function isQuotaExceededError(err: unknown): boolean { + return ( + err instanceof DOMException && + // everything except Firefox + (err.code === 22 || + // Firefox + err.code === 1014 || + // test name field too, because code might not be present + // everything except Firefox + err.name === 'QuotaExceededError' || + // Firefox + err.name === 'NS_ERROR_DOM_QUOTA_REACHED') + ) +} + /** * LocalStorage wrapper that supports object value * * (works on CSR) */ export const storage = { - get: (key: string) => { - if (process.env.DEBUG) { + get: (key: string): T | null => { + if (isLocal) { console.log(`[storage:GET] ${key}`) } - return parseJSON(localStorage.getItem(key)) + if (typeof window === 'undefined') { + return null + } + return parseJSON(window.localStorage.getItem(key)) }, - set: (key: string, value: any) => { - if (process.env.DEBUG) { + set: (key: string, value: T) => { + if (isLocal) { console.log(`[storage:SET] ${key}`, value) } - return localStorage.setItem(key, JSON.stringify(value)) + + try { + window.localStorage.setItem(key, JSON.stringify(value)) + } catch (err) { + if (isQuotaExceededError(err)) { + // clear all and set again + window.localStorage.clear() + window.localStorage.setItem(key, JSON.stringify(value)) + } else { + console.error('Local storage not supported') + } + } }, - remove: (key: string) => { - if (process.env.DEBUG) { + remove: (key: string): T | null => { + if (isLocal) { console.log(`[storage:REMOVE] ${key}`) } - const item = parseJSON(localStorage.getItem(key)) - localStorage.removeItem(key) + const item = parseJSON(window.localStorage.getItem(key)) + window.localStorage.removeItem(key) return item }, } @@ -48,24 +80,93 @@ export const storage = { * (works on CSR) */ export const sessionStorage = { - get: (key: string) => { - if (process.env.DEBUG) { - console.log(`[storage:GET] ${key}`) + get: (key: string): T | null => { + if (isLocal) { + console.log(`[sessionStorage:GET] ${key}`) + } + if (typeof window === 'undefined') { + return null } return parseJSON(window.sessionStorage.getItem(key)) }, - set: (key: string, value: any) => { - if (process.env.DEBUG) { - console.log(`[storage:SET] ${key}`, value) + set: (key: string, value: T) => { + if (isLocal) { + console.log(`[sessionStorage:SET] ${key}`, value) } - return window.sessionStorage.setItem(key, JSON.stringify(value)) + window.sessionStorage.setItem(key, JSON.stringify(value)) }, - remove: (key: string) => { - if (process.env.DEBUG) { - console.log(`[storage:REMOVE] ${key}`) + remove: (key: string): T | null => { + if (isLocal) { + console.log(`[sessionStorage:REMOVE] ${key}`) } const item = parseJSON(window.sessionStorage.getItem(key)) window.sessionStorage.removeItem(key) return item }, } + +/** + * Store form draft in session or local storage + * + * Use cases: + * - Comment + * - Edit profile + * - ... + */ +type FormStorageKey = `form-draft:${string}:${string}` +type FormStorageType = 'session' | 'local' +type FormGenKeyProps = { + authorId: string + formId: string +} +type FormGenArticleCommentKeyProps = { + authorId: string + articleId: string + parentId?: string + replyToId?: string +} + +type FormGenCircleCommentKeyProps = { + authorId: string + circleId: string + type: string + parentId?: string + replyToId?: string +} + +export const formStorage = { + genKey: ({ authorId, formId }: FormGenKeyProps): FormStorageKey => + `form-draft:${authorId}:${formId}`, + genArticleCommentKey: ({ + authorId, + articleId, + parentId, + replyToId, + }: FormGenArticleCommentKeyProps): FormStorageKey => + `form-draft:${authorId}:${articleId}:${parentId || 0}:${replyToId || 0}`, + genCircleCommentKey: ({ + authorId, + circleId, + type, + parentId, + replyToId, + }: FormGenCircleCommentKeyProps): FormStorageKey => + `form-draft:${authorId}:${circleId}:${type}:${parentId || 0}:${ + replyToId || 0 + }`, + get: (key: FormStorageKey, type: FormStorageType): T | null => { + return type === 'session' ? sessionStorage.get(key) : storage.get(key) + }, + set: (key: FormStorageKey, value: T, type: FormStorageType) => { + type === 'session' + ? sessionStorage.set(key, value) + : storage.set(key, value) + }, + remove: (key: FormStorageKey, type: FormStorageType): T | null => { + if (type === 'session') { + return sessionStorage.remove(key) + } else { + return storage.remove(key) + } + }, +} diff --git a/src/common/utils/text/article.test.ts b/src/common/utils/text/article.test.ts index 8c1062a896..e4c1852243 100644 --- a/src/common/utils/text/article.test.ts +++ b/src/common/utils/text/article.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest' import { + containsFigureTag, countChars, makeSummary, - measureDiffs, normalizeArticleTitle, optimizeEmbed, stripHtml, @@ -89,27 +89,6 @@ describe('utils/text/article/makeSummary', () => { }) }) -describe('utils/text/article/measureDiffs', () => { - it('should measure diffs correctly', () => { - // no diff - expect(measureDiffs('Hello, world!', 'Hello, world!')).toBe(0) - - // suffix - expect(measureDiffs('Hello, world!', 'Hello, world?')).toBe(1) - expect(measureDiffs('Hello, world!', 'Hello, world')).toBe(1) - expect(measureDiffs('Hello, world!', 'Hello, world!!!')).toBe(2) - - // prefix - expect(measureDiffs('Hello, world!', '.Hello, world!')).toBe(1) - expect(measureDiffs('Hello, world!', 'ello, world!')).toBe(1) - expect(measureDiffs('Hello, world!', 'Aello, world!')).toBe(1) - - // middle - expect(measureDiffs('Hello, world!', 'Hello,world!')).toBe(1) - expect(measureDiffs('Hello, world!', 'Hello, sorld!')).toBe(1) - }) -}) - describe('utils/text/article/normalizeArticleTitle', () => { it('should normalize article title correctly', () => { expect(normalizeArticleTitle('Hello, world!', 1)).toBe('…') @@ -153,3 +132,21 @@ describe('utils/text/article/optimizeEmbed', () => { expect(optimizeEmbed(input).trim()).toBe(expected.trim()) }) }) + +describe('utils/text/article/containsFigureTag', () => { + it('should return true if the content contains a figure tag', () => { + expect(containsFigureTag('
')).toBe(true) + expect(containsFigureTag('
content
')).toBe(true) + expect( + containsFigureTag( + '
' + ) + ).toBe(true) + }) + + it('should return false if the content does not contain a figure tag', () => { + expect(containsFigureTag('')).toBe(false) + expect(containsFigureTag('

content

')).toBe(false) + expect(containsFigureTag('')).toBe(false) + }) +}) diff --git a/src/common/utils/text/article.ts b/src/common/utils/text/article.ts index 69959e671a..d54bfd20ba 100644 --- a/src/common/utils/text/article.ts +++ b/src/common/utils/text/article.ts @@ -1,5 +1,3 @@ -import { distance } from 'fastest-levenshtein' - import { toSizedImageURL } from '../url' /** @@ -128,7 +126,10 @@ export const optimizeEmbed = (content: string) => { } /** - * Get distances of two context diffs. + * Match figure tag in HTML content. */ -export const measureDiffs = (source: string, target: string) => - distance(source, target) +const REGEXP_FIGURE_TAG = new RegExp(']*>(.*?)') + +export const containsFigureTag = (content: string) => { + return REGEXP_FIGURE_TAG.test(content) +} diff --git a/src/common/utils/types/index.ts b/src/common/utils/types/index.ts index b0233ada7a..b1e5de6557 100644 --- a/src/common/utils/types/index.ts +++ b/src/common/utils/types/index.ts @@ -2,7 +2,6 @@ import gql from 'graphql-tag' export default gql` extend type Query { - commentDraft(input: CommentDraftInput!): CommentDraft! clientPreference: ClientPreference! lastFetchRandom: LastFetchRandom! } @@ -11,15 +10,6 @@ export default gql` gatewayUrls: [String!] } - type CommentDraft { - id: ID! - content: String! - } - - input CommentDraftInput { - id: ID! - } - type ClientPreference { id: ID! diff --git a/src/common/utils/url.ts b/src/common/utils/url.ts index 32ec61ccf4..3a00f8be60 100644 --- a/src/common/utils/url.ts +++ b/src/common/utils/url.ts @@ -2,6 +2,10 @@ export { default as isUrl } from 'validator/lib/isURL' import { URL_COLLECTION_DETAIL } from '../enums' +type Sorter = { + [key: string]: string +} + export const parseURL = (url: string) => { const parser = document.createElement('a') @@ -85,7 +89,7 @@ export const toSizedImageURL = ({ } export const parseSorter = (sorterStr: string) => { - const sorter: { [key: string]: string } = {} + const sorter: Sorter = {} if (sorterStr === '') { return sorter } @@ -101,7 +105,7 @@ export const parseSorter = (sorterStr: string) => { return sorter } -export const stringifySorter = (sorter: any) => { +export const stringifySorter = (sorter: Sorter) => { let sorterStr = '' const keys = Object.keys(sorter) keys.map((key, index) => { diff --git a/src/common/utils/withApollo.ts b/src/common/utils/withApollo.ts index 8a2f8e3ea1..84203a2fb4 100644 --- a/src/common/utils/withApollo.ts +++ b/src/common/utils/withApollo.ts @@ -33,6 +33,7 @@ const fragmentMatcher = new IntrospectionFragmentMatcher({ introspectionQueryResultData, }) +const isLocal = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'local' const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production' /** @@ -122,7 +123,7 @@ const authLink = setContext((operation, { headers, ...restCtx }) => { const operationVariables = operation.variables || {} const isPublicOperation = restCtx[GQL_CONTEXT_PUBLIC_QUERY_KEY] - if (process.env.DEBUG) { + if (isLocal) { console.log( `%c[GraphQL operation]%c ${operationName} ` + `${isPublicOperation ? '' : '(w/ credentials)'}` + @@ -185,7 +186,7 @@ const agentHashLink = setContext((_, { headers }) => { let hash: string | null = null if (typeof window !== 'undefined') { - const stored = storage.get(STORAGE_KEY_AGENT_HASH) + const stored = storage.get(STORAGE_KEY_AGENT_HASH) if (stored && stored.startsWith(AGENT_HASH_PREFIX)) { hash = stored } diff --git a/src/components/Analytics/AnalyticsListener/index.ts b/src/components/Analytics/AnalyticsListener/index.ts index b49de36544..35466319fa 100644 --- a/src/components/Analytics/AnalyticsListener/index.ts +++ b/src/components/Analytics/AnalyticsListener/index.ts @@ -15,6 +15,8 @@ import { AnalyticsUserFragment } from '~/gql/graphql' import { fragments } from './gql' +const isLocal = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'local' + declare global { interface Window { gtag: any @@ -32,7 +34,7 @@ const FIREBASE_CONFIG = process.env.NEXT_PUBLIC_FIREBASE_CONFIG : {} const analyticsDebugger = (event: string, params: any) => { - if (process.env.DEBUG) { + if (isLocal) { console.log( `%c[Analytics debugger]%c ${event} %cVariables`, 'background: #800080; color: #fff', diff --git a/src/components/Comment/Content/Collapsed.test.tsx b/src/components/ArticleComment/Content/Collapsed.test.tsx similarity index 100% rename from src/components/Comment/Content/Collapsed.test.tsx rename to src/components/ArticleComment/Content/Collapsed.test.tsx diff --git a/src/components/CommentBeta/Content/Collapsed.tsx b/src/components/ArticleComment/Content/Collapsed.tsx similarity index 100% rename from src/components/CommentBeta/Content/Collapsed.tsx rename to src/components/ArticleComment/Content/Collapsed.tsx diff --git a/src/components/CommentBeta/Content/Content.test.tsx b/src/components/ArticleComment/Content/Content.test.tsx similarity index 85% rename from src/components/CommentBeta/Content/Content.test.tsx rename to src/components/ArticleComment/Content/Content.test.tsx index 67859e7ee4..62c64fbc07 100644 --- a/src/components/CommentBeta/Content/Content.test.tsx +++ b/src/components/ArticleComment/Content/Content.test.tsx @@ -4,11 +4,11 @@ import { cleanup, render, screen } from '~/common/utils/test' import { CommentState } from '~/gql/graphql' import { MOCK_COMMENT } from '~/stories/mocks' -import CommentContent from './' +import { ArticleCommentContent } from './' describe('', () => { it('should render a Comment.Content', () => { - render() + render() const $content = screen.getByText(MOCK_COMMENT.content) expect($content).toBeInTheDocument() @@ -17,13 +17,12 @@ describe('', () => { it('should render a collapsed Comment.Content', () => { // collapsed by author render( - ) expect(screen.getByText('Comment has been hidden')).toBeInTheDocument() @@ -31,13 +30,12 @@ describe('', () => { // blocked by user cleanup() render( - ) expect(screen.getByText('Comment has been hidden')).toBeInTheDocument() @@ -45,12 +43,11 @@ describe('', () => { // banned by user cleanup() render( - ) expect( @@ -60,12 +57,11 @@ describe('', () => { it('should render an archived Comment.Content', () => { render( - ) expect( diff --git a/src/components/CommentBeta/Content/index.tsx b/src/components/ArticleComment/Content/index.tsx similarity index 78% rename from src/components/CommentBeta/Content/index.tsx rename to src/components/ArticleComment/Content/index.tsx index 6dabd685d4..a7b74a9628 100644 --- a/src/components/CommentBeta/Content/index.tsx +++ b/src/components/ArticleComment/Content/index.tsx @@ -5,18 +5,18 @@ import { FormattedMessage } from 'react-intl' import { COMMENT_TYPE_TEXT, TEST_ID } from '~/common/enums' import { captureClicks } from '~/common/utils' -import { CommentFormType, Expandable, LanguageContext } from '~/components' +import { Expandable, LanguageContext } from '~/components' import { - ContentCommentPrivateFragment, - ContentCommentPublicFragment, + ArticleCommentContentCommentPrivateFragment, + ArticleCommentContentCommentPublicFragment, } from '~/gql/graphql' import Collapsed from './Collapsed' import styles from './styles.module.css' interface ContentProps { - comment: ContentCommentPublicFragment & Partial - type: CommentFormType + comment: ArticleCommentContentCommentPublicFragment & + Partial size?: 14 | 15 bgColor?: 'greyLighter' | 'white' limit?: number @@ -27,14 +27,14 @@ interface ContentProps { const fragments = { comment: { public: gql` - fragment ContentCommentPublic on Comment { + fragment ArticleCommentContentCommentPublic on Comment { id content state } `, private: gql` - fragment ContentCommentPrivate on Comment { + fragment ArticleCommentContentCommentPrivate on Comment { id author { id @@ -45,9 +45,8 @@ const fragments = { }, } -const Content = ({ +export const ArticleCommentContent = ({ comment, - type, size, bgColor, limit = 5, @@ -69,8 +68,7 @@ const Content = ({

) @@ -83,8 +81,7 @@ const Content = ({ collapsedContent={ } className={contentClasses} @@ -124,7 +121,7 @@ const Content = ({

) @@ -133,6 +130,4 @@ const Content = ({ return null } -Content.fragments = fragments - -export default Content +ArticleCommentContent.fragments = fragments diff --git a/src/components/CommentBeta/Content/styles.module.css b/src/components/ArticleComment/Content/styles.module.css similarity index 100% rename from src/components/CommentBeta/Content/styles.module.css rename to src/components/ArticleComment/Content/styles.module.css diff --git a/src/components/CommentBeta/DropdownActions/CopyCommentButton.tsx b/src/components/ArticleComment/DropdownActions/CopyCommentButton.tsx similarity index 100% rename from src/components/CommentBeta/DropdownActions/CopyCommentButton.tsx rename to src/components/ArticleComment/DropdownActions/CopyCommentButton.tsx diff --git a/src/components/CommentBeta/DropdownActions/DeleteComment/Button.tsx b/src/components/ArticleComment/DropdownActions/DeleteComment/Button.tsx similarity index 100% rename from src/components/CommentBeta/DropdownActions/DeleteComment/Button.tsx rename to src/components/ArticleComment/DropdownActions/DeleteComment/Button.tsx diff --git a/src/components/CommentBeta/DropdownActions/DeleteComment/Dialog.tsx b/src/components/ArticleComment/DropdownActions/DeleteComment/Dialog.tsx similarity index 73% rename from src/components/CommentBeta/DropdownActions/DeleteComment/Dialog.tsx rename to src/components/ArticleComment/DropdownActions/DeleteComment/Dialog.tsx index 9049a4ffd5..818ac8de5d 100644 --- a/src/components/CommentBeta/DropdownActions/DeleteComment/Dialog.tsx +++ b/src/components/ArticleComment/DropdownActions/DeleteComment/Dialog.tsx @@ -1,12 +1,9 @@ import gql from 'graphql-tag' -import { useContext } from 'react' import { FormattedMessage } from 'react-intl' -import { COMMENT_TYPE_TEXT, TEST_ID } from '~/common/enums' +import { TEST_ID } from '~/common/enums' import { - CommentFormType, Dialog, - LanguageContext, toast, useDialogSwitch, useMutation, @@ -14,8 +11,8 @@ import { } from '~/components' import { updateArticleComments, updateArticlePublic } from '~/components/GQL' import { + ArticleCommentDropdownActionsCommentPublicFragment, DeleteCommentMutation, - DropdownActionsCommentBetaPublicFragment, } from '~/gql/graphql' const DELETE_COMMENT = gql` @@ -28,14 +25,12 @@ const DELETE_COMMENT = gql` ` export interface DeleteCommentDialogProps { - comment: DropdownActionsCommentBetaPublicFragment - type: CommentFormType + comment: ArticleCommentDropdownActionsCommentPublicFragment children: ({ openDialog }: { openDialog: () => void }) => React.ReactNode } const DeleteCommentDialog = ({ comment, - type, children, }: DeleteCommentDialogProps) => { const { show, openDialog, closeDialog } = useDialogSwitch(true) @@ -44,8 +39,6 @@ const DeleteCommentDialog = ({ const article = comment.node.__typename === 'Article' ? comment.node : undefined - const { lang } = useContext(LanguageContext) - const [deleteComment] = useMutation(DELETE_COMMENT, { variables: { id: commentId }, optimisticResponse: { @@ -91,12 +84,8 @@ const DeleteCommentDialog = ({ toast.success({ message: ( ), }) @@ -113,14 +102,7 @@ const DeleteCommentDialog = ({ > + } /> @@ -128,12 +110,8 @@ const DeleteCommentDialog = ({

diff --git a/src/components/Comment/DropdownActions/DeleteComment/index.tsx b/src/components/ArticleComment/DropdownActions/DeleteComment/index.tsx similarity index 100% rename from src/components/Comment/DropdownActions/DeleteComment/index.tsx rename to src/components/ArticleComment/DropdownActions/DeleteComment/index.tsx diff --git a/src/components/CommentBeta/DropdownActions/DropdownActions.test.tsx b/src/components/ArticleComment/DropdownActions/DropdownActions.test.tsx similarity index 94% rename from src/components/CommentBeta/DropdownActions/DropdownActions.test.tsx rename to src/components/ArticleComment/DropdownActions/DropdownActions.test.tsx index 91804b0f97..c651172166 100644 --- a/src/components/CommentBeta/DropdownActions/DropdownActions.test.tsx +++ b/src/components/ArticleComment/DropdownActions/DropdownActions.test.tsx @@ -7,13 +7,12 @@ import { MOCK_COMMENT } from '~/stories/mocks' import DropdownActions from './' -describe('', () => { +describe('', () => { // hasPin it('should render pin buttons', async () => { render( ) @@ -30,7 +29,6 @@ describe('', () => { render( ) @@ -55,7 +53,6 @@ describe('', () => { pinned: false, parentComment: null, }} - type="article" hasPin /> ) @@ -71,7 +68,6 @@ describe('', () => { render( ) diff --git a/src/components/CommentBeta/DropdownActions/PinButton.tsx b/src/components/ArticleComment/DropdownActions/PinButton.tsx similarity index 72% rename from src/components/CommentBeta/DropdownActions/PinButton.tsx rename to src/components/ArticleComment/DropdownActions/PinButton.tsx index 472b343e57..626946085c 100644 --- a/src/components/CommentBeta/DropdownActions/PinButton.tsx +++ b/src/components/ArticleComment/DropdownActions/PinButton.tsx @@ -3,25 +3,23 @@ import { FormattedMessage } from 'react-intl' import { ReactComponent as IconPin } from '@/public/static/icons/24px/pin.svg' import { ReactComponent as IconUnpin } from '@/public/static/icons/24px/unpin.svg' -import { REFETCH_CIRCLE_DETAIL } from '~/common/enums' import { - CommentFormType, + ArticleThreadCommentType, Icon, Menu, - ThreadCommentType, toast, useMutation, } from '~/components' import { updateArticleComments } from '~/components/GQL' -import TOGGLE_PIN_COMMENT from '~/components/GQL/mutations/togglePinComment' +import { TOGGLE_ARTICLE_PIN_COMMENT } from '~/components/GQL/mutations/togglePinComment' import { - PinButtonCommentFragment, - TogglePinCommentMutation, + ArticleCommentPinButtonCommentFragment, + ToggleArticlePinCommentMutation, } from '~/gql/graphql' const fragments = { comment: gql` - fragment PinButtonComment on Comment { + fragment ArticleCommentPinButtonComment on Comment { id pinned node { @@ -29,30 +27,24 @@ const fragments = { id pinCommentLeft } - ... on Circle { - id - name - } } } `, } const PinButton = ({ - type, comment, pinnedComment, }: { - type: CommentFormType - comment: PinButtonCommentFragment - pinnedComment?: ThreadCommentType + comment: ArticleCommentPinButtonCommentFragment + pinnedComment?: ArticleThreadCommentType }) => { const article = comment.node.__typename === 'Article' ? comment.node : undefined const canPin = !pinnedComment - const [unpinComment] = useMutation( - TOGGLE_PIN_COMMENT, + const [unpinComment] = useMutation( + TOGGLE_ARTICLE_PIN_COMMENT, { variables: { id: comment.id, enabled: false }, optimisticResponse: { @@ -77,8 +69,8 @@ const PinButton = ({ }, } ) - const [pinComment] = useMutation( - TOGGLE_PIN_COMMENT, + const [pinComment] = useMutation( + TOGGLE_ARTICLE_PIN_COMMENT, { variables: { id: comment.id, enabled: true }, optimisticResponse: { @@ -110,14 +102,13 @@ const PinButton = ({ text={ } icon={} onClick={async () => { await unpinComment() - window.dispatchEvent(new CustomEvent(REFETCH_CIRCLE_DETAIL)) }} /> ) @@ -128,8 +119,8 @@ const PinButton = ({ text={ } icon={} @@ -141,8 +132,8 @@ const PinButton = ({ message: ( ), }) diff --git a/src/components/CommentBeta/DropdownActions/index.tsx b/src/components/ArticleComment/DropdownActions/index.tsx similarity index 81% rename from src/components/CommentBeta/DropdownActions/index.tsx rename to src/components/ArticleComment/DropdownActions/index.tsx index 58af1ff5a9..020a4f0518 100644 --- a/src/components/CommentBeta/DropdownActions/index.tsx +++ b/src/components/ArticleComment/DropdownActions/index.tsx @@ -7,13 +7,12 @@ import { FormattedMessage, useIntl } from 'react-intl' import { ReactComponent as IconMore } from '@/public/static/icons/24px/more.svg' import { ERROR_CODES, ERROR_MESSAGES } from '~/common/enums' import { + ArticleThreadCommentType, Button, - CommentFormType, Dropdown, Icon, Menu, SubmitReport, - ThreadCommentType, toast, ViewerContext, withDialog, @@ -21,8 +20,8 @@ import { import { BlockUser } from '~/components/BlockUser' import { SubmitReportDialogProps } from '~/components/Dialogs/SubmitReportDialog/Dialog' import { - DropdownActionsCommentBetaPrivateFragment, - DropdownActionsCommentBetaPublicFragment, + ArticleCommentDropdownActionsCommentPrivateFragment, + ArticleCommentDropdownActionsCommentPublicFragment, } from '~/gql/graphql' import CopyCommentButton from './CopyCommentButton' @@ -42,10 +41,9 @@ export type DropdownActionsControls = { } type DropdownActionsProps = { - comment: DropdownActionsCommentBetaPublicFragment & - Partial - pinnedComment?: ThreadCommentType - type: CommentFormType + comment: ArticleCommentDropdownActionsCommentPublicFragment & + Partial + pinnedComment?: ArticleThreadCommentType } & DropdownActionsControls interface Controls { @@ -65,7 +63,7 @@ type BaseDropdownActionsProps = DropdownActionsProps & Controls & DialogProps const fragments = { comment: { public: gql` - fragment DropdownActionsCommentBetaPublic on Comment { + fragment ArticleCommentDropdownActionsCommentPublic on Comment { id state content @@ -85,13 +83,13 @@ const fragments = { } } } - ...PinButtonComment + ...ArticleCommentPinButtonComment } ${PinButton.fragments.comment} ${BlockUser.fragments.user.public} `, private: gql` - fragment DropdownActionsCommentBetaPrivate on Comment { + fragment ArticleCommentDropdownActionsCommentPrivate on Comment { id author { id @@ -115,10 +113,7 @@ const fragments = { const BaseDropdownActions = ({ comment, pinnedComment, - type, - inCard, - hasCopy, hasPin, hasDelete, hasReport, @@ -133,14 +128,8 @@ const BaseDropdownActions = ({ const Content = () => ( - {hasCopy && } - {_hasPin && ( - - )} + + {_hasPin && } {hasReport && } {(_hasPin || hasReport) && hasDelete && } {hasDelete && ( @@ -175,7 +164,7 @@ const BaseDropdownActions = ({ } const DropdownActions = (props: DropdownActionsProps) => { - const { comment, type, hasPin = true } = props + const { comment, hasPin = true } = props const viewer = useContext(ViewerContext) const { isArchived, isFrozen } = viewer @@ -189,7 +178,6 @@ const DropdownActions = (props: DropdownActionsProps) => { const isDescendantComment = comment.parentComment const controls = { - hasCopy: viewer.id === comment.author.id, hasPin: hasPin && !!(isTargetAuthor && isActive && !isDescendantComment), hasDelete: !!(isCommentAuthor && isActive), hasReport: !isCommentAuthor, @@ -216,21 +204,13 @@ const DropdownActions = (props: DropdownActionsProps) => { const WithDeleteComment = withDialog< Omit - >( - WithReport, - DeleteComment.Dialog, - { - comment, - type, - }, - ({ openDialog }) => { - return { - ...props, - ...controls, - openDeleteCommentDialog: isFrozen ? forbid : openDialog, - } + >(WithReport, DeleteComment.Dialog, { comment }, ({ openDialog }) => { + return { + ...props, + ...controls, + openDeleteCommentDialog: isFrozen ? forbid : openDialog, } - ) + }) return } diff --git a/src/components/CommentBeta/Feed/Feed.test.tsx b/src/components/ArticleComment/Feed/Feed.test.tsx similarity index 85% rename from src/components/CommentBeta/Feed/Feed.test.tsx rename to src/components/ArticleComment/Feed/Feed.test.tsx index 193bffb50c..6c43d50000 100644 --- a/src/components/CommentBeta/Feed/Feed.test.tsx +++ b/src/components/ArticleComment/Feed/Feed.test.tsx @@ -2,12 +2,12 @@ import { describe, expect, it } from 'vitest' import { TEST_ID } from '~/common/enums' import { render, screen } from '~/common/utils/test' -import { Comment } from '~/components' +import { ArticleCommentFeed } from '~/components' import { MOCK_COMMENT } from '~/stories/mocks' describe('', () => { it('should render a Comment.Feed', () => { - render() + render() const $digest = screen.getByTestId(TEST_ID.ARTICLE_COMMENT_FEED) expect($digest).toBeInTheDocument() diff --git a/src/components/CommentBeta/Feed/gql.ts b/src/components/ArticleComment/Feed/gql.ts similarity index 60% rename from src/components/CommentBeta/Feed/gql.ts rename to src/components/ArticleComment/Feed/gql.ts index 76350de441..cf327a5cd1 100644 --- a/src/components/CommentBeta/Feed/gql.ts +++ b/src/components/ArticleComment/Feed/gql.ts @@ -2,7 +2,7 @@ import gql from 'graphql-tag' import { UserDigest } from '~/components/UserDigest' -import Content from '../Content' +import { ArticleCommentContent } from '../Content' import DropdownActions from '../DropdownActions' import FooterActions from '../FooterActions' import PinnedLabel from '../PinnedLabel' @@ -12,7 +12,7 @@ import RoleLabel from '../RoleLabel' export const fragments = { comment: { public: gql` - fragment FeedCommentBetaPublic on Comment { + fragment ArticleFeedCommentPublic on Comment { id type author { @@ -28,10 +28,10 @@ export const fragments = { } } ...RoleLabelComment - ...PinnedLabelBetaComment - ...FooterActionsCommentBetaPublic - ...DropdownActionsCommentBetaPublic - ...ContentCommentPublic + ...PinnedLabelComment + ...ArticleCommentFooterActionsCommentPublic + ...ArticleCommentDropdownActionsCommentPublic + ...ArticleCommentContentCommentPublic } ${UserDigest.Mini.fragments.user} ${ReplyTo.fragments.user} @@ -39,35 +39,35 @@ export const fragments = { ${PinnedLabel.fragments.comment} ${FooterActions.fragments.comment.public} ${DropdownActions.fragments.comment.public} - ${Content.fragments.comment.public} + ${ArticleCommentContent.fragments.comment.public} `, private: gql` - fragment FeedCommentBetaPrivate on Comment { + fragment ArticleFeedCommentPrivate on Comment { id - ...FooterActionsCommentBetaPrivate - ...DropdownActionsCommentBetaPrivate - ...ContentCommentPrivate + ...ArticleCommentFooterActionsCommentPrivate + ...ArticleCommentDropdownActionsCommentPrivate + ...ArticleCommentContentCommentPrivate } ${FooterActions.fragments.comment.private} ${DropdownActions.fragments.comment.private} - ${Content.fragments.comment.private} + ${ArticleCommentContent.fragments.comment.private} `, }, } -export const REFETCH_COMMENT = gql` - query RefetchCommentBeta($id: ID!) { +export const REFETCH_ARTICLE_COMMENT = gql` + query RefetchArticleComment($id: ID!) { node(input: { id: $id }) { ... on Comment { id - ...FeedCommentBetaPublic - ...FeedCommentBetaPrivate + ...ArticleFeedCommentPublic + ...ArticleFeedCommentPrivate comments(input: { sort: oldest, first: null }) { edges { cursor node { - ...FeedCommentBetaPublic - ...FeedCommentBetaPrivate + ...ArticleFeedCommentPublic + ...ArticleFeedCommentPrivate } } } diff --git a/src/components/CommentBeta/Feed/index.tsx b/src/components/ArticleComment/Feed/index.tsx similarity index 85% rename from src/components/CommentBeta/Feed/index.tsx rename to src/components/ArticleComment/Feed/index.tsx index 781ca5292c..4c0833f33f 100644 --- a/src/components/CommentBeta/Feed/index.tsx +++ b/src/components/ArticleComment/Feed/index.tsx @@ -4,19 +4,18 @@ import React from 'react' import { COMMENT_FEED_ID_PREFIX, TEST_ID } from '~/common/enums' import { toPath } from '~/common/utils' import { + ArticleThreadCommentType, Avatar, AvatarSize, - CommentFormType, DateTime, LinkWrapper, - ThreadCommentType, } from '~/components' import { - FeedCommentBetaPrivateFragment, - FeedCommentBetaPublicFragment, + ArticleFeedCommentPrivateFragment, + ArticleFeedCommentPublicFragment, } from '~/gql/graphql' -import Content from '../Content' +import { ArticleCommentContent } from '../Content' import DropdownActions, { DropdownActionsControls } from '../DropdownActions' import FooterActions, { FooterActionsControls } from '../FooterActions' import PinnedLabel from '../PinnedLabel' @@ -31,16 +30,14 @@ export type CommentControls = { DropdownActionsControls export type CommentProps = { - comment: FeedCommentBetaPublicFragment & - Partial - pinnedComment?: ThreadCommentType - type: CommentFormType + comment: ArticleFeedCommentPublicFragment & + Partial + pinnedComment?: ArticleThreadCommentType } & CommentControls -export const BaseCommentFeed = ({ +const BaseCommentFeed = ({ comment, pinnedComment, - type, avatarSize = 32, hasUserName, replySubmitCallback, @@ -105,7 +102,6 @@ export const BaseCommentFeed = ({ @@ -113,11 +109,10 @@ export const BaseCommentFeed = ({
- + @@ -129,11 +124,13 @@ export const BaseCommentFeed = ({ /** * Memoizing */ -type MemoizedCommentFeed = React.MemoExoticComponent> & { +type MemoizedArticleCommentFeed = React.MemoExoticComponent< + React.FC +> & { fragments: typeof fragments } -const CommentFeed = React.memo( +export const ArticleCommentFeed = React.memo( BaseCommentFeed, ( { @@ -154,8 +151,6 @@ const CommentFeed = React.memo( prevPinnedComment?.id === pinnedComment?.id ) } -) as MemoizedCommentFeed +) as MemoizedArticleCommentFeed -CommentFeed.fragments = fragments - -export default CommentFeed +ArticleCommentFeed.fragments = fragments diff --git a/src/components/CommentBeta/Feed/styles.module.css b/src/components/ArticleComment/Feed/styles.module.css similarity index 100% rename from src/components/CommentBeta/Feed/styles.module.css rename to src/components/ArticleComment/Feed/styles.module.css diff --git a/src/components/CommentBeta/FooterActions/FooterActions.test.tsx b/src/components/ArticleComment/FooterActions/FooterActions.test.tsx similarity index 69% rename from src/components/CommentBeta/FooterActions/FooterActions.test.tsx rename to src/components/ArticleComment/FooterActions/FooterActions.test.tsx index 677bb39832..5169e305f2 100644 --- a/src/components/CommentBeta/FooterActions/FooterActions.test.tsx +++ b/src/components/ArticleComment/FooterActions/FooterActions.test.tsx @@ -5,11 +5,9 @@ import { MOCK_COMMENT } from '~/stories/mocks' import FooterActions from './' -describe('', () => { - it('should render a Comment/FooterActions', () => { - render( - - ) +describe('', () => { + it('should render a ArticleComment/FooterActions', () => { + render() // reply const $reply = screen.getAllByRole('button', { name: 'Write a comment' }) expect($reply).toHaveLength(2) @@ -21,15 +19,8 @@ describe('', () => { expect($upvote).toBeInTheDocument() }) - it('should render a Comment/FooterActions without reply', () => { - render( - - ) + it('should render a ArticleComment/FooterActions without reply', () => { + render() // reply const $reply = screen.queryByRole('button', { name: 'Write a comment' }) @@ -42,7 +33,6 @@ describe('', () => { comment={MOCK_COMMENT} hasReply={false} hasUpvote={false} - type="article" /> ) diff --git a/src/components/CommentBeta/FooterActions/ReplyButton/ReplyButton.test.tsx b/src/components/ArticleComment/FooterActions/ReplyButton/ReplyButton.test.tsx similarity index 55% rename from src/components/CommentBeta/FooterActions/ReplyButton/ReplyButton.test.tsx rename to src/components/ArticleComment/FooterActions/ReplyButton/ReplyButton.test.tsx index 7ebfeac16d..ed888f2471 100644 --- a/src/components/CommentBeta/FooterActions/ReplyButton/ReplyButton.test.tsx +++ b/src/components/ArticleComment/FooterActions/ReplyButton/ReplyButton.test.tsx @@ -5,18 +5,11 @@ import { MOCK_COMMENT } from '~/stories/mocks' import ReplyButton from './' -describe('', () => { - it('should render a Comment/FooterActions/ReplyButton with custom onClick', () => { +describe('', () => { + it('should render a ArticleComment/FooterActions/ReplyButton with custom onClick', () => { const onClick = vi.fn() - render( - - ) + render() const $button = screen.getByRole('button', { name: 'Write a comment' }) expect($button).toBeInTheDocument() @@ -25,17 +18,11 @@ describe('', () => { expect(onClick).toHaveBeenCalled() }) - it('should render a disabled Comment/FooterActions/ReplyButton ', () => { + it('should render a disabled ArticleComment/FooterActions/ReplyButton ', () => { const onClick = vi.fn() render( - + ) const $button = screen.getByRole('button', { name: 'Write a comment' }) diff --git a/src/components/CommentBeta/FooterActions/ReplyButton/index.tsx b/src/components/ArticleComment/FooterActions/ReplyButton/index.tsx similarity index 81% rename from src/components/CommentBeta/FooterActions/ReplyButton/index.tsx rename to src/components/ArticleComment/FooterActions/ReplyButton/index.tsx index 26b856553b..f860f5a48d 100644 --- a/src/components/CommentBeta/FooterActions/ReplyButton/index.tsx +++ b/src/components/ArticleComment/FooterActions/ReplyButton/index.tsx @@ -7,20 +7,13 @@ import { OPEN_UNIVERSAL_AUTH_DIALOG, UNIVERSAL_AUTH_TRIGGER, } from '~/common/enums' -import { - Button, - ButtonProps, - CommentFormType, - Icon, - ViewerContext, -} from '~/components' -import { ReplyComemntFragment } from '~/gql/graphql' +import { Button, ButtonProps, Icon, ViewerContext } from '~/components' +import { ArticleCommentReplyComemntFragment } from '~/gql/graphql' import ReplyTo from '../../ReplyTo' export interface ReplyButtonProps { - comment: ReplyComemntFragment - type: CommentFormType + comment: ArticleCommentReplyComemntFragment replySubmitCallback?: () => void onClick?: () => void disabled?: boolean @@ -29,7 +22,7 @@ export interface ReplyButtonProps { const fragments = { comment: gql` - fragment ReplyComemnt on Comment { + fragment ArticleCommentReplyComemnt on Comment { id state author { @@ -37,12 +30,6 @@ const fragments = { ...ReplyToUser } node { - ... on Circle { - id - owner { - id - } - } ... on Article { id author { @@ -80,14 +67,7 @@ const CommentButton: React.FC = ({ ) } -const ReplyButton = ({ - comment, - type, - replySubmitCallback, - onClick, - disabled, - inCard, -}: ReplyButtonProps) => { +const ReplyButton = ({ onClick, disabled, inCard }: ReplyButtonProps) => { const viewer = useContext(ViewerContext) if (!viewer.isAuthed) { diff --git a/src/components/CommentBeta/FooterActions/UpvoteButton/UpvoteButton.test.tsx b/src/components/ArticleComment/FooterActions/UpvoteButton/UpvoteButton.test.tsx similarity index 76% rename from src/components/CommentBeta/FooterActions/UpvoteButton/UpvoteButton.test.tsx rename to src/components/ArticleComment/FooterActions/UpvoteButton/UpvoteButton.test.tsx index 1df2fa7c8e..43c5f0a9e3 100644 --- a/src/components/CommentBeta/FooterActions/UpvoteButton/UpvoteButton.test.tsx +++ b/src/components/ArticleComment/FooterActions/UpvoteButton/UpvoteButton.test.tsx @@ -5,8 +5,8 @@ import { MOCK_COMMENT } from '~/stories/mocks' import UpvoteButton from './' -describe('', () => { - it('should render a Comment/FooterActions/UpvoteButton', () => { +describe('', () => { + it('should render a ArticleComment/FooterActions/UpvoteButton', () => { render() const $button = screen.getByRole('button', { name: 'Upvote' }) @@ -16,7 +16,7 @@ describe('', () => { expect(screen.getByText(MOCK_COMMENT.upvotes)).toBeInTheDocument() }) - it('should render a Comment/FooterActions/UpvoteButton with custom onClick', () => { + it('should render a ArticleComment/FooterActions/UpvoteButton with custom onClick', () => { const onClick = vi.fn() render() @@ -28,7 +28,7 @@ describe('', () => { expect(onClick).toHaveBeenCalled() }) - it('should render a disabled Comment/FooterActions/UpvoteButton ', () => { + it('should render a disabled ArticleComment/FooterActions/UpvoteButton ', () => { const onClick = vi.fn() render( diff --git a/src/components/CommentBeta/FooterActions/UpvoteButton/index.tsx b/src/components/ArticleComment/FooterActions/UpvoteButton/index.tsx similarity index 90% rename from src/components/CommentBeta/FooterActions/UpvoteButton/index.tsx rename to src/components/ArticleComment/FooterActions/UpvoteButton/index.tsx index 827f0b12cb..99f6abcb1e 100644 --- a/src/components/CommentBeta/FooterActions/UpvoteButton/index.tsx +++ b/src/components/ArticleComment/FooterActions/UpvoteButton/index.tsx @@ -12,17 +12,17 @@ import { VOTE_COMMENT, } from '~/components/GQL/mutations/voteComment' import { + ArticleCommentUpvoteCommentPrivateFragment, + ArticleCommentUpvoteCommentPublicFragment, UnvoteCommentMutation, - UpvoteCommentBetaPrivateFragment, - UpvoteCommentBetaPublicFragment, VoteCommentMutation, } from '~/gql/graphql' import styles from './styles.module.css' interface UpvoteButtonProps { - comment: UpvoteCommentBetaPublicFragment & - Partial + comment: ArticleCommentUpvoteCommentPublicFragment & + Partial onClick?: () => void disabled?: boolean inCard: boolean @@ -31,13 +31,13 @@ interface UpvoteButtonProps { const fragments = { comment: { public: gql` - fragment UpvoteCommentBetaPublic on Comment { + fragment ArticleCommentUpvoteCommentPublic on Comment { id upvotes } `, private: gql` - fragment UpvoteCommentBetaPrivate on Comment { + fragment ArticleCommentUpvoteCommentPrivate on Comment { id myVote } diff --git a/src/components/CommentBeta/FooterActions/UpvoteButton/styles.module.css b/src/components/ArticleComment/FooterActions/UpvoteButton/styles.module.css similarity index 100% rename from src/components/CommentBeta/FooterActions/UpvoteButton/styles.module.css rename to src/components/ArticleComment/FooterActions/UpvoteButton/styles.module.css diff --git a/src/components/CommentBeta/FooterActions/index.tsx b/src/components/ArticleComment/FooterActions/index.tsx similarity index 85% rename from src/components/CommentBeta/FooterActions/index.tsx rename to src/components/ArticleComment/FooterActions/index.tsx index b9d75da199..2104c97545 100644 --- a/src/components/CommentBeta/FooterActions/index.tsx +++ b/src/components/ArticleComment/FooterActions/index.tsx @@ -11,9 +11,8 @@ import { } from '~/common/enums' import { makeMentionElement } from '~/common/utils' import { - CommentFormBeta, - CommentFormBetaDialog, - CommentFormType, + ArticleCommentForm, + ArticleCommentFormDialog, Media, Spacer, toast, @@ -21,8 +20,8 @@ import { ViewerContext, } from '~/components' import { - FooterActionsCommentBetaPrivateFragment, - FooterActionsCommentBetaPublicFragment, + ArticleCommentFooterActionsCommentPrivateFragment, + ArticleCommentFooterActionsCommentPublicFragment, } from '~/gql/graphql' import ReplyButton, { ReplyButtonProps } from './ReplyButton' @@ -38,35 +37,26 @@ export type FooterActionsControls = { } & Pick export type FooterActionsProps = { - comment: FooterActionsCommentBetaPublicFragment & - Partial - type: CommentFormType + comment: ArticleCommentFooterActionsCommentPublicFragment & + Partial } & FooterActionsControls const fragments = { comment: { public: gql` - fragment FooterActionsCommentBetaPublic on Comment { + fragment ArticleCommentFooterActionsCommentPublic on Comment { id state - ...ReplyComemnt - ...UpvoteCommentBetaPublic + ...ArticleCommentReplyComemnt + ...ArticleCommentUpvoteCommentPublic } ${ReplyButton.fragments.comment} ${UpvoteButton.fragments.comment.public} `, private: gql` - fragment FooterActionsCommentBetaPrivate on Comment { + fragment ArticleCommentFooterActionsCommentPrivate on Comment { id node { - ... on Circle { - id - name - owner { - id - isBlocking - } - } ... on Article { id author { @@ -75,7 +65,7 @@ const fragments = { } } } - ...UpvoteCommentBetaPrivate + ...ArticleCommentUpvoteCommentPrivate } ${UpvoteButton.fragments.comment.private} `, @@ -84,7 +74,6 @@ const fragments = { const BaseFooterActions = ({ comment, - type, hasReply, hasUpvote = true, inCard = false, @@ -104,8 +93,7 @@ const BaseFooterActions = ({ const { state, node } = comment const article = node.__typename === 'Article' ? node : undefined - const circle = node.__typename === 'Circle' ? node : undefined - const targetAuthor = article?.author || circle?.owner + const targetAuthor = article?.author const isActive = state === 'active' const isCollapsed = state === 'collapsed' @@ -201,9 +189,8 @@ const BaseFooterActions = ({ {hasReply && ( <> - {({ openDialog }) => ( )} - + - ', () => { - it('should render a Comment/PinnedLabel', () => { +describe('', () => { + it('should render a ArticleComment/PinnedLabel', () => { // not pinned render() expect( diff --git a/src/components/CommentBeta/PinnedLabel/index.tsx b/src/components/ArticleComment/PinnedLabel/index.tsx similarity index 73% rename from src/components/CommentBeta/PinnedLabel/index.tsx rename to src/components/ArticleComment/PinnedLabel/index.tsx index 3d6a9a4c0c..d10042f849 100644 --- a/src/components/CommentBeta/PinnedLabel/index.tsx +++ b/src/components/ArticleComment/PinnedLabel/index.tsx @@ -3,11 +3,11 @@ import gql from 'graphql-tag' import { ReactComponent as IconPin } from '@/public/static/icons/24px/pin.svg' import { TEST_ID } from '~/common/enums' import { Icon } from '~/components' -import { PinnedLabelBetaCommentFragment } from '~/gql/graphql' +import { PinnedLabelCommentFragment } from '~/gql/graphql' const fragments = { comment: gql` - fragment PinnedLabelBetaComment on Comment { + fragment PinnedLabelComment on Comment { id pinned node { @@ -19,11 +19,7 @@ const fragments = { `, } -const PinnedLabel = ({ - comment, -}: { - comment: PinnedLabelBetaCommentFragment -}) => { +const PinnedLabel = ({ comment }: { comment: PinnedLabelCommentFragment }) => { if (!comment.pinned) { return null } diff --git a/src/components/CommentBeta/Placeholder/index.tsx b/src/components/ArticleComment/Placeholder/index.tsx similarity index 100% rename from src/components/CommentBeta/Placeholder/index.tsx rename to src/components/ArticleComment/Placeholder/index.tsx diff --git a/src/components/CommentBeta/Placeholder/styles.module.css b/src/components/ArticleComment/Placeholder/styles.module.css similarity index 89% rename from src/components/CommentBeta/Placeholder/styles.module.css rename to src/components/ArticleComment/Placeholder/styles.module.css index 78644d52d2..7dfb7fb352 100644 --- a/src/components/CommentBeta/Placeholder/styles.module.css +++ b/src/components/ArticleComment/Placeholder/styles.module.css @@ -12,7 +12,7 @@ margin-top: var(--sp12); & p { - width: 22.5rem; + width: 100%; height: 0.875rem; background-color: var(--color-grey-lighter); } @@ -22,7 +22,7 @@ } & p:last-child { - width: 11.25rem; + width: 50%; } } } diff --git a/src/components/Comment/ReplyTo/index.tsx b/src/components/ArticleComment/ReplyTo/index.tsx similarity index 100% rename from src/components/Comment/ReplyTo/index.tsx rename to src/components/ArticleComment/ReplyTo/index.tsx diff --git a/src/components/Comment/ReplyTo/styles.module.css b/src/components/ArticleComment/ReplyTo/styles.module.css similarity index 100% rename from src/components/Comment/ReplyTo/styles.module.css rename to src/components/ArticleComment/ReplyTo/styles.module.css diff --git a/src/components/CommentBeta/RoleLabel/RoleLabel.test.tsx b/src/components/ArticleComment/RoleLabel/RoleLabel.test.tsx similarity index 90% rename from src/components/CommentBeta/RoleLabel/RoleLabel.test.tsx rename to src/components/ArticleComment/RoleLabel/RoleLabel.test.tsx index a9f5de0ab8..5c53bc4cc0 100644 --- a/src/components/CommentBeta/RoleLabel/RoleLabel.test.tsx +++ b/src/components/ArticleComment/RoleLabel/RoleLabel.test.tsx @@ -5,8 +5,8 @@ import { MOCK_COMMENT } from '~/stories/mocks' import DonatorLabel from './' -describe('', () => { - it('should render a Comment/DonatorLabel', () => { +describe('', () => { + it('should render a ArticleComment/DonatorLabel', () => { // from article author render( { ) @@ -45,8 +45,8 @@ const RoleLabel = ({ comment }: { comment: RoleLabelCommentFragment }) => { ) diff --git a/src/components/CommentBeta/ThreadCommentBeta/DescendantComments/index.tsx b/src/components/ArticleComment/ThreadComment/DescendantComments/index.tsx similarity index 91% rename from src/components/CommentBeta/ThreadCommentBeta/DescendantComments/index.tsx rename to src/components/ArticleComment/ThreadComment/DescendantComments/index.tsx index 8087dd11a5..22d90ad1c7 100644 --- a/src/components/CommentBeta/ThreadCommentBeta/DescendantComments/index.tsx +++ b/src/components/ArticleComment/ThreadComment/DescendantComments/index.tsx @@ -13,16 +13,16 @@ import { DescendantCommentsCommentPublicQuery, } from '~/gql/graphql' -import Feed from '../../Feed' +import { ArticleCommentFeed } from '../../Feed' import Placeholder from '../../Placeholder' +import { + ArticleThreadCommentType as ArticleThreadCommentComment, + ArticleThreadCommentType, +} from '..' import { DESCENDANT_COMMENTS_COMMENT_PRIVATE, DESCENDANT_COMMENTS_COMMENT_PUBLIC, } from '../gql' -import { - ThreadCommentType as ThreadCommentCommentBeta, - ThreadCommentType, -} from '../index' type DescendantCommentPublic = NonNullable< NonNullable< @@ -47,11 +47,11 @@ type Props = { replySubmitCallback?: () => void endCurosr: string isInCommentDetail?: boolean - comments?: ThreadCommentCommentBeta[] - pinnedComment?: ThreadCommentType + comments?: ArticleThreadCommentComment[] + pinnedComment?: ArticleThreadCommentType } -export const DescendantComments = ({ +export const ArticleDescendantComments = ({ id, comments, pinnedComment, @@ -140,7 +140,7 @@ export const DescendantComments = ({ ...(comments || []), ...(filterComments( (edges || []).map(({ node }) => node) - ) as ThreadCommentCommentBeta[]), + ) as ArticleThreadCommentComment[]), ], (comment) => comment.id ) @@ -157,10 +157,9 @@ export const DescendantComments = ({ <> {result.map((node) => (
  • - +export type ArticleThreadCommentType = + ArticleThreadCommentCommentPublicFragment & + Partial type ThreadCommentProps = { - comment: ThreadCommentType - pinnedComment?: ThreadCommentType -} & ThreadCommentControls + comment: ArticleThreadCommentType + pinnedComment?: ArticleThreadCommentType +} & ArticleThreadCommentControls -export const ThreadCommentBeta = ({ +export const ArticleThreadComment = ({ comment, pinnedComment, - type, defaultExpand, firstRenderCallback, isInCommentDetail, @@ -47,7 +46,7 @@ export const ThreadCommentBeta = ({ const { pageInfo } = comment.comments const descendants = filterComments( (comment.comments?.edges || []).map(({ node }) => node) - ) as ThreadCommentType[] + ) as ArticleThreadCommentType[] const [showViewMore, setShowViewMore] = useState(true) useEffect(() => { @@ -59,11 +58,10 @@ export const ThreadCommentBeta = ({ if (!pageInfo.hasNextPage) { return (
    - {descendants.map((descendantComment) => (
  • - - {descendants.slice(0, COLLAPSE_COUNT).map((descendantComment) => (
  • - {subComments.map((descendantComment) => (
  • - )} {!showViewMore && ( - ', () => { - it('should render a Comment.Content', () => { - render() +describe('', () => { + it('should render a CircleComemnt.Content', () => { + render( + + ) const $content = screen.getByText(MOCK_COMMENT.content) expect($content).toBeInTheDocument() }) - it('should render a collapsed Comment.Content', () => { + it('should render a collapsed CircleComemnt.Content', () => { // collapsed by author render( - ) expect( - screen.getByText('This comment has been collapsed by the author') + screen.getByText('This broadcast has been collapsed by the author') ).toBeInTheDocument() // blocked by user render( - ) expect(screen.getByText('You have blocked that user')).toBeInTheDocument() }) - it('should render a banned Comment.Content', () => { + it('should render a banned CircleComemnt.Content', () => { render( - ) expect( screen.getByText( - 'This comment has been archived due to a violation of the user agreement' + 'This broadcast has been archived due to a violation of the user agreement' ) ).toBeInTheDocument() }) - it('should render an archived Comment.Content', () => { + it('should render an archived CircleComemnt.Content', () => { render( - ) expect( - screen.getByText('This comment has been deleted by the author') + screen.getByText('This broadcast has been deleted by the author') ).toBeInTheDocument() }) }) diff --git a/src/components/Comment/Content/index.tsx b/src/components/CircleComment/Content/index.tsx similarity index 84% rename from src/components/Comment/Content/index.tsx rename to src/components/CircleComment/Content/index.tsx index 7c0efe4bba..07981b1db2 100644 --- a/src/components/Comment/Content/index.tsx +++ b/src/components/CircleComment/Content/index.tsx @@ -5,18 +5,23 @@ import { FormattedMessage } from 'react-intl' import { COMMENT_TYPE_TEXT, TEST_ID } from '~/common/enums' import { captureClicks } from '~/common/utils' -import { CommentFormType, Expandable, LanguageContext } from '~/components' import { - ContentCommentPrivateFragment, - ContentCommentPublicFragment, + CircleCommentFormType, + Expandable, + LanguageContext, +} from '~/components' +import { + CircleCommentContentCommentPrivateFragment, + CircleCommentContentCommentPublicFragment, } from '~/gql/graphql' import Collapsed from './Collapsed' import styles from './styles.module.css' interface ContentProps { - comment: ContentCommentPublicFragment & Partial - type: CommentFormType + comment: CircleCommentContentCommentPublicFragment & + Partial + type: CircleCommentFormType size?: 14 | 15 bgColor?: 'greyLighter' | 'white' limit?: number @@ -27,14 +32,14 @@ interface ContentProps { const fragments = { comment: { public: gql` - fragment ContentCommentPublic on Comment { + fragment CircleCommentContentCommentPublic on Comment { id content state } `, private: gql` - fragment ContentCommentPrivate on Comment { + fragment CircleCommentContentCommentPrivate on Comment { id author { id @@ -45,7 +50,7 @@ const fragments = { }, } -const Content = ({ +export const CircleCommentContent = ({ comment, type, size, @@ -139,6 +144,4 @@ const Content = ({ return null } -Content.fragments = fragments - -export default Content +CircleCommentContent.fragments = fragments diff --git a/src/components/Comment/Content/styles.module.css b/src/components/CircleComment/Content/styles.module.css similarity index 100% rename from src/components/Comment/Content/styles.module.css rename to src/components/CircleComment/Content/styles.module.css diff --git a/src/components/Comment/CreatedAt/CreatedAt.test.tsx b/src/components/CircleComment/CreatedAt/CreatedAt.test.tsx similarity index 50% rename from src/components/Comment/CreatedAt/CreatedAt.test.tsx rename to src/components/CircleComment/CreatedAt/CreatedAt.test.tsx index bbaade2802..4847b2b4dd 100644 --- a/src/components/Comment/CreatedAt/CreatedAt.test.tsx +++ b/src/components/CircleComment/CreatedAt/CreatedAt.test.tsx @@ -2,22 +2,22 @@ import mockRouter from 'next-router-mock' import { describe, expect, it } from 'vitest' import { render, screen } from '~/common/utils/test' -import { MOCK_COMMENT } from '~/stories/mocks' +import { MOCK_CIRCLE_COMMENT } from '~/stories/mocks' import CreatedAt from './' describe('', () => { - it('should render a Comment/CreatedAt', () => { - render() + it('should render a CircleComment/CreatedAt', () => { + render() const $time = screen.getByRole('link') expect($time).toBeInTheDocument() $time.click() - expect(mockRouter.asPath).toContain(MOCK_COMMENT.id) + expect(mockRouter.asPath).toContain(MOCK_CIRCLE_COMMENT.id) }) - it('should render a Comment/CreatedAt without link', () => { - render() + it('should render a CircleComment/CreatedAt without link', () => { + render() expect(screen.queryByRole('link')).not.toBeInTheDocument() }) }) diff --git a/src/components/Comment/CreatedAt/index.tsx b/src/components/CircleComment/CreatedAt/index.tsx similarity index 80% rename from src/components/Comment/CreatedAt/index.tsx rename to src/components/CircleComment/CreatedAt/index.tsx index e8c47b8f63..82bbf4b365 100644 --- a/src/components/Comment/CreatedAt/index.tsx +++ b/src/components/CircleComment/CreatedAt/index.tsx @@ -21,14 +21,6 @@ const fragments = { id } node { - ... on Article { - id - slug - shortHash - author { - userName - } - } ... on Circle { id name @@ -40,17 +32,15 @@ const fragments = { } const CreatedAt = ({ comment, hasLink }: CreatedAtProps) => { - const article = - comment.node.__typename === 'Article' ? comment.node : undefined const circle = comment.node.__typename === 'Circle' ? comment.node : undefined - if (article || circle) { + if (circle) { const path = toPath({ page: 'commentDetail', comment, - article, circle, }) + return ( diff --git a/src/components/Comment/DropdownActions/CollapseComment/Button.tsx b/src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx similarity index 81% rename from src/components/Comment/DropdownActions/CollapseComment/Button.tsx rename to src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx index fd12adf689..9bb6c87a56 100644 --- a/src/components/Comment/DropdownActions/CollapseComment/Button.tsx +++ b/src/components/CircleComment/DropdownActions/CollapseComment/Button.tsx @@ -9,8 +9,8 @@ const CollapseCommentButton = ({ openDialog }: { openDialog: () => void }) => { text={ } icon={} diff --git a/src/components/Comment/DropdownActions/CollapseComment/Dialog.tsx b/src/components/CircleComment/DropdownActions/CollapseComment/Dialog.tsx similarity index 95% rename from src/components/Comment/DropdownActions/CollapseComment/Dialog.tsx rename to src/components/CircleComment/DropdownActions/CollapseComment/Dialog.tsx index b4ea0814a3..d791831873 100644 --- a/src/components/Comment/DropdownActions/CollapseComment/Dialog.tsx +++ b/src/components/CircleComment/DropdownActions/CollapseComment/Dialog.tsx @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl' import { COMMENT_TYPE_TEXT, TEST_ID } from '~/common/enums' import { - CommentFormType, + CircleCommentFormType, Dialog, toast, Translate, @@ -11,8 +11,8 @@ import { useMutation, } from '~/components' import { + CircleCommentDropdownActionsCommentPublicFragment, CollapseCommentMutation, - DropdownActionsCommentPublicFragment, } from '~/gql/graphql' const COLLAPSE_COMMENT = gql` @@ -25,8 +25,8 @@ const COLLAPSE_COMMENT = gql` ` export interface CollapseCommentDialogProps { - comment: DropdownActionsCommentPublicFragment - type: CommentFormType + comment: CircleCommentDropdownActionsCommentPublicFragment + type: CircleCommentFormType children: ({ openDialog }: { openDialog: () => void }) => React.ReactNode } diff --git a/src/components/Comment/DropdownActions/CollapseComment/index.tsx b/src/components/CircleComment/DropdownActions/CollapseComment/index.tsx similarity index 100% rename from src/components/Comment/DropdownActions/CollapseComment/index.tsx rename to src/components/CircleComment/DropdownActions/CollapseComment/index.tsx diff --git a/src/components/Comment/DropdownActions/DeleteComment/Button.tsx b/src/components/CircleComment/DropdownActions/DeleteComment/Button.tsx similarity index 100% rename from src/components/Comment/DropdownActions/DeleteComment/Button.tsx rename to src/components/CircleComment/DropdownActions/DeleteComment/Button.tsx diff --git a/src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx b/src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx similarity index 86% rename from src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx rename to src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx index 02f62b1f57..8c2192358c 100644 --- a/src/components/Comment/DropdownActions/DeleteComment/Dialog.tsx +++ b/src/components/CircleComment/DropdownActions/DeleteComment/Dialog.tsx @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl' import { COMMENT_TYPE_TEXT, TEST_ID } from '~/common/enums' import { - CommentFormType, + CircleCommentFormType, Dialog, LanguageContext, toast, @@ -12,8 +12,8 @@ import { useMutation, } from '~/components' import { + CircleCommentDropdownActionsCommentPublicFragment, DeleteCommentMutation, - DropdownActionsCommentPublicFragment, } from '~/gql/graphql' const DELETE_COMMENT = gql` @@ -26,8 +26,8 @@ const DELETE_COMMENT = gql` ` export interface DeleteCommentDialogProps { - comment: DropdownActionsCommentPublicFragment - type: CommentFormType + comment: CircleCommentDropdownActionsCommentPublicFragment + type: CircleCommentFormType children: ({ openDialog }: { openDialog: () => void }) => React.ReactNode } @@ -59,8 +59,8 @@ const DeleteCommentDialog = ({ message: ( ', () => { +describe('', () => { it('should not render dropdown actions if comment is archived', async () => { render( ) const $button = screen.queryByLabelText('More Actions') @@ -23,8 +23,12 @@ describe('', () => { it('should render pin buttons', async () => { render( ) @@ -33,15 +37,15 @@ describe('', () => { const $button = screen.getByLabelText('More Actions') expect($button).toBeInTheDocument() $button.click() - const $pinButton = screen.getByRole('menuitem', { name: 'Pin Comment' }) + const $pinButton = screen.getByRole('menuitem', { name: 'Pin Broadcast' }) expect($pinButton).toBeInTheDocument() // unpin button cleanup() render( ) @@ -50,30 +54,32 @@ describe('', () => { const $button2 = screen.getByLabelText('More Actions') expect($button2).toBeInTheDocument() $button2.click() - const $unpinButton = screen.getByRole('menuitem', { name: 'Unpin Comment' }) + const $unpinButton = screen.getByRole('menuitem', { + name: 'Unpin Broadcast', + }) expect($unpinButton).toBeInTheDocument() }) - it('should not render pin buttons if viewer is not article author', async () => { + it('should not render pin buttons if viewer is not circle author', async () => { render( ) const $button = screen.getByLabelText('More Actions') expect($button).toBeInTheDocument() $button.click() - const $pinButton = screen.queryByRole('menuitem', { name: 'Pin Comment' }) + const $pinButton = screen.queryByRole('menuitem', { name: 'Pin Broadcast' }) expect($pinButton).not.toBeInTheDocument() }) @@ -81,8 +87,8 @@ describe('', () => { it('should render edit button', async () => { render( ) @@ -98,11 +104,11 @@ describe('', () => { render( ) const $button = screen.getByLabelText('More Actions') @@ -117,8 +123,8 @@ describe('', () => { it('should render delete button', async () => { render( ) @@ -140,10 +146,10 @@ describe('', () => { render( ) @@ -163,14 +169,14 @@ describe('', () => { }) // hasCollapse - it('should render collapse button if viewer is article author but not comment author', async () => { + it('should render collapse button if viewer is circle author but not comment author', async () => { render( ) @@ -190,15 +196,15 @@ describe('', () => { }) // hasUncollapse - it('should render uncollapse button if viewer is article author but not comment author', async () => { + it('should render uncollapse button if viewer is circle author but not comment author', async () => { render( ) diff --git a/src/components/Comment/DropdownActions/EditButton.tsx b/src/components/CircleComment/DropdownActions/EditButton.tsx similarity index 84% rename from src/components/Comment/DropdownActions/EditButton.tsx rename to src/components/CircleComment/DropdownActions/EditButton.tsx index 8ac869ce6d..ad19bf1eac 100644 --- a/src/components/Comment/DropdownActions/EditButton.tsx +++ b/src/components/CircleComment/DropdownActions/EditButton.tsx @@ -13,8 +13,8 @@ const EditButton = ({ openEditCommentDialog }: EditButtonProps) => { text={ } icon={} diff --git a/src/components/Comment/DropdownActions/PinButton.tsx b/src/components/CircleComment/DropdownActions/PinButton.tsx similarity index 61% rename from src/components/Comment/DropdownActions/PinButton.tsx rename to src/components/CircleComment/DropdownActions/PinButton.tsx index 851cdb810e..ac8476cc12 100644 --- a/src/components/Comment/DropdownActions/PinButton.tsx +++ b/src/components/CircleComment/DropdownActions/PinButton.tsx @@ -4,24 +4,20 @@ import { FormattedMessage } from 'react-intl' import { ReactComponent as IconPin } from '@/public/static/icons/24px/pin.svg' import { ReactComponent as IconUnpin } from '@/public/static/icons/24px/unpin.svg' import { REFETCH_CIRCLE_DETAIL } from '~/common/enums' -import { CommentFormType, Icon, Menu, useMutation } from '~/components' +import { CircleCommentFormType, Icon, Menu, useMutation } from '~/components' import { updateCircleBroadcast } from '~/components/GQL' -import TOGGLE_PIN_COMMENT from '~/components/GQL/mutations/togglePinComment' +import { TOGGLE_CIRCLE_PIN_COMMENT } from '~/components/GQL/mutations/togglePinComment' import { - PinButtonCommentFragment, - TogglePinCommentMutation, + CircleCommentPinButtonCommentFragment, + ToggleCirclePinCommentMutation, } from '~/gql/graphql' const fragments = { comment: gql` - fragment PinButtonComment on Comment { + fragment CircleCommentPinButtonComment on Comment { id pinned node { - ... on Article { - id - pinCommentLeft - } ... on Circle { id name @@ -35,17 +31,15 @@ const PinButton = ({ type, comment, }: { - type: CommentFormType - comment: PinButtonCommentFragment + type: CircleCommentFormType + comment: CircleCommentPinButtonCommentFragment }) => { - const article = - comment.node.__typename === 'Article' ? comment.node : undefined const circle = comment.node.__typename === 'Circle' ? comment.node : undefined - const canPin = !!circle || (article?.pinCommentLeft || 0) > 0 + const canPin = !!circle const isCircleBroadcast = type === 'circleBroadcast' - const [unpinComment] = useMutation( - TOGGLE_PIN_COMMENT, + const [unpinComment] = useMutation( + TOGGLE_CIRCLE_PIN_COMMENT, { variables: { id: comment.id, enabled: false }, optimisticResponse: { @@ -70,8 +64,8 @@ const PinButton = ({ }, } ) - const [pinComment] = useMutation( - TOGGLE_PIN_COMMENT, + const [pinComment] = useMutation( + TOGGLE_CIRCLE_PIN_COMMENT, { variables: { id: comment.id, enabled: true }, optimisticResponse: { @@ -101,19 +95,11 @@ const PinButton = ({ return ( - ) : ( - - ) + } icon={} onClick={async () => { @@ -127,19 +113,11 @@ const PinButton = ({ return ( - ) : ( - - ) + } icon={} onClick={ diff --git a/src/components/Comment/DropdownActions/UncollapseButton.tsx b/src/components/CircleComment/DropdownActions/UncollapseButton.tsx similarity index 91% rename from src/components/Comment/DropdownActions/UncollapseButton.tsx rename to src/components/CircleComment/DropdownActions/UncollapseButton.tsx index 71469c3e0a..6dd9b898c0 100644 --- a/src/components/Comment/DropdownActions/UncollapseButton.tsx +++ b/src/components/CircleComment/DropdownActions/UncollapseButton.tsx @@ -36,8 +36,8 @@ const UncollapseButton = ({ commentId }: { commentId: string }) => { text={ } icon={} diff --git a/src/components/Comment/DropdownActions/index.tsx b/src/components/CircleComment/DropdownActions/index.tsx similarity index 82% rename from src/components/Comment/DropdownActions/index.tsx rename to src/components/CircleComment/DropdownActions/index.tsx index 66d488b2dc..789f67216f 100644 --- a/src/components/Comment/DropdownActions/index.tsx +++ b/src/components/CircleComment/DropdownActions/index.tsx @@ -8,8 +8,8 @@ import { ReactComponent as IconMore } from '@/public/static/icons/24px/more.svg' import { ERROR_CODES, ERROR_MESSAGES } from '~/common/enums' import { Button, - CommentFormDialog, - CommentFormType, + CircleCommentFormDialog, + CircleCommentFormType, Dropdown, Icon, Menu, @@ -19,10 +19,10 @@ import { } from '~/components' import { BlockUser } from '~/components/BlockUser' import { BlockUserDialogProps } from '~/components/BlockUser/Dialog' -import type { CommentFormDialogProps } from '~/components/Dialogs/CommentFormDialog' +import type { CircleCommentFormDialogProps } from '~/components/Dialogs/CircleCommentFormDialog' import { - DropdownActionsCommentPrivateFragment, - DropdownActionsCommentPublicFragment, + CircleCommentDropdownActionsCommentPrivateFragment, + CircleCommentDropdownActionsCommentPublicFragment, } from '~/gql/graphql' import CollapseComment from './CollapseComment' @@ -45,9 +45,9 @@ export type DropdownActionsControls = { } type DropdownActionsProps = { - comment: DropdownActionsCommentPublicFragment & - Partial - type: CommentFormType + comment: CircleCommentDropdownActionsCommentPublicFragment & + Partial + type: CircleCommentFormType } & DropdownActionsControls interface Controls { @@ -71,7 +71,7 @@ type BaseDropdownActionsProps = DropdownActionsProps & Controls & DialogProps const fragments = { comment: { public: gql` - fragment DropdownActionsCommentPublic on Comment { + fragment CircleCommentDropdownActionsCommentPublic on Comment { id state content @@ -90,21 +90,14 @@ const fragments = { id } } - ... on Article { - id - shortHash - author { - id - } - } } - ...PinButtonComment + ...CircleCommentPinButtonComment } ${PinButton.fragments.comment} ${BlockUser.fragments.user.public} `, private: gql` - fragment DropdownActionsCommentPrivate on Comment { + fragment CircleCommentDropdownActionsCommentPrivate on Comment { id author { id @@ -118,13 +111,6 @@ const fragments = { isBlocking } } - ... on Article { - id - author { - id - isBlocking - } - } } } ${BlockUser.fragments.user.private} @@ -198,10 +184,8 @@ const DropdownActions = (props: DropdownActionsProps) => { const viewer = useContext(ViewerContext) const { isArchived, isBanned, isFrozen } = viewer - const article = - comment.node.__typename === 'Article' ? comment.node : undefined const circle = comment.node.__typename === 'Circle' ? comment.node : undefined - const targetAuthor = article?.author || circle?.owner + const targetAuthor = circle?.owner const isTargetAuthor = viewer.id === targetAuthor?.id const isBlocked = targetAuthor?.isBlocking @@ -232,26 +216,21 @@ const DropdownActions = (props: DropdownActionsProps) => { return null } - const WithEditComment = withDialog>( + const WithEditComment = withDialog< + Omit + >( BaseDropdownActions, - CommentFormDialog, + CircleCommentFormDialog, { - articleId: article?.id, - circleId: circle?.id, + circleId: circle?.id!, type, commentId: comment.id, defaultContent: comment.content, - title: article ? ( - - ) : ( + title: ( ), }, diff --git a/src/components/Comment/Feed/Feed.test.tsx b/src/components/CircleComment/Feed/Feed.test.tsx similarity index 73% rename from src/components/Comment/Feed/Feed.test.tsx rename to src/components/CircleComment/Feed/Feed.test.tsx index 0d746c487a..ad9ea27990 100644 --- a/src/components/Comment/Feed/Feed.test.tsx +++ b/src/components/CircleComment/Feed/Feed.test.tsx @@ -2,14 +2,14 @@ import { describe, expect, it } from 'vitest' import { TEST_ID } from '~/common/enums' import { cleanup, render, screen } from '~/common/utils/test' -import { Comment } from '~/components' +import { CircleCommentFeed } from '~/components' import { MOCK_COMMENT } from '~/stories/mocks' -describe('', () => { +describe('', () => { it('should render a Comment.Feed', () => { - render() + render() - const $digest = screen.getByTestId(TEST_ID.ARTICLE_COMMENT_FEED) + const $digest = screen.getByTestId(TEST_ID.CIRCLE_COMMENT_FEED) expect($digest).toBeInTheDocument() // author @@ -23,7 +23,7 @@ describe('', () => { it('should render a Comment.Feed with replyTo', () => { render( - ', () => { }, parentComment: null, }} - type="article" + type="circleBroadcast" /> ) - const $digest = screen.getByTestId(TEST_ID.ARTICLE_COMMENT_FEED) + const $digest = screen.getByTestId(TEST_ID.CIRCLE_COMMENT_FEED) expect($digest).toBeInTheDocument() // replyTo @@ -47,16 +47,16 @@ describe('', () => { it('should render a Comment.Feed without replyTo', () => { // not a replyTo render( - ) - const $digest = screen.getByTestId(TEST_ID.ARTICLE_COMMENT_FEED) + const $digest = screen.getByTestId(TEST_ID.CIRCLE_COMMENT_FEED) expect($digest).toBeInTheDocument() const $replyTo = screen.queryByTestId(TEST_ID.COMMENT_REPLY_TO) expect($replyTo).not.toBeInTheDocument() @@ -64,16 +64,16 @@ describe('', () => { // has parentComment cleanup() render( - ) - const $digest2 = screen.getByTestId(TEST_ID.ARTICLE_COMMENT_FEED) + const $digest2 = screen.getByTestId(TEST_ID.CIRCLE_COMMENT_FEED) expect($digest2).toBeInTheDocument() const $replyTo2 = screen.queryByTestId(TEST_ID.COMMENT_REPLY_TO) expect($replyTo2).not.toBeInTheDocument() diff --git a/src/components/Comment/Feed/gql.ts b/src/components/CircleComment/Feed/gql.ts similarity index 56% rename from src/components/Comment/Feed/gql.ts rename to src/components/CircleComment/Feed/gql.ts index e94acbf1c5..b3a2fda522 100644 --- a/src/components/Comment/Feed/gql.ts +++ b/src/components/CircleComment/Feed/gql.ts @@ -2,17 +2,15 @@ import gql from 'graphql-tag' import { UserDigest } from '~/components/UserDigest' -import Content from '../Content' -import DonatorLabel from '../DonatorLabel' +import { CircleCommentContent } from '../Content' import DropdownActions from '../DropdownActions' import FooterActions from '../FooterActions' -import PinnedLabel from '../PinnedLabel' import ReplyTo from '../ReplyTo' export const fragments = { comment: { public: gql` - fragment FeedCommentPublic on Comment { + fragment CircleCommentFeedCommentPublic on Comment { id author { id @@ -25,47 +23,43 @@ export const fragments = { ...ReplyToUser } } - ...DonatorLabelComment - ...PinnedLabelComment - ...FooterActionsCommentPublic - ...DropdownActionsCommentPublic - ...ContentCommentPublic + ...CircleCommentFooterActionsCommentPublic + ...CircleCommentDropdownActionsCommentPublic + ...CircleCommentContentCommentPublic } ${UserDigest.Mini.fragments.user} ${ReplyTo.fragments.user} - ${DonatorLabel.fragments.comment} - ${PinnedLabel.fragments.comment} ${FooterActions.fragments.comment.public} ${DropdownActions.fragments.comment.public} - ${Content.fragments.comment.public} + ${CircleCommentContent.fragments.comment.public} `, private: gql` - fragment FeedCommentPrivate on Comment { + fragment CircleCommentFeedCommentPrivate on Comment { id - ...FooterActionsCommentPrivate - ...DropdownActionsCommentPrivate - ...ContentCommentPrivate + ...CircleCommentFooterActionsCommentPrivate + ...CircleCommentDropdownActionsCommentPrivate + ...CircleCommentContentCommentPrivate } ${FooterActions.fragments.comment.private} ${DropdownActions.fragments.comment.private} - ${Content.fragments.comment.private} + ${CircleCommentContent.fragments.comment.private} `, }, } -export const REFETCH_COMMENT = gql` - query RefetchComment($id: ID!) { +export const REFETCH_CIRCLE_COMMENT = gql` + query RefetchCircleComment($id: ID!) { node(input: { id: $id }) { ... on Comment { id - ...FeedCommentPublic - ...FeedCommentPrivate + ...CircleCommentFeedCommentPublic + ...CircleCommentFeedCommentPrivate comments(input: { sort: oldest, first: null }) { edges { cursor node { - ...FeedCommentPublic - ...FeedCommentPrivate + ...CircleCommentFeedCommentPublic + ...CircleCommentFeedCommentPrivate } } } diff --git a/src/components/Comment/Feed/index.tsx b/src/components/CircleComment/Feed/index.tsx similarity index 66% rename from src/components/Comment/Feed/index.tsx rename to src/components/CircleComment/Feed/index.tsx index 36826a800a..712c99ed6a 100644 --- a/src/components/Comment/Feed/index.tsx +++ b/src/components/CircleComment/Feed/index.tsx @@ -2,44 +2,51 @@ import { useLazyQuery } from '@apollo/react-hooks' import React from 'react' import { TEST_ID } from '~/common/enums' -import { AvatarSize, CommentFormType, Media, UserDigest } from '~/components' import { - FeedCommentPrivateFragment, - FeedCommentPublicFragment, - RefetchCommentQuery, + AvatarSize, + CircleCommentFormType, + Media, + UserDigest, +} from '~/components' +import { + CircleCommentFeedCommentPrivateFragment, + CircleCommentFeedCommentPublicFragment, + RefetchCircleCommentQuery, } from '~/gql/graphql' -import Content from '../Content' -import DonatorLabel from '../DonatorLabel' +import { CircleCommentContent } from '../Content' import DropdownActions, { DropdownActionsControls } from '../DropdownActions' import FooterActions, { FooterActionsControls } from '../FooterActions' -import PinnedLabel from '../PinnedLabel' import ReplyTo from '../ReplyTo' -import { fragments, REFETCH_COMMENT } from './gql' +import { fragments, REFETCH_CIRCLE_COMMENT } from './gql' import styles from './styles.module.css' -export type CommentControls = { +export type CircleCommentControls = { avatarSize?: AvatarSize hasUserName?: boolean } & FooterActionsControls & DropdownActionsControls -export type CommentProps = { - comment: FeedCommentPublicFragment & Partial - type: CommentFormType -} & CommentControls +export type CircleCommentProps = { + comment: CircleCommentFeedCommentPublicFragment & + Partial + type: CircleCommentFormType +} & CircleCommentControls -export const BaseCommentFeed = ({ +const BaseCommentFeed = ({ comment, type, avatarSize = 32, hasUserName, replySubmitCallback, ...actionControls -}: CommentProps) => { - const [refetchComment] = useLazyQuery(REFETCH_COMMENT, { - fetchPolicy: 'network-only', - }) +}: CircleCommentProps) => { + const [refetchComment] = useLazyQuery( + REFETCH_CIRCLE_COMMENT, + { + fetchPolicy: 'network-only', + } + ) const { id, replyTo, author, parentComment } = comment const nodeId = parentComment ? `${parentComment.id}-${id}` : id @@ -56,7 +63,7 @@ export const BaseCommentFeed = ({
  • @@ -60,6 +63,7 @@ const Template: ComponentStory = () => ( onUploaded={(assetId) => alert({ assetId })} onUploadStart={() => null} onUploadEnd={() => null} + onReset={() => null} fallbackCover={CIRCLE_COVER} cover="https://source.unsplash.com/512x512?circle-cover" /> diff --git a/src/stories/mocks/index.ts b/src/stories/mocks/index.ts index 8ae7118ac5..5e188cd223 100644 --- a/src/stories/mocks/index.ts +++ b/src/stories/mocks/index.ts @@ -225,6 +225,7 @@ export const MOCK_COLLECTON = { export const MOCK_CIRCLE_COMMENT = { ...MOCK_COMMENT, + type: 'circleBroadcast' as any, node: MOCK_CIRCLE, } diff --git a/src/views/ArticleDetail/CommentDrawer/index.tsx b/src/views/ArticleDetail/CommentDrawer/index.tsx index 6d5e15154f..d7c250f558 100644 --- a/src/views/ArticleDetail/CommentDrawer/index.tsx +++ b/src/views/ArticleDetail/CommentDrawer/index.tsx @@ -4,12 +4,7 @@ import { useIntl } from 'react-intl' import { ReactComponent as IconLeft } from '@/public/static/icons/24px/left.svg' import { analytics } from '~/common/utils' -import { - CommentDraftsProvider, - Drawer, - Icon, - useCommentEditorContext, -} from '~/components' +import { Drawer, Icon, useCommentEditorContext } from '~/components' import { Placeholder as CommentsPlaceholder } from '../Comments/Placeholder' @@ -64,48 +59,46 @@ export const CommentDrawer: React.FC = ({ }, [isOpen]) return ( - - - {isCommentList && ( - <> - - - - - - )} - {isCommentDetail && ( - <> - } - /> - } - closeDrawer={onClose} - /> - - - - - )} - - + + {isCommentList && ( + <> + + + + + + )} + {isCommentDetail && ( + <> + } + /> + } + closeDrawer={onClose} + /> + + + + + )} + ) } diff --git a/src/views/ArticleDetail/Comments/CommentDetail/gql.ts b/src/views/ArticleDetail/Comments/CommentDetail/gql.ts index b229fa0ac6..c0496aeb60 100644 --- a/src/views/ArticleDetail/Comments/CommentDetail/gql.ts +++ b/src/views/ArticleDetail/Comments/CommentDetail/gql.ts @@ -1,14 +1,14 @@ import gql from 'graphql-tag' -import CommentFeed from '~/components/CommentBeta/Feed' +import { ArticleCommentFeed } from '~/components/ArticleComment/Feed' export const COMMENT_DETAIL = gql` query CommentDetail($id: ID!) { node(input: { id: $id }) { ... on Comment { id - ...FeedCommentBetaPublic - ...FeedCommentBetaPrivate + ...ArticleFeedCommentPublic + ...ArticleFeedCommentPrivate comments(input: { sort: oldest, first: null }) { pageInfo { startCursor @@ -18,14 +18,14 @@ export const COMMENT_DETAIL = gql` edges { cursor node { - ...FeedCommentBetaPublic - ...FeedCommentBetaPrivate + ...ArticleFeedCommentPublic + ...ArticleFeedCommentPrivate } } } } } } - ${CommentFeed.fragments.comment.public} - ${CommentFeed.fragments.comment.private} + ${ArticleCommentFeed.fragments.comment.public} + ${ArticleCommentFeed.fragments.comment.private} ` diff --git a/src/views/ArticleDetail/Comments/CommentDetail/index.tsx b/src/views/ArticleDetail/Comments/CommentDetail/index.tsx index 3e49b6827b..9a755f8051 100644 --- a/src/views/ArticleDetail/Comments/CommentDetail/index.tsx +++ b/src/views/ArticleDetail/Comments/CommentDetail/index.tsx @@ -3,9 +3,9 @@ import { useEffect, useRef, useState } from 'react' import { COMMENT_FEED_ID_PREFIX } from '~/common/enums' import { parseCommentHash } from '~/common/utils' import { + ArticleThreadComment, + ArticleThreadCommentType, QueryError, - ThreadCommentBeta, - ThreadCommentType, usePublicQuery, } from '~/components' import { CommentDetailQuery } from '~/gql/graphql' @@ -94,13 +94,12 @@ const CommentDetail = () => { return null } - const comment = data.node as ThreadCommentType + const comment = data.node as ArticleThreadCommentType return (
    - setReadyJump(true)} isInCommentDetail diff --git a/src/views/ArticleDetail/Comments/LatestComments/gql.ts b/src/views/ArticleDetail/Comments/LatestComments/gql.ts index 0f5b65c225..1f5a44b768 100644 --- a/src/views/ArticleDetail/Comments/LatestComments/gql.ts +++ b/src/views/ArticleDetail/Comments/LatestComments/gql.ts @@ -1,6 +1,6 @@ import gql from 'graphql-tag' -import { ThreadCommentBeta } from '~/components' +import { ArticleThreadComment } from '~/components' export const LATEST_COMMENTS_PUBLIC = gql` query LatestCommentsPublic( @@ -18,8 +18,8 @@ export const LATEST_COMMENTS_PUBLIC = gql` id pinnedComments { ... on Comment { - ...ThreadCommentCommentBetaPublic - ...ThreadCommentCommentBetaPrivate + ...ArticleThreadCommentCommentPublic + ...ArticleThreadCommentCommentPrivate } } comments( @@ -42,8 +42,8 @@ export const LATEST_COMMENTS_PUBLIC = gql` edges { node { ... on Comment { - ...ThreadCommentCommentBetaPublic - ...ThreadCommentCommentBetaPrivate + ...ArticleThreadCommentCommentPublic + ...ArticleThreadCommentCommentPrivate } } } @@ -51,8 +51,8 @@ export const LATEST_COMMENTS_PUBLIC = gql` } } } - ${ThreadCommentBeta.fragments.comment.public} - ${ThreadCommentBeta.fragments.comment.private} + ${ArticleThreadComment.fragments.comment.public} + ${ArticleThreadComment.fragments.comment.private} ` export const LATEST_COMMENTS_PRIVATE = gql` @@ -60,9 +60,9 @@ export const LATEST_COMMENTS_PRIVATE = gql` nodes(input: { ids: $ids }) { id ... on Comment { - ...ThreadCommentCommentBetaPrivate + ...ArticleThreadCommentCommentPrivate } } } - ${ThreadCommentBeta.fragments.comment.private} + ${ArticleThreadComment.fragments.comment.private} ` diff --git a/src/views/ArticleDetail/Comments/LatestComments/index.tsx b/src/views/ArticleDetail/Comments/LatestComments/index.tsx index d6b0102b8f..e9c835a568 100644 --- a/src/views/ArticleDetail/Comments/LatestComments/index.tsx +++ b/src/views/ArticleDetail/Comments/LatestComments/index.tsx @@ -10,14 +10,14 @@ import { parseCommentHash, } from '~/common/utils' import { - CommentFormBeta, + ArticleCommentForm, + ArticleThreadComment, EmptyComment, InfiniteScroll, List, Media, QueryError, Spacer, - ThreadCommentBeta, usePublicQuery, ViewerContext, } from '~/components' @@ -136,9 +136,8 @@ const LatestComments = ({ id, lock }: { id: string; lock: boolean }) => { return (
    - @@ -167,9 +166,8 @@ const LatestComments = ({ id, lock }: { id: string; lock: boolean }) => { {!!pinnedComment && ( - { !comment.pinned && comment.state !== 'archived' && ( - { return (
    - - + +
    ) } diff --git a/src/views/ArticleDetail/Edit/Header/index.tsx b/src/views/ArticleDetail/Edit/Header/index.tsx index 6ecfda1172..c40ddcdc90 100644 --- a/src/views/ArticleDetail/Edit/Header/index.tsx +++ b/src/views/ArticleDetail/Edit/Header/index.tsx @@ -2,7 +2,7 @@ import _isEqual from 'lodash/isEqual' import { FormattedMessage } from 'react-intl' import { MAX_ARTICLE_CONTENT_LENGTH } from '~/common/enums' -import { stripHtml, toPath } from '~/common/utils' +import { containsFigureTag, stripHtml, toPath } from '~/common/utils' import { Button, TextIcon, toast, useMutation } from '~/components' import { ConfirmStepContentProps, @@ -65,7 +65,9 @@ const EditModeHeader = ({ const hasTitle = revision.title && revision.title.trim().length > 0 const hasContent = - revision.content && stripHtml(revision.content).trim().length > 0 + revision.content && + (stripHtml(revision.content).trim().length > 0 || + containsFigureTag(revision.content)) const isTitleRevised = revision.title !== article.title const isSummaryRevised = revision.summary !== article.summary diff --git a/src/views/ArticleDetail/Edit/index.tsx b/src/views/ArticleDetail/Edit/index.tsx index c518223e23..8ba7eed01b 100644 --- a/src/views/ArticleDetail/Edit/index.tsx +++ b/src/views/ArticleDetail/Edit/index.tsx @@ -1,6 +1,5 @@ import { useQuery } from '@apollo/react-hooks' import _omit from 'lodash/omit' -import _uniq from 'lodash/uniq' import dynamic from 'next/dynamic' import { useContext, useState } from 'react' @@ -43,6 +42,7 @@ import { ArticleDigestDropdownArticleFragment, ArticleLicenseType, AssetFragment, + AssetType, DigestRichCirclePublicFragment, DigestTagFragment, DirectImageUploadDoneMutation, @@ -79,7 +79,7 @@ const BaseEdit = ({ article }: { article: Article }) => { const [content, setContent] = useState(article.contents.html) // cover - const assets = article.assets || [] + const [assets, setAssets] = useState(article.assets || []) const [cover, setCover] = useState( assets.find((asset) => asset.path === article.cover) ) @@ -222,7 +222,7 @@ const BaseEdit = ({ article }: { article: Article }) => { const { upload: uploadImage } = useDirectImageUpload() const upload = async (input: { - [key: string]: any + [key: string]: string | File }): Promise<{ id: string; path: string }> => { const isImage = input.type !== ASSET_TYPE.embedaudio @@ -246,7 +246,7 @@ const BaseEdit = ({ article }: { article: Article }) => { uploadURL, } = result?.data?.directImageUpload || {} - if (assetId && path && uploadURL) { + if (assetId && path && uploadURL && input.file instanceof File) { try { await uploadImage({ uploadURL, file: input.file }) } catch (error) { @@ -263,6 +263,11 @@ const BaseEdit = ({ article }: { article: Article }) => { }, }).catch(console.error) + setAssets((assets) => [ + ...assets, + { id: assetId, path, type: AssetType.Embed }, + ]) + return { id: assetId, path } } else { throw new Error('upload not successful') diff --git a/src/views/ArticleDetail/Support/SupportAuthor/index.tsx b/src/views/ArticleDetail/Support/SupportAuthor/index.tsx index d453d1b2ec..9a00a5cdef 100644 --- a/src/views/ArticleDetail/Support/SupportAuthor/index.tsx +++ b/src/views/ArticleDetail/Support/SupportAuthor/index.tsx @@ -6,8 +6,9 @@ import { CLOSE_SET_PAYMENT_PASSWORD_DIALOG, OPEN_SET_PAYMENT_PASSWORD_DIALOG, PAYMENT_CURRENCY as CURRENCY, + SUPPORT_TAB_PREFERENCE_KEY, } from '~/common/enums' -import { featureSupportedChains } from '~/common/utils' +import { featureSupportedChains, storage } from '~/common/utils' import { AuthWalletFeed, SetPaymentPasswordDialog, @@ -76,6 +77,7 @@ const SupportAuthor = (props: SupportAuthorProps) => { const { currStep, forward: _forward } = useStep('setAmount') const hasAuthorAddress = recipient.info.ethAddress const hasAuthorLikeID = !!recipient.liker.likerId + const supportCurrency = storage.get(SUPPORT_TAB_PREFERENCE_KEY) const { address } = useAccount() // TODO: support multiple networks @@ -88,7 +90,9 @@ const SupportAuthor = (props: SupportAuthorProps) => { } const [amount, setAmount] = useState(0) - const [currency, setCurrency] = useState(CURRENCY.HKD) + const [currency, setCurrency] = useState( + supportCurrency || CURRENCY.HKD + ) const switchCurrency = async (currency: CURRENCY) => { setAmount(0) @@ -238,6 +242,7 @@ const SupportAuthor = (props: SupportAuthorProps) => { forward('confirm') }} nextStep={() => { + storage.set(SUPPORT_TAB_PREFERENCE_KEY, currency) forward('complete') }} txId={payToTx?.id || ''} diff --git a/src/views/ArticleDetail/Support/SupportDrawer/index.tsx b/src/views/ArticleDetail/Support/SupportDrawer/index.tsx index 4a73026fd3..ebe14d78ff 100644 --- a/src/views/ArticleDetail/Support/SupportDrawer/index.tsx +++ b/src/views/ArticleDetail/Support/SupportDrawer/index.tsx @@ -39,8 +39,9 @@ export const SupportDrawer: React.FC = ({ }) } closeDrawer={onClose} + fixedWidth /> - + {({ openDialog }) => ( @@ -224,7 +223,7 @@ const CommentButton = ({ {...buttonProps} /> )} - + ) } diff --git a/src/views/ArticleDetail/Toolbar/FixedToolbar/index.tsx b/src/views/ArticleDetail/Toolbar/FixedToolbar/index.tsx index a587cc2502..08079d5983 100644 --- a/src/views/ArticleDetail/Toolbar/FixedToolbar/index.tsx +++ b/src/views/ArticleDetail/Toolbar/FixedToolbar/index.tsx @@ -8,7 +8,11 @@ import { UNIVERSAL_AUTH_TRIGGER, } from '~/common/enums' import { analytics, toLocale, toPath } from '~/common/utils' -import { ButtonProps, CommentFormBetaDialog, ViewerContext } from '~/components' +import { + ArticleCommentFormDialog, + ButtonProps, + ViewerContext, +} from '~/components' import DropdownActions, { DropdownActionsControls, } from '~/components/ArticleDigest/DropdownActions' @@ -74,8 +78,8 @@ const FixedToolbar = ({ data-test-id={TEST_ID.ARTICLE_TOOLBAR} id={TOOLBAR_FIXEDTOOLBAR_ID} > - - {({ openDialog: openCommentFormBetaDialog }) => ( + + {({ openDialog: openArticleCommentFormDialog }) => (
    {showCommentToolbar && (
    )} -
    +
    ) } diff --git a/src/views/Callback/LoginCallback.tsx b/src/views/Callback/LoginCallback.tsx index 21144c8d84..097d1c164b 100644 --- a/src/views/Callback/LoginCallback.tsx +++ b/src/views/Callback/LoginCallback.tsx @@ -32,7 +32,8 @@ const LoginCallback = () => { try { const referralCode = getQuery(REFERRAL_QUERY_REFERRAL_KEY) || - storage.get(REFERRAL_STORAGE_REFERRAL_CODE)?.referralCode || + storage.get<{ referralCode: string }>(REFERRAL_STORAGE_REFERRAL_CODE) + ?.referralCode || undefined const { data } = await login({ variables: { diff --git a/src/views/Callback/SocialCallback.tsx b/src/views/Callback/SocialCallback.tsx index 0fd7fc0f08..9ed3bdffbd 100644 --- a/src/views/Callback/SocialCallback.tsx +++ b/src/views/Callback/SocialCallback.tsx @@ -72,12 +72,13 @@ const SocialCallback = ({ type }: Props) => { useEffect(() => { const referralCode = getQuery(REFERRAL_QUERY_REFERRAL_KEY) || - storage.get(REFERRAL_STORAGE_REFERRAL_CODE)?.referralCode || + storage.get<{ referralCode: string }>(REFERRAL_STORAGE_REFERRAL_CODE) + ?.referralCode || undefined - const localState = storage.get(OAUTH_STORAGE_STATE) - const localNonce = storage.get(OAUTH_STORAGE_NONCE) - const localCodeVerifier = storage.get(OAUTH_STORAGE_CODE_VERIFIER) - const localPath = storage.get(OAUTH_STORAGE_PATH) + const localState = storage.get(OAUTH_STORAGE_STATE) + const localNonce = storage.get(OAUTH_STORAGE_NONCE) + const localCodeVerifier = storage.get(OAUTH_STORAGE_CODE_VERIFIER) + const localPath = storage.get(OAUTH_STORAGE_PATH) const localOauthToken = sessionStorage.get( OAUTH_SESSSION_STORAGE_OAUTH_TOKEN @@ -86,7 +87,7 @@ const SocialCallback = ({ type }: Props) => { OAUTH_SESSSION_STORAGE_OAUTH_TYPE ) - if (!!error) { + if (!!error && localPath) { window.location.href = localPath return } @@ -141,7 +142,9 @@ const SocialCallback = ({ type }: Props) => { analytics.identifyUser() - window.location.href = localPath + if (localPath) { + window.location.href = localPath + } } catch (error) { let hasFobiddenError = false const codes = getErrorCodes(error as any) @@ -198,7 +201,10 @@ const SocialCallback = ({ type }: Props) => { type, state: OAUTH_STORAGE_BIND_STATE_SUCCESS, }) - window.location.href = localPath + + if (localPath) { + window.location.href = localPath + } } catch (error) { const codes = getErrorCodes(error as any) let hasBindFailure = false @@ -217,7 +223,7 @@ const SocialCallback = ({ type }: Props) => { hasBindFailure = true } }) - if (hasBindFailure) { + if (hasBindFailure && localPath) { window.location.href = localPath return } diff --git a/src/views/Circle/Analytics/FollowerAnalytics/index.tsx b/src/views/Circle/Analytics/FollowerAnalytics/index.tsx index 49470a40bb..d55d318eb8 100644 --- a/src/views/Circle/Analytics/FollowerAnalytics/index.tsx +++ b/src/views/Circle/Analytics/FollowerAnalytics/index.tsx @@ -5,6 +5,7 @@ import { FormattedMessage, useIntl } from 'react-intl' import { ReactComponent as IconAnalyticsFollower24 } from '@/public/static/icons/24px/analytics-follower.svg' import { CHART_COLOR } from '~/common/enums' import { + type Datum, QueryError, SpinnerBlock, StackedAreaChart, @@ -127,7 +128,7 @@ const Content = () => { /> + formatter={(datum: Datum) => ` ${datum.value}${intl.formatMessage({ defaultMessage: 'followers', id: 'MDNaxs', diff --git a/src/views/Circle/Analytics/IncomeAnalytics/index.tsx b/src/views/Circle/Analytics/IncomeAnalytics/index.tsx index ad36a8f1e2..b4b3c4074f 100644 --- a/src/views/Circle/Analytics/IncomeAnalytics/index.tsx +++ b/src/views/Circle/Analytics/IncomeAnalytics/index.tsx @@ -6,6 +6,7 @@ import { ReactComponent as IconAnalyticsIncome24 } from '@/public/static/icons/2 import { CHART_COLOR } from '~/common/enums' import { formatAmount } from '~/common/utils' import { + type Datum, QueryError, SpinnerBlock, StackedAreaChart, @@ -119,8 +120,10 @@ const Content = () => { /> - `${formatAmount(datum.value, 0)} HKD` + formatter={(datum: Datum) => + typeof datum.value === 'number' + ? `${formatAmount(datum.value, 0)} HKD` + : '' } /> diff --git a/src/views/Circle/Analytics/SubscriberAnalytics/index.tsx b/src/views/Circle/Analytics/SubscriberAnalytics/index.tsx index a87821a665..e17f1d05b2 100644 --- a/src/views/Circle/Analytics/SubscriberAnalytics/index.tsx +++ b/src/views/Circle/Analytics/SubscriberAnalytics/index.tsx @@ -7,6 +7,7 @@ import { ReactComponent as IconAnalyticsSubscriber24 } from '@/public/static/ico import { CHART_COLOR } from '~/common/enums' import { Button, + type Datum, QueryError, SpinnerBlock, StackedAreaChart, @@ -76,7 +77,7 @@ const Content = () => { [DatumKey.subscriber]: CHART_COLOR.yellow, } - const tooltipFormatter = (datum: any) => { + const tooltipFormatter = (datum: Datum) => { const { time, ...values } = datum return [ diff --git a/src/views/Circle/Broadcast/Broadcast.tsx b/src/views/Circle/Broadcast/Broadcast.tsx index 1351f431eb..a5380b163f 100644 --- a/src/views/Circle/Broadcast/Broadcast.tsx +++ b/src/views/Circle/Broadcast/Broadcast.tsx @@ -12,13 +12,13 @@ import { parseCommentHash, } from '~/common/utils' import { - CommentForm, + CircleCommentForm, + CircleThreadComment, EmptyComment, InfiniteScroll, List, QueryError, SpinnerBlock, - ThreadComment, Throw404, toast, usePublicQuery, @@ -210,7 +210,7 @@ const CricleBroadcast = () => {
    {isOwner && (
    - { {comments.map((comment) => ( - {
    {!circle.owner.isBlocking && (
    - { {comments.map((comment) => ( - { - & { {header}
    - +
    diff --git a/src/views/Home/Announcements/Carousel/index.tsx b/src/views/Home/Announcements/Carousel/index.tsx index a725e18ba1..12a452a5b4 100644 --- a/src/views/Home/Announcements/Carousel/index.tsx +++ b/src/views/Home/Announcements/Carousel/index.tsx @@ -1,5 +1,12 @@ import useEmblaCarousel from 'embla-carousel-react' -import { useCallback, useContext, useEffect, useRef, useState } from 'react' +import { + type MouseEvent, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from 'react' import { BannerExposureTracker, @@ -60,7 +67,7 @@ const Carousel = ({ items }: CarouselProps) => { } } - const onCaptureClick = (event: any) => { + const onCaptureClick = (event: MouseEvent) => { if (scrolling.current) { event.preventDefault() event.stopPropagation() diff --git a/src/views/Home/Announcements/Carousel/styles.module.css b/src/views/Home/Announcements/Carousel/styles.module.css index 4435dfb4c9..85dc30b1c8 100644 --- a/src/views/Home/Announcements/Carousel/styles.module.css +++ b/src/views/Home/Announcements/Carousel/styles.module.css @@ -1,10 +1,10 @@ .carousel { position: relative; width: 100%; - padding: var(--sp16) var(--sp16) 0; + padding: var(--sp8) 0 0; @media (--sm-up) { - padding: var(--sp32) 0 0; + padding: 0; } } @@ -12,17 +12,12 @@ @mixin flex-center-space-between; position: absolute; - top: var(--sp16); right: var(--sp16); left: var(--sp16); z-index: 1; height: 2rem; - padding-top: var(--sp8); - padding-left: var(--sp8); @media (--sm-up) { - padding-top: var(--sp32); - padding-left: 0; margin-left: calc(0 - var(--sp8)); } diff --git a/src/views/Home/Feed/MainFeed/index.tsx b/src/views/Home/Feed/MainFeed/index.tsx index 40d306c4e8..f86fa5fe77 100644 --- a/src/views/Home/Feed/MainFeed/index.tsx +++ b/src/views/Home/Feed/MainFeed/index.tsx @@ -20,6 +20,7 @@ import { NewestFeedPublicQuery, } from '~/gql/graphql' +import Announcements from '../../Announcements' import Authors from '../Authors' import Billboard from '../Billboard' import { FEED_ARTICLES_PRIVATE, FEED_ARTICLES_PUBLIC } from '../gql' @@ -214,6 +215,7 @@ const MainFeed = ({ feedSortType: sortBy }: MainFeedProps) => { eof > + {isHottestFeed && } {mixFeed.map((edge, i) => { if (edge?.__typename === 'HorizontalFeed') { const { Feed } = edge diff --git a/src/views/Home/index.tsx b/src/views/Home/index.tsx index 1159de75f8..98d6aef0f4 100644 --- a/src/views/Home/index.tsx +++ b/src/views/Home/index.tsx @@ -1,8 +1,7 @@ import { FormattedMessage } from 'react-intl' -import { Layout, Spacer } from '~/components' +import { Layout } from '~/components' -import Announcements from './Announcements' import Feed from './Feed' import Sidebar from './Sidebar' @@ -21,10 +20,6 @@ const Home = () => { title={} /> - - - - ) diff --git a/src/views/Me/DraftDetail/index.tsx b/src/views/Me/DraftDetail/index.tsx index a2b01d812f..03e1ec6351 100644 --- a/src/views/Me/DraftDetail/index.tsx +++ b/src/views/Me/DraftDetail/index.tsx @@ -9,7 +9,7 @@ import { ENTITY_TYPE, MAX_ARTICLE_CONTENT_LENGTH, } from '~/common/enums' -import { stripHtml } from '~/common/utils' +import { containsFigureTag, stripHtml } from '~/common/utils' import { DraftDetailStateContext, DraftDetailStateProvider, @@ -155,7 +155,9 @@ const BaseDraftDetail = () => { ) } - const hasContent = draft?.content && stripHtml(draft.content).length > 0 + const hasContent = + draft?.content && + (stripHtml(draft.content).length > 0 || containsFigureTag(draft.content)) const hasTitle = draft?.title && draft.title.length > 0 const isUnpublished = draft?.publishState === 'unpublished' const publishable = !!( @@ -168,7 +170,7 @@ const BaseDraftDetail = () => { ) const upload = async (input: { - [key: string]: any + [key: string]: string | File }): Promise<{ id: string; path: string }> => { const isImage = input.type !== ASSET_TYPE.embedaudio @@ -202,7 +204,7 @@ const BaseDraftDetail = () => { uploadURL, } = result?.data?.directImageUpload || {} - if (assetId && path && uploadURL) { + if (assetId && path && uploadURL && input.file instanceof File) { try { await uploadImage({ uploadURL, file: input.file }) } catch (error) { diff --git a/src/views/Me/History/Comments/index.tsx b/src/views/Me/History/Comments/index.tsx index 9deacd1586..9336d7300e 100644 --- a/src/views/Me/History/Comments/index.tsx +++ b/src/views/Me/History/Comments/index.tsx @@ -152,9 +152,12 @@ const Comments = () => { article: node as CommentArticle, })} > -
    - {stripHtml(comment.content || '')} -
    +
    diff --git a/src/views/Me/Settings/Account/Socials/index.tsx b/src/views/Me/Settings/Account/Socials/index.tsx index cc5bb2199c..4ddb5dd7b8 100644 --- a/src/views/Me/Settings/Account/Socials/index.tsx +++ b/src/views/Me/Settings/Account/Socials/index.tsx @@ -89,7 +89,13 @@ const Socials = () => { } useEffect(() => { - const bindResult = storage.remove(OAUTH_STORAGE_BIND_STATE) + const bindResult = storage.remove<{ + type: SocialAccountType + state: + | typeof OAUTH_STORAGE_BIND_STATE_SUCCESS + | typeof OAUTH_STORAGE_BIND_STATE_FAILURE + | typeof OAUTH_STORAGE_BIND_STATE_UNAVAILABLE + }>(OAUTH_STORAGE_BIND_STATE) if (!bindResult) { return } diff --git a/src/views/Me/Settings/Notifications/GeneralSettings/index.tsx b/src/views/Me/Settings/Notifications/GeneralSettings/index.tsx index d061ca9730..181260a703 100644 --- a/src/views/Me/Settings/Notifications/GeneralSettings/index.tsx +++ b/src/views/Me/Settings/Notifications/GeneralSettings/index.tsx @@ -24,7 +24,6 @@ const VIEWER_NOTIFICATIONS_GENERAL_SETTINGS = gql` articleNewComment articleNewAppreciation articleNewSubscription - articleCommentPinned articleNewCollected } } @@ -47,7 +46,6 @@ const UPDATE_VIEWER_NOTIFICATIONS_GENERAL = gql` articleNewComment articleNewAppreciation articleNewSubscription - articleCommentPinned articleNewCollected } } @@ -245,31 +243,6 @@ const NotificationsGeneralSettings = () => { /> } /> - - {/* Comments has been pinned */} - - } - right={ - - } - checked={settings.articleCommentPinned} - onChange={() => toggle('articleCommentPinned')} - /> - } - /> diff --git a/src/views/OAuth/Authorize/index.tsx b/src/views/OAuth/Authorize/index.tsx index aa6e04bbd3..1934497d42 100644 --- a/src/views/OAuth/Authorize/index.tsx +++ b/src/views/OAuth/Authorize/index.tsx @@ -116,7 +116,7 @@ const BaseOAuthAuthorize = () => { />
  • {validScopes && - validScopes.map((s: any) => { + validScopes.map((s) => { const readableScope = toReadableScope({ scope: s, lang, diff --git a/src/views/OAuth/Callback/Failure/index.tsx b/src/views/OAuth/Callback/Failure/index.tsx index bdcabefaeb..1c4f942478 100644 --- a/src/views/OAuth/Callback/Failure/index.tsx +++ b/src/views/OAuth/Callback/Failure/index.tsx @@ -1,8 +1,10 @@ +import type { ReactNode } from 'react' import { FormattedMessage } from 'react-intl' import ICON_LIKECOIN from '@/public/static/icons/likecoin.svg' import ICON_STRIPE from '@/public/static/icons/stripe.svg' import { OAUTH_PROVIDER, PATHS } from '~/common/enums' +import type { TranslateArgs } from '~/common/utils' import { Layout, Translate, useRoute } from '~/components' import { Box } from '../../Box' @@ -21,7 +23,7 @@ const OAUTH_CALLBACK_ERROR_CODE = { stripeAccountRefresh: 7, } -const ERROR_TEXT = { +const ERROR_TEXT: { [key: number]: TranslateArgs } = { [OAUTH_CALLBACK_ERROR_CODE.userNotFound]: { zh_hant: '用戶不存在,請回到 Matters 再次嘗試', zh_hans: '用户不存在,请回到 Matters 再次尝试', @@ -61,9 +63,9 @@ const ERROR_TEXT = { const OAuthCallbackFailure = () => { const { getQuery, router } = useRoute() - const code = getQuery('code') + const code = Number(getQuery('code')) const provider = getQuery('provider') - const title: { [key: string]: any } = { + const title: { [key: string]: ReactNode } = { likecoin: ( { /> ), } - const avatar: { [key: string]: any } = { + const avatar: { [key: string]: string } = { likecoin: ICON_LIKECOIN, 'stripe-connect': ICON_STRIPE, } - const errorDetail = ERROR_TEXT[code as any] + const errorDetail = code in ERROR_TEXT ? ERROR_TEXT[code] : null if (!provider || OAUTH_PROVIDER.indexOf(provider) < 0) { router.push(PATHS.HOME) diff --git a/src/views/OAuth/Callback/Success/index.tsx b/src/views/OAuth/Callback/Success/index.tsx index 5e88060158..ce199bc5fa 100644 --- a/src/views/OAuth/Callback/Success/index.tsx +++ b/src/views/OAuth/Callback/Success/index.tsx @@ -1,3 +1,4 @@ +import type { ReactNode } from 'react' import { FormattedMessage } from 'react-intl' import ICON_LIKECOIN from '@/public/static/icons/likecoin.svg' @@ -11,7 +12,7 @@ import styles from '../styles.module.css' const OAuthCallbackSuccess = () => { const { getQuery, router } = useRoute() const provider = getQuery('provider') - const title: { [key: string]: any } = { + const title: { [key: string]: ReactNode } = { likecoin: ( { /> ), } - const avatar: { [key: string]: any } = { + const avatar: { [key: string]: string } = { likecoin: ICON_LIKECOIN, 'stripe-connect': ICON_STRIPE, } diff --git a/src/views/Pay/Callback/Failure/index.tsx b/src/views/Pay/Callback/Failure/index.tsx index 3ff216ee29..77a7f524aa 100644 --- a/src/views/Pay/Callback/Failure/index.tsx +++ b/src/views/Pay/Callback/Failure/index.tsx @@ -1,3 +1,4 @@ +import type { ReactNode } from 'react' import { FormattedMessage } from 'react-intl' import ICON_LIKECOIN from '@/public/static/icons/likecoin.svg' @@ -10,10 +11,10 @@ import styles from '../styles.module.css' const OAuthCallbackFailure = () => { const { getQuery, router } = useRoute() const provider = getQuery('provider') - const title: { [key: string]: any } = { + const title: { [key: string]: ReactNode } = { likecoin: , } - const avatar: { [key: string]: any } = { + const avatar: { [key: string]: string } = { likecoin: ICON_LIKECOIN, } diff --git a/src/views/Pay/Callback/Success/index.tsx b/src/views/Pay/Callback/Success/index.tsx index 55a72db7cd..c1121869d9 100644 --- a/src/views/Pay/Callback/Success/index.tsx +++ b/src/views/Pay/Callback/Success/index.tsx @@ -1,3 +1,4 @@ +import type { ReactNode } from 'react' import { FormattedMessage } from 'react-intl' import ICON_LIKECOIN from '@/public/static/icons/likecoin.svg' @@ -10,10 +11,10 @@ import styles from '../styles.module.css' const PayCallbackSuccess = () => { const { getQuery, router } = useRoute() const provider = getQuery('provider') - const title: { [key: string]: any } = { + const title: { [key: string]: ReactNode } = { likecoin: , } - const avatar: { [key: string]: any } = { + const avatar: { [key: string]: string } = { likecoin: ICON_LIKECOIN, } diff --git a/src/views/Search/index.tsx b/src/views/Search/index.tsx index 988664fa58..2d8b155a90 100644 --- a/src/views/Search/index.tsx +++ b/src/views/Search/index.tsx @@ -35,10 +35,10 @@ const Search = () => { } const addSearchHistory = (searchKey: string) => { - const nsh = _uniq([searchKey, ...(storage.get(storageKey) || [])]).slice( - 0, - SEARCH_HISTORY_LENGTH - ) + const nsh = _uniq([ + searchKey, + ...(storage.get(storageKey) || []), + ]).slice(0, SEARCH_HISTORY_LENGTH) updateSearchHistory(nsh) } @@ -56,7 +56,11 @@ const Search = () => { useEffect(() => { if (!isHistory) return - setSearchHistory(storage.get(storageKey)) + const history = storage.get(storageKey) + + if (history) { + setSearchHistory(history) + } }, [storageKey]) useEffect(() => { diff --git a/src/views/User/UserProfile/AsideUserProfile/index.tsx b/src/views/User/UserProfile/AsideUserProfile/index.tsx index abb559974c..33b11a2339 100644 --- a/src/views/User/UserProfile/AsideUserProfile/index.tsx +++ b/src/views/User/UserProfile/AsideUserProfile/index.tsx @@ -340,7 +340,7 @@ export const AsideUserProfile = () => { textActiveColor="green" onClick={openEditProfileDialog} > - + )} diff --git a/src/views/User/UserProfile/BadgesDialog/index.tsx b/src/views/User/UserProfile/BadgesDialog/index.tsx index 262c84a700..1d4a2008e8 100644 --- a/src/views/User/UserProfile/BadgesDialog/index.tsx +++ b/src/views/User/UserProfile/BadgesDialog/index.tsx @@ -45,7 +45,7 @@ export const BaseBadgesDialog = ({ <> {children({ openDialog: openStepDialog })} - + {isInBadgesStep && ( <>