diff --git a/lang/default.json b/lang/default.json index cb811251e1..db7afe8c1c 100644 --- a/lang/default.json +++ b/lang/default.json @@ -188,6 +188,9 @@ "defaultMessage": "Circle Subscription", "description": "src/components/Transaction/index.tsx" }, + "0r2yd+": { + "defaultMessage": "Paragraph indent" + }, "0tHLRn": { "defaultMessage": "Insufficient Balance" }, @@ -1193,6 +1196,9 @@ "defaultMessage": "Add hash from IPFS into compatible reader such as", "description": "src/components/Dialogs/RssFeedDialog/Content.tsx" }, + "HwaiSE": { + "defaultMessage": "Upon activation, the main text will be temporarily obscured, displaying only the title and summary. Readers can choose whether to continue reading. (Contains explicit content, violence, gore, etc.)" + }, "HxcjQl": { "defaultMessage": "Matters continues to provide services that combine creativity with blockchain technology. You will be the first to experience them after completing connecting wallet.", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -1945,10 +1951,6 @@ "VmYzLr": { "defaultMessage": "{total} members" }, - "Vn5KLr": { - "defaultMessage": "Upon activation, the main text will be temporarily obscured, displaying only the title and summary. Readers can choose whether to continue reading. (Contains explicit content, violence, gore, etc.)", - "description": "src/components/Editor/ToggleAccess/index.tsx" - }, "VqdOGQ": { "defaultMessage": "More", "description": "src/views/ArticleDetail/AuthorSidebar/Tabs/index.tsx" @@ -2756,6 +2758,10 @@ "l2eEyp": { "defaultMessage": "Transaction Password successfully changed." }, + "l31hCd": { + "defaultMessage": "Preview", + "description": "src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx" + }, "l9LpDx": { "defaultMessage": "{q} - Matters Search", "description": "src/views/Search/AggregateResults/Articles.tsx" @@ -3548,10 +3554,6 @@ "defaultMessage": "left a comment in {circleName}", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" }, - "zn83cE": { - "defaultMessage": "Preview", - "description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx" - }, "zvNfwL": { "defaultMessage": "Operation too frequent, please try again later.", "description": "ACTION_LIMIT_EXCEEDED" diff --git a/lang/en.json b/lang/en.json index 9774736613..a9c119cecd 100644 --- a/lang/en.json +++ b/lang/en.json @@ -188,6 +188,9 @@ "defaultMessage": "Circle Subscription", "description": "src/components/Transaction/index.tsx" }, + "0r2yd+": { + "defaultMessage": "Paragraph indent" + }, "0tHLRn": { "defaultMessage": "Insufficient Balance" }, @@ -1193,6 +1196,9 @@ "defaultMessage": "Add hash from IPFS into compatible reader such as ", "description": "src/components/Dialogs/RssFeedDialog/Content.tsx" }, + "HwaiSE": { + "defaultMessage": "Upon activation, the main text will be temporarily obscured, displaying only the title and summary. Readers can choose whether to continue reading. (Contains explicit content, violence, gore, etc.)" + }, "HxcjQl": { "defaultMessage": "Matters continues to provide services that combine creativity with blockchain technology. You will be the first to experience them after completing connecting wallet.", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -1945,10 +1951,6 @@ "VmYzLr": { "defaultMessage": "{total} members" }, - "Vn5KLr": { - "defaultMessage": "Upon activation, the main text will be temporarily obscured, displaying only the title and summary. Readers can choose whether to continue reading. (Contains explicit content, violence, gore, etc.)", - "description": "src/components/Editor/ToggleAccess/index.tsx" - }, "VqdOGQ": { "defaultMessage": "More", "description": "src/views/ArticleDetail/AuthorSidebar/Tabs/index.tsx" @@ -2756,6 +2758,10 @@ "l2eEyp": { "defaultMessage": "Transaction Password successfully changed." }, + "l31hCd": { + "defaultMessage": "Preview", + "description": "src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx" + }, "l9LpDx": { "defaultMessage": "{q} - Matters Search", "description": "src/views/Search/AggregateResults/Articles.tsx" @@ -3548,10 +3554,6 @@ "defaultMessage": "left a comment in {circleName}", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" }, - "zn83cE": { - "defaultMessage": "Preview", - "description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx" - }, "zvNfwL": { "defaultMessage": "Operation too frequent, please try again later.", "description": "ACTION_LIMIT_EXCEEDED" diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 494069df2c..9589c8516c 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -188,6 +188,9 @@ "defaultMessage": "围炉营收", "description": "src/components/Transaction/index.tsx" }, + "0r2yd+": { + "defaultMessage": "首行缩进" + }, "0tHLRn": { "defaultMessage": "钱包余额不足" }, @@ -1193,6 +1196,9 @@ "defaultMessage": "添加 IPFS 生成的 IPNS 指纹到阅读器,如:", "description": "src/components/Dialogs/RssFeedDialog/Content.tsx" }, + "HwaiSE": { + "defaultMessage": "开启后,正文将被暂时遮蔽,只显示标题与摘要,并由读者选择是否继续阅读(例如含有色情、暴力、血腥等内容)" + }, "HxcjQl": { "defaultMessage": "Matters 将提供更多创作与区块链结合的服务,接入钱包后即可在未来第一时间体验新功能。", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -1945,10 +1951,6 @@ "VmYzLr": { "defaultMessage": "{total} 個成員" }, - "Vn5KLr": { - "defaultMessage": "开启后,正文将被暂时遮蔽,只显示标题与摘要,并由读者选择是否继续阅读(例如含有色情、暴力、血腥等内容)", - "description": "src/components/Editor/ToggleAccess/index.tsx" - }, "VqdOGQ": { "defaultMessage": "相关推荐", "description": "src/views/ArticleDetail/AuthorSidebar/Tabs/index.tsx" @@ -2756,6 +2758,10 @@ "l2eEyp": { "defaultMessage": "交易密码重置成功" }, + "l31hCd": { + "defaultMessage": "效果预览", + "description": "src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx" + }, "l9LpDx": { "defaultMessage": "{q} - Matters 搜索", "description": "src/views/Search/AggregateResults/Articles.tsx" @@ -3548,10 +3554,6 @@ "defaultMessage": "在 {circleName} 中留言", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" }, - "zn83cE": { - "defaultMessage": "效果预览", - "description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx" - }, "zvNfwL": { "defaultMessage": "操作过于频繁,请稍候重试", "description": "ACTION_LIMIT_EXCEEDED" diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 6fb9fa24a9..f3cd840675 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -188,6 +188,9 @@ "defaultMessage": "圍爐訂閱", "description": "src/components/Transaction/index.tsx" }, + "0r2yd+": { + "defaultMessage": "首行縮排" + }, "0tHLRn": { "defaultMessage": "錢包餘額不足" }, @@ -1193,6 +1196,9 @@ "defaultMessage": "添加 IPFS 生成的 IPNS 指紋到閱讀器,如:", "description": "src/components/Dialogs/RssFeedDialog/Content.tsx" }, + "HwaiSE": { + "defaultMessage": "開啟後,正文將被暫時遮蔽,只顯示標題與摘要,並由讀者選擇是否繼續閱讀(例如含有色情、暴力、血腥等內容)" + }, "HxcjQl": { "defaultMessage": "Matters 將提供更多創作與區塊鏈結合的服務,接入錢包後即可在未來第一時間體驗新功能。", "description": "src/components/Forms/WalletAuthForm/Select.tsx" @@ -1945,10 +1951,6 @@ "VmYzLr": { "defaultMessage": "{total} 個成員" }, - "Vn5KLr": { - "defaultMessage": "開啟後,正文將被暫時遮蔽,只顯示標題與摘要,並由讀者選擇是否繼續閱讀(例如含有色情、暴力、血腥等內容)", - "description": "src/components/Editor/ToggleAccess/index.tsx" - }, "VqdOGQ": { "defaultMessage": "相關推薦", "description": "src/views/ArticleDetail/AuthorSidebar/Tabs/index.tsx" @@ -2756,6 +2758,10 @@ "l2eEyp": { "defaultMessage": "交易密碼重置成功" }, + "l31hCd": { + "defaultMessage": "效果預覽", + "description": "src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx" + }, "l9LpDx": { "defaultMessage": "{q} - Matters 搜尋", "description": "src/views/Search/AggregateResults/Articles.tsx" @@ -3548,10 +3554,6 @@ "defaultMessage": "在 {circleName} 中留言", "description": "src/components/Notice/CircleNotice/CircleNewDiscussionComments.tsx" }, - "zn83cE": { - "defaultMessage": "效果預覽", - "description": "src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx" - }, "zvNfwL": { "defaultMessage": "操作過於頻繁,請稍候重試", "description": "ACTION_LIMIT_EXCEEDED" diff --git a/public/static/icons/24px/indent.svg b/public/static/icons/24px/indent.svg new file mode 100644 index 0000000000..ba98434993 --- /dev/null +++ b/public/static/icons/24px/indent.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/Editor/BottomBar/MoreSettingsDialog/index.tsx b/src/components/Editor/BottomBar/MobileSettingsDialog/index.tsx similarity index 62% rename from src/components/Editor/BottomBar/MoreSettingsDialog/index.tsx rename to src/components/Editor/BottomBar/MobileSettingsDialog/index.tsx index f6e09299e4..7fc405d49e 100644 --- a/src/components/Editor/BottomBar/MoreSettingsDialog/index.tsx +++ b/src/components/Editor/BottomBar/MobileSettingsDialog/index.tsx @@ -1,28 +1,33 @@ import _get from 'lodash/get' -import { FormattedMessage } from 'react-intl' +import { FormattedMessage, useIntl } from 'react-intl' -import { Dialog, useDialogSwitch } from '~/components' +import { Dialog, Switch, useDialogSwitch } from '~/components' +import MoreSettings, { MoreSettingsProps } from '../../MoreSettings' import SelectCampaign, { SelectCampaignProps } from '../../SelectCampaign' -import ToggleAccess, { ToggleAccessProps } from '../../ToggleAccess' +import { SidebarIndentProps } from '../../Sidebar/Indent' import ToggleResponse, { ToggleResponseProps } from '../../ToggleResponse' import styles from './styles.module.css' -type MoreSettingsDialogProps = { +type MobileSettingsDialogProps = { children: ({ openDialog }: { openDialog: () => void }) => React.ReactNode -} & ToggleAccessProps & +} & MoreSettingsProps & ToggleResponseProps & + SidebarIndentProps & Partial -const BaseMoreSettingsDialog = ({ +const BaseMobileSettingsDialog = ({ children, canComment, toggleComment, appliedCampaign, selectedStage, editCampaign, + indented, + toggleIndent, ...props -}: MoreSettingsDialogProps) => { +}: MobileSettingsDialogProps) => { + const intl = useIntl() const { show, openDialog, closeDialog } = useDialogSwitch(true) const toggleResponseProps: ToggleResponseProps = { @@ -56,6 +61,7 @@ const BaseMoreSettingsDialog = ({ /> + {/* campaign */} {appliedCampaign && editCampaign && (

@@ -72,12 +78,31 @@ const BaseMoreSettingsDialog = ({

)} + {/* indent */} +
+

+ +

+ + toggleIndent(!indented)} + /> +
+ + {/* response */}
+ {/* more settings */}
- +
@@ -87,10 +112,10 @@ const BaseMoreSettingsDialog = ({ ) } -const MoreSettingsDialog = (props: MoreSettingsDialogProps) => ( - }> +const MobileSettingsDialog = (props: MobileSettingsDialogProps) => ( + }> {({ openDialog }) => <>{props.children({ openDialog })}} ) -export default MoreSettingsDialog +export default MobileSettingsDialog diff --git a/src/components/Editor/BottomBar/MoreSettingsDialog/styles.module.css b/src/components/Editor/BottomBar/MobileSettingsDialog/styles.module.css similarity index 57% rename from src/components/Editor/BottomBar/MoreSettingsDialog/styles.module.css rename to src/components/Editor/BottomBar/MobileSettingsDialog/styles.module.css index fad79cd37e..13b883aa6b 100644 --- a/src/components/Editor/BottomBar/MoreSettingsDialog/styles.module.css +++ b/src/components/Editor/BottomBar/MobileSettingsDialog/styles.module.css @@ -1,5 +1,6 @@ .campaign, -.response { +.response, +.indent { padding: var(--sp16); } @@ -11,3 +12,11 @@ .access { padding: var(--sp16); } + +.indent { + @mixin flex-center-space-between; + + & .title { + padding-bottom: 0; + } +} diff --git a/src/components/Editor/BottomBar/index.tsx b/src/components/Editor/BottomBar/index.tsx index bcf7393930..2d1e24f0f5 100644 --- a/src/components/Editor/BottomBar/index.tsx +++ b/src/components/Editor/BottomBar/index.tsx @@ -13,11 +13,11 @@ import { Translate, } from '~/components' import { + MoreSettingsProps, SetCollectionProps, SetCoverProps, SetResponseProps, SetTagsProps, - ToggleAccessProps, ToggleResponseProps, } from '~/components/Editor' import { SearchSelectNode } from '~/components/Forms/SearchSelectForm' @@ -30,8 +30,9 @@ import { import ArticleCustomStagingArea from '../ArticleCustomStagingArea' import { SelectCampaignProps } from '../SelectCampaign' import SetCover from '../SetCover' +import { SidebarIndentProps } from '../Sidebar/Indent' import TagCustomStagingArea from '../TagCustomStagingArea' -import MoreSettingsDialog from './MoreSettingsDialog' +import MobileSettingsDialog from './MobileSettingsDialog' import styles from './styles.module.css' export type BottomBarProps = { @@ -41,8 +42,9 @@ export type BottomBarProps = { SetCollectionProps & SetTagsProps & SetResponseProps & - ToggleAccessProps & - Partial + MoreSettingsProps & + Partial & + SidebarIndentProps /** * Editor toolbar that fixed on bottom to edit cover, tags and collection, @@ -94,6 +96,10 @@ const BottomBar: React.FC = ({ selectedStage, editCampaign, + indented, + toggleIndent, + indentSaving, + saving, disabled, }) => { @@ -113,8 +119,9 @@ const BottomBar: React.FC = ({ entityType, coverSaving, } - const settingsProps: ToggleAccessProps & + const settingsProps: MoreSettingsProps & ToggleResponseProps & + SidebarIndentProps & Partial = { circle, accessType, @@ -144,6 +151,10 @@ const BottomBar: React.FC = ({ appliedCampaign, selectedStage, editCampaign, + + indented, + toggleIndent, + indentSaving, } return ( @@ -253,8 +264,8 @@ const BottomBar: React.FC = ({ )} - {/* Campaign & Circle & License & Support Feedback & ISCN & canComment */} - + {/* Campaign, Indent, Comment, Circle, License, Support Feedback, ISCN */} + {({ openDialog }) => ( )} - + diff --git a/src/components/Editor/ToggleAccess/SelectLicense/About/index.tsx b/src/components/Editor/MoreSettings/SelectLicense/About/index.tsx similarity index 100% rename from src/components/Editor/ToggleAccess/SelectLicense/About/index.tsx rename to src/components/Editor/MoreSettings/SelectLicense/About/index.tsx diff --git a/src/components/Editor/ToggleAccess/SelectLicense/About/styles.module.css b/src/components/Editor/MoreSettings/SelectLicense/About/styles.module.css similarity index 100% rename from src/components/Editor/ToggleAccess/SelectLicense/About/styles.module.css rename to src/components/Editor/MoreSettings/SelectLicense/About/styles.module.css diff --git a/src/components/Editor/ToggleAccess/SelectLicense/index.tsx b/src/components/Editor/MoreSettings/SelectLicense/index.tsx similarity index 100% rename from src/components/Editor/ToggleAccess/SelectLicense/index.tsx rename to src/components/Editor/MoreSettings/SelectLicense/index.tsx diff --git a/src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx b/src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx similarity index 98% rename from src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx rename to src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx index 8ea6436bb6..a5a186dd6d 100644 --- a/src/components/Editor/ToggleAccess/SupportSettingDialog/Content.tsx +++ b/src/components/Editor/MoreSettings/SupportSettingDialog/Content.tsx @@ -216,8 +216,8 @@ const SupportSettingDialogContent: React.FC = ({ diff --git a/src/components/Editor/ToggleAccess/SupportSettingDialog/SupportPreview.tsx b/src/components/Editor/MoreSettings/SupportSettingDialog/SupportPreview.tsx similarity index 100% rename from src/components/Editor/ToggleAccess/SupportSettingDialog/SupportPreview.tsx rename to src/components/Editor/MoreSettings/SupportSettingDialog/SupportPreview.tsx diff --git a/src/components/Editor/ToggleAccess/SupportSettingDialog/Tab.tsx b/src/components/Editor/MoreSettings/SupportSettingDialog/Tab.tsx similarity index 100% rename from src/components/Editor/ToggleAccess/SupportSettingDialog/Tab.tsx rename to src/components/Editor/MoreSettings/SupportSettingDialog/Tab.tsx diff --git a/src/components/Editor/ToggleAccess/SupportSettingDialog/index.tsx b/src/components/Editor/MoreSettings/SupportSettingDialog/index.tsx similarity index 100% rename from src/components/Editor/ToggleAccess/SupportSettingDialog/index.tsx rename to src/components/Editor/MoreSettings/SupportSettingDialog/index.tsx diff --git a/src/components/Editor/ToggleAccess/SupportSettingDialog/styles.module.css b/src/components/Editor/MoreSettings/SupportSettingDialog/styles.module.css similarity index 100% rename from src/components/Editor/ToggleAccess/SupportSettingDialog/styles.module.css rename to src/components/Editor/MoreSettings/SupportSettingDialog/styles.module.css diff --git a/src/components/Editor/ToggleAccess/index.tsx b/src/components/Editor/MoreSettings/index.tsx similarity index 97% rename from src/components/Editor/ToggleAccess/index.tsx rename to src/components/Editor/MoreSettings/index.tsx index 2c89a7bede..b8af591bd1 100644 --- a/src/components/Editor/ToggleAccess/index.tsx +++ b/src/components/Editor/MoreSettings/index.tsx @@ -17,7 +17,7 @@ import ListItem from '../ListItem' import SelectLicense from './SelectLicense' import styles from './styles.module.css' -export type ToggleAccessProps = { +export type MoreSettingsProps = { circle?: DigestRichCirclePublicFragment | null accessType: ArticleAccessType license: ArticleLicenseType @@ -55,7 +55,7 @@ export type ToggleAccessProps = { theme?: 'sidebar' | 'bottomBar' } -const ToggleAccess: React.FC = ({ +const MoreSettings: React.FC = ({ circle, license, @@ -231,8 +231,7 @@ const ToggleAccess: React.FC = ({

@@ -284,4 +283,4 @@ const ToggleAccess: React.FC = ({ ) } -export default ToggleAccess +export default MoreSettings diff --git a/src/components/Editor/ToggleAccess/styles.module.css b/src/components/Editor/MoreSettings/styles.module.css similarity index 100% rename from src/components/Editor/ToggleAccess/styles.module.css rename to src/components/Editor/MoreSettings/styles.module.css diff --git a/src/components/Editor/SettingsDialog/List/index.tsx b/src/components/Editor/SettingsDialog/List/index.tsx index da4fe75eb5..4fad29f003 100644 --- a/src/components/Editor/SettingsDialog/List/index.tsx +++ b/src/components/Editor/SettingsDialog/List/index.tsx @@ -4,9 +4,9 @@ import { Dialog } from '~/components' import { SetPublishISCNProps } from '~/components/Editor' import ListItem from '../../ListItem' +import MoreSettings, { MoreSettingsProps } from '../../MoreSettings' import SelectCampaign, { SelectCampaignProps } from '../../SelectCampaign' import { Step } from '../../SettingsDialog' -import ToggleAccess, { ToggleAccessProps } from '../../ToggleAccess' import ToggleResponse, { ToggleResponseProps } from '../../ToggleResponse' import styles from './styles.module.css' @@ -31,7 +31,7 @@ export type SettingsListDialogProps = { tagsCount: number } & SettingsListDialogButtons & ToggleResponseProps & - ToggleAccessProps & + MoreSettingsProps & SetPublishISCNProps & Partial @@ -172,7 +172,7 @@ const SettingsList = ({ - + diff --git a/src/components/Editor/SettingsDialog/index.tsx b/src/components/Editor/SettingsDialog/index.tsx index 4b11236725..5b3b8ae517 100644 --- a/src/components/Editor/SettingsDialog/index.tsx +++ b/src/components/Editor/SettingsDialog/index.tsx @@ -3,12 +3,12 @@ import { FormattedMessage } from 'react-intl' import { Dialog, SpinnerBlock, useDialogSwitch, useStep } from '~/components' import { + MoreSettingsProps, SetCollectionProps, SetCoverProps, SetPublishISCNProps, SetTagsProps, SetVersionDescriptionProps, - ToggleAccessProps, ToggleResponseProps, } from '~/components/Editor' import { SearchSelectNode } from '~/components/Forms/SearchSelectForm' @@ -47,7 +47,7 @@ export type EditorSettingsDialogProps = { } & SetCoverProps & SetCollectionProps & SetTagsProps & - ToggleAccessProps & + MoreSettingsProps & ToggleResponseProps & SetPublishISCNProps & SettingsListDialogButtons & @@ -64,7 +64,7 @@ const DynamicSetCover = dynamic(() => import('../SetCover'), { }) const DynamicSetSupportFeedback = dynamic( - () => import('~/components/Editor/ToggleAccess/SupportSettingDialog/Content'), + () => import('~/components/Editor/MoreSettings/SupportSettingDialog/Content'), { loading: () => } ) @@ -160,7 +160,7 @@ const BaseEditorSettingsDialog = ({ entityType, coverSaving, } - const accessProps: ToggleAccessProps = { + const accessProps: MoreSettingsProps = { circle, editAccess, accessSaving, diff --git a/src/components/Editor/Sidebar/Box/index.tsx b/src/components/Editor/Sidebar/Box/index.tsx index 1cf268ce70..5938458712 100644 --- a/src/components/Editor/Sidebar/Box/index.tsx +++ b/src/components/Editor/Sidebar/Box/index.tsx @@ -11,6 +11,7 @@ interface BoxProps { subtitle?: React.ReactNode onClick?: () => any disabled?: boolean + rightButton?: React.ReactNode footerSpacing?: boolean borderColor?: 'freeWriteBlue' } @@ -21,6 +22,7 @@ const Box: React.FC> = ({ subtitle, onClick, disabled, + rightButton, footerSpacing = true, borderColor, children, @@ -39,7 +41,9 @@ const Box: React.FC> = ({ {title} - {onClick && ( + {rightButton} + + {!rightButton && onClick && (