Skip to content

Commit

Permalink
Merge pull request #119 from dappforce/fix-stats-text
Browse files Browse the repository at this point in the history
Fix texts for total users and active users
  • Loading branch information
olehmell authored Aug 7, 2023
2 parents fd4b827 + 0ba881e commit bc77910
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/statistics/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export function InnerStatistics(props: FormProps) {
}

const retentionOpt = [
{ key: 'activeUsersTotalCountWithOnePost', label: 'Total Users', minPosts: 1 },
{ key: 'activeUsersTotalCountWithThreePost', label: 'Active Users ', minPosts: 3 },
{ key: 'userRetentionCount', label: 'Retained users', minPosts: 2 },
{ key: 'activeUsersTotalCountWithOnePost', label: 'Total Users', minPosts: 1, periodText: 'per period' },
{ key: 'activeUsersTotalCountWithThreePost', label: 'Active Users ', minPosts: 3, periodText: 'per period' },
{ key: 'userRetentionCount', label: 'Retained users', minPosts: 2, periodText: 'on different days' },
]

type RetentionData = {
Expand Down Expand Up @@ -182,7 +182,7 @@ const RetentionStats = ({ period }: RetentionStatsProps) => {
load()
}, [period])

const retentionStats = retentionOpt.map(({ key, label, minPosts = 0 }) => {
const retentionStats = retentionOpt.map(({ key, label, minPosts = 0, periodText }) => {
const value = retentionData ? retentionData[key as keyof RetentionData] : 0

return (
Expand All @@ -191,7 +191,7 @@ const RetentionStats = ({ period }: RetentionStatsProps) => {
<div className={style.DfRetentionStatsLabel}>{label}</div>
<div className={style.DfRetentionStatsValue}>{value}</div>
<Divider className='my-2' />
<div>{pluralize({ count: minPosts, singularText: 'action' })} on different days</div>
<div>{pluralize({ count: minPosts, singularText: 'action' })} {periodText}</div>
</div>
</Card>
)
Expand Down

0 comments on commit bc77910

Please sign in to comment.