Skip to content

Commit

Permalink
feat(ArticleDetail): revise copy of <SupportWidget />
Browse files Browse the repository at this point in the history
  • Loading branch information
wlliaml committed Dec 20, 2023
1 parent 2c325f2 commit 4bf694f
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 36 deletions.
16 changes: 16 additions & 0 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,9 @@
"defaultMessage": "1 MB maximum",
"description": "MIGRATION_REACH_LIMIT"
},
"ptTHBL": {
"defaultMessage": "Call-to-Support"
},
"pzTOmv": {
"defaultMessage": "Followers"
},
Expand Down Expand Up @@ -2138,6 +2141,9 @@
"defaultMessage": "Notification not found",
"description": "NOTICE_NOT_FOUND"
},
"wNJjR5": {
"defaultMessage": "Support setting updated"
},
"wXzTZ0": {
"defaultMessage": "Enter the name of your Circle"
},
Expand All @@ -2164,6 +2170,9 @@
"defaultMessage": "Pin to profile",
"description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx"
},
"xQNq3I": {
"defaultMessage": "Thank-you card"
},
"xWZr13": {
"defaultMessage": "{follower, plural, =1 {follower} other {followers}}",
"description": "src/views/Circle/Analytics/FollowerAnalytics/index.tsx"
Expand Down Expand Up @@ -2249,6 +2258,9 @@
"z3uIHQ": {
"defaultMessage": "Undo upvote"
},
"z4Dl+l": {
"defaultMessage": "Transaction History"
},
"zAK5G+": {
"defaultMessage": "The login link has been sent to {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand All @@ -2275,6 +2287,10 @@
"defaultMessage": "left a comment in {circleName}",
"description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx"
},
"zn83cE": {
"defaultMessage": "Preview",
"description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx"
},
"znJ06J": {
"defaultMessage": "<a>About Nomad Matters</a>"
},
Expand Down
16 changes: 16 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,9 @@
"defaultMessage": "1MB maximum",
"description": "MIGRATION_REACH_LIMIT"
},
"ptTHBL": {
"defaultMessage": "Call-to-Support"
},
"pzTOmv": {
"defaultMessage": "Followers"
},
Expand Down Expand Up @@ -2138,6 +2141,9 @@
"defaultMessage": "Notification not found",
"description": "NOTICE_NOT_FOUND"
},
"wNJjR5": {
"defaultMessage": "Support setting updated"
},
"wXzTZ0": {
"defaultMessage": "Enter the name of your Circle"
},
Expand All @@ -2164,6 +2170,9 @@
"defaultMessage": "Pin to profile",
"description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx"
},
"xQNq3I": {
"defaultMessage": "Thank-you card"
},
"xWZr13": {
"defaultMessage": "{follower, plural, =1 {follower} other {followers}}",
"description": "src/views/Circle/Analytics/FollowerAnalytics/index.tsx"
Expand Down Expand Up @@ -2249,6 +2258,9 @@
"z3uIHQ": {
"defaultMessage": "Undo upvote"
},
"z4Dl+l": {
"defaultMessage": "Transaction History"
},
"zAK5G+": {
"defaultMessage": "The login link has been sent to {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand All @@ -2275,6 +2287,10 @@
"defaultMessage": "left a comment in {circleName}",
"description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx"
},
"zn83cE": {
"defaultMessage": "Preview",
"description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx"
},
"znJ06J": {
"defaultMessage": "<a>About Nomad Matters</a>"
},
Expand Down
18 changes: 17 additions & 1 deletion lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"defaultMessage": "目前尚无标签,立即添加提高作品曝光度!"
},
"5IS+ui": {
"defaultMessage": "设定支持"
"defaultMessage": "支持设置"
},
"5JN+nl": {
"defaultMessage": "请检查邮件",
Expand Down Expand Up @@ -1912,6 +1912,9 @@
"defaultMessage": "导入作品累計超过 1MB",
"description": "MIGRATION_REACH_LIMIT"
},
"ptTHBL": {
"defaultMessage": "支持号召"
},
"pzTOmv": {
"defaultMessage": "追踪者"
},
Expand Down Expand Up @@ -2138,6 +2141,9 @@
"defaultMessage": "通知不存在",
"description": "NOTICE_NOT_FOUND"
},
"wNJjR5": {
"defaultMessage": "支持反馈设置成功"
},
"wXzTZ0": {
"defaultMessage": "給圍爐取一個吸引人的名字吧"
},
Expand All @@ -2164,6 +2170,9 @@
"defaultMessage": "设为代表作",
"description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx"
},
"xQNq3I": {
"defaultMessage": "支持后回复"
},
"xWZr13": {
"defaultMessage": "{follower, plural, =1 {人} other {人}}",
"description": "src/views/Circle/Analytics/FollowerAnalytics/index.tsx"
Expand Down Expand Up @@ -2249,6 +2258,9 @@
"z3uIHQ": {
"defaultMessage": "取消点赞"
},
"z4Dl+l": {
"defaultMessage": "交易记录"
},
"zAK5G+": {
"defaultMessage": "登录链接已发送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand All @@ -2275,6 +2287,10 @@
"defaultMessage": "在 {circleName} 中留言",
"description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx"
},
"zn83cE": {
"defaultMessage": "效果预览",
"description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx"
},
"znJ06J": {
"defaultMessage": "<a>关于游牧者计划</a>"
},
Expand Down
18 changes: 17 additions & 1 deletion lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"defaultMessage": "目前尚無標籤,立即添加提高作品曝光度!"
},
"5IS+ui": {
"defaultMessage": "設定支持"
"defaultMessage": "支持設置"
},
"5JN+nl": {
"defaultMessage": "請檢查郵件",
Expand Down Expand Up @@ -1912,6 +1912,9 @@
"defaultMessage": "導入作品累計超過 1MB",
"description": "MIGRATION_REACH_LIMIT"
},
"ptTHBL": {
"defaultMessage": "支持號召"
},
"pzTOmv": {
"defaultMessage": "追蹤者"
},
Expand Down Expand Up @@ -2138,6 +2141,9 @@
"defaultMessage": "通知不存在",
"description": "NOTICE_NOT_FOUND"
},
"wNJjR5": {
"defaultMessage": "支持反饋設置成功"
},
"wXzTZ0": {
"defaultMessage": "给围炉取一个吸引人的名字吧"
},
Expand All @@ -2164,6 +2170,9 @@
"defaultMessage": "設為代表作",
"description": "src/components/CollectionDigest/DropdownActions/PinButton.tsx"
},
"xQNq3I": {
"defaultMessage": "支持後回覆"
},
"xWZr13": {
"defaultMessage": "{follower, plural, =1 {人} other {人}}",
"description": "src/views/Circle/Analytics/FollowerAnalytics/index.tsx"
Expand Down Expand Up @@ -2249,6 +2258,9 @@
"z3uIHQ": {
"defaultMessage": "取消點讚"
},
"z4Dl+l": {
"defaultMessage": "交易記錄"
},
"zAK5G+": {
"defaultMessage": "登入連結已發送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand All @@ -2275,6 +2287,10 @@
"defaultMessage": "在 {circleName} 中留言",
"description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx"
},
"zn83cE": {
"defaultMessage": "效果預覽",
"description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx"
},
"znJ06J": {
"defaultMessage": "<a>關於遊牧者計畫</a>"
},
Expand Down
9 changes: 0 additions & 9 deletions src/common/enums/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ export const TEXT = {
register: '註冊',
reply: '回覆',
replyComment: '回覆評論',
replyToDonator: '支持後感謝',
report: '檢舉',
requestForDonation: '號召支持',
required: '必填欄位',
resend: '重新發送',
resetPassword: '重置密碼',
Expand Down Expand Up @@ -173,7 +171,6 @@ export const TEXT = {
successLogout: '登出成功',
successRegister: '註冊成功',
successResetPassword: '密碼重置成功',
successSetSupportSetting: '支持反饋設置成功',
successTopUp: '儲值成功',
successUnblock: '已取消封鎖。該用戶現在可以評論你的作品和圍爐。',
successUploadImage: '圖片上傳成功',
Expand Down Expand Up @@ -352,9 +349,7 @@ export const TEXT = {
register: '注册',
reply: '回复',
replyComment: '回复评论',
replyToDonator: '支持后感谢',
report: '检举',
requestForDonation: '号召支持',
required: '必填栏位',
resend: '重新发送',
resetPassword: '重置密码',
Expand Down Expand Up @@ -396,7 +391,6 @@ export const TEXT = {
successLogout: '登出成功',
successRegister: '注册成功',
successResetPassword: '密码重置成功',
successSetSupportSetting: '支持反馈设置成功',
successTopUp: '储值成功',
successUnblock: '已取消屏蔽。该用户现在可以评论你的作品和围炉。',
successUploadImage: '图片上传成功',
Expand Down Expand Up @@ -589,9 +583,7 @@ export const TEXT = {
register: 'Register',
reply: 'Reply',
replyComment: 'Write a comment',
replyToDonator: 'Thank-you card',
report: 'Report',
requestForDonation: 'Call-to-Support',
required: 'Required',
resend: 'Resend',
resetPassword: 'Reset Password',
Expand Down Expand Up @@ -635,7 +627,6 @@ export const TEXT = {
successLogout: 'Logged out successfully',
successRegister: 'Thank you for registering',
successResetPassword: 'Password successfully changed.',
successSetSupportSetting: 'Support setting updated',
successTopUp: 'Topped up successfully',
successUnblock: 'User unblocked. User can now comment on your articles.',
successUploadImage: 'Image uploaded',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
LanguageContext,
TextIcon,
toast,
Translate,
useRoute,
} from '~/components'
import { ArticleDetailPublicQuery, EditMetaDraftFragment } from '~/gql/graphql'
Expand Down Expand Up @@ -83,7 +82,12 @@ const SupportSettingDialogContent: React.FC<FormProps> = ({
editSupportSetting(values.requestForDonation, values.replyToDonator)

toast.success({
message: <Translate id="successSetSupportSetting" />,
message: (
<FormattedMessage
defaultMessage="Support setting updated"
id="wNJjR5"
/>
),
})

setSubmitting(false)
Expand All @@ -105,7 +109,9 @@ const SupportSettingDialogContent: React.FC<FormProps> = ({
<Form id={formId} onSubmit={handleSubmit}>
{tab === 'request' && (
<Form.Textarea
label={<Translate id="requestForDonation" />}
label={
<FormattedMessage defaultMessage="Call-to-Support" id="ptTHBL" />
}
name="requestForDonation"
placeholder={intl.formatMessage({
defaultMessage:
Expand All @@ -126,13 +132,16 @@ const SupportSettingDialogContent: React.FC<FormProps> = ({
)}
{tab === 'reply' && (
<Form.Textarea
label={<Translate id="replyToDonator" />}
label={
<FormattedMessage defaultMessage="Thank-you card" id="xQNq3I" />
}
name="replyToDonator"
placeholder={intl.formatMessage({
defaultMessage:
'With your support, I will be able to accumulate more energy to create.',
id: 'E+dEI9',
})}
value={values.replyToDonator! || ''}
hint={`${
values.replyToDonator?.length || 0
}/${MAX_ARTICLE_SUPPORT_LENGTH}`}
Expand Down Expand Up @@ -185,10 +194,10 @@ const SupportSettingDialogContent: React.FC<FormProps> = ({

<h3 className={styles.previewTitle}>
<TextIcon size="md" weight="md">
<Translate
zh_hans="效果预览"
zh_hant="效果預覽"
en="Support Setting Preview"
<FormattedMessage
defaultMessage="Preview"
id="zn83cE"
description="src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx"
/>
</TextIcon>
</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Tabs, Translate } from '~/components'
import { FormattedMessage } from 'react-intl'

import { Tabs } from '~/components'

export type TabType = 'request' | 'reply'

Expand All @@ -14,11 +16,11 @@ const SortBy: React.FC<SortByProps> = ({ tabType, setTabType }) => {
return (
<Tabs>
<Tabs.Tab onClick={() => setTabType('request')} selected={isRequest}>
<Translate id="requestForDonation" />
<FormattedMessage defaultMessage="Call-to-Support" id="ptTHBL" />
</Tabs.Tab>

<Tabs.Tab onClick={() => setTabType('reply')} selected={isReply}>
<Translate id="replyToDonator" />
<FormattedMessage defaultMessage="Thank-you card" id="xQNq3I" />
</Tabs.Tab>
</Tabs>
)
Expand Down
7 changes: 3 additions & 4 deletions src/components/Editor/ToggleAccess/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ const ToggleAccess: React.FC<ToggleAccessProps> = ({
<section className={styles.support}>
<section className={styles.left}>
<h3 className={styles.title}>
<Translate
zh_hans="设定支持"
zh_hant="設定支持"
en="Support Setting"
<FormattedMessage
defaultMessage="Support Setting"
id="5IS+ui"
/>
</h3>

Expand Down
Loading

0 comments on commit 4bf694f

Please sign in to comment.