diff --git a/apps/web/src/components/publish-view/index.tsx b/apps/web/src/components/publish-view/index.tsx index f233aca35..eaecd98a4 100644 --- a/apps/web/src/components/publish-view/index.tsx +++ b/apps/web/src/components/publish-view/index.tsx @@ -45,6 +45,7 @@ function PublishView(props: PublishViewProps) { ); const [isPasswordProtected, setIsPasswordProtected] = useState(false); const [selfDestruct, setSelfDestruct] = useState(false); + const [viewCount, setViewCount] = useState(); const [isPublishing, setIsPublishing] = useState(false); const [processingStatus, setProcessingStatus] = useState<{ total?: number; @@ -64,6 +65,7 @@ function PublishView(props: PublishViewProps) { setPublishId(monographId); setIsPasswordProtected(!!monograph.password); setSelfDestruct(!!monograph.selfDestruct); + setViewCount(monograph.viewCount); if (monograph.password) { const password = await db.monographs.decryptPassword( @@ -140,12 +142,38 @@ function PublishView(props: PublishViewProps) { overflow: "hidden" }} > - - {strings.publishedAt()} - + + {strings.publishedAt()} + + {typeof viewCount === "number" && ( + + {strings.views(viewCount)} + + )} + { datePublished: number; selfDestruct: boolean; password?: Cipher<"base64">; + viewCount?: number; } export type Match = { diff --git a/packages/intl/locale/en.po b/packages/intl/locale/en.po index 43a2b8f5d..1d6b9a566 100644 --- a/packages/intl/locale/en.po +++ b/packages/intl/locale/en.po @@ -96,6 +96,10 @@ msgstr "{count, plural, one {1 minute} other {# minutes}}" msgid "{count, plural, one {1 result} other {# results}}" msgstr "{count, plural, one {1 result} other {# results}}" +#: src/strings.ts:2610 +msgid "{count, plural, one {1 view} other {# views}}" +msgstr "{count, plural, one {1 view} other {# views}}" + #: generated/action-confirmations.ts:32 msgid "{count, plural, one {Are you sure you want to delete this attachment?} other {Are you sure you to delete these attachments?}}" msgstr "{count, plural, one {Are you sure you want to delete this attachment?} other {Are you sure you to delete these attachments?}}" diff --git a/packages/intl/locale/pseudo-LOCALE.po b/packages/intl/locale/pseudo-LOCALE.po index 2b257cbea..775af8496 100644 --- a/packages/intl/locale/pseudo-LOCALE.po +++ b/packages/intl/locale/pseudo-LOCALE.po @@ -96,6 +96,10 @@ msgstr "" msgid "{count, plural, one {1 result} other {# results}}" msgstr "" +#: src/strings.ts:2610 +msgid "{count, plural, one {1 view} other {# views}}" +msgstr "" + #: generated/action-confirmations.ts:32 msgid "{count, plural, one {Are you sure you want to delete this attachment?} other {Are you sure you to delete these attachments?}}" msgstr "" diff --git a/packages/intl/src/strings.ts b/packages/intl/src/strings.ts index f9f9e0223..7f0dfb983 100644 --- a/packages/intl/src/strings.ts +++ b/packages/intl/src/strings.ts @@ -2605,5 +2605,10 @@ Use this if changes from other devices are not appearing on this device. This wi clickToDirectlyClaimPromo: () => t`Click here to directly claim the promotion.`, loginToUploadAttachments: () => - t`Login to upload attachments. [Read more](https://help.notesnook.com/faqs/login-to-upload-attachments)` + t`Login to upload attachments. [Read more](https://help.notesnook.com/faqs/login-to-upload-attachments)`, + views: (count: number) => + plural(count, { + one: `1 view`, + other: `# views` + }) };