mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-10 12:37:16 +02:00
mobile: display monograph view count
Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
This commit is contained in:
@@ -168,6 +168,14 @@ const PublishNoteSheet = ({
|
||||
setPublishLoading(false);
|
||||
};
|
||||
|
||||
const analytics = useAsync(async () => {
|
||||
if (!isFeatureAvailable?.isAllowed || !monograph) {
|
||||
return { totalViews: 0 };
|
||||
}
|
||||
|
||||
return await db.monographs.analytics(monograph.id);
|
||||
}, [monograph?.id, isFeatureAvailable?.isAllowed]);
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
@@ -396,6 +404,10 @@ const PublishNoteSheet = ({
|
||||
}}
|
||||
>
|
||||
<Paragraph size={AppFontSize.sm}>{strings.views()}</Paragraph>
|
||||
|
||||
<Paragraph size={AppFontSize.sm}>
|
||||
{analytics.result?.totalViews}
|
||||
</Paragraph>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user