Skip to content

Commit

Permalink
chore: add first person perspective wording
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Feb 2, 2024
1 parent b83027e commit b7a9e12
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions src/components/leaderboard/ProgressModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,43 @@ const statusClassName: Record<DisplayedStatus, string> = {

const contentMap: Record<
'lastWeek' | 'yesterday',
Record<DisplayedStatus, { title: string; subtitle: string }>
Record<
DisplayedStatus,
{ title: string; subtitle: (withFirstPersonPerspective?: boolean) => string }
>
> = {
lastWeek: {
full: {
title: 'Week Striker',
subtitle: 'You dominated last week, and maximized your rewards every day! Impressive!',
subtitle: firstPerson =>
`${firstPerson ? 'I' : 'You'} dominated last week, and maximized ${
firstPerson ? 'my' : 'your'
} rewards every day! Impressive!`,
},
half: {
title: 'Halfway Hero',
subtitle:
"You had some good activity last week, but you still gave up some rewards. Let's see just a little more this week!",
subtitle: firstPerson =>
`${firstPerson ? 'I' : 'You'} had some good activity last week, but ${
firstPerson ? 'I' : 'you'
} still gave up some rewards. Let's see just a little more this week!`,
},
},
yesterday: {
full: {
title: 'Hustler',
subtitle:
'Incredible work yesterday! You completed every task and went above and beyond. Your energy is unmatched!',
subtitle: firstPerson =>
`Incredible work yesterday! ${
firstPerson ? 'I' : 'You'
} completed every task and went above and beyond. ${
firstPerson ? 'My' : 'Your'
} energy is unmatched!`,
},
half: {
title: 'Cherry Picker',
subtitle:
'Good effort yesterday, but you missed out on maximum rewards. Make sure to like at least 10 posts today!',
subtitle: firstPerson =>
`Good effort yesterday, but ${
firstPerson ? 'I' : 'You'
} missed out on maximum rewards. Make sure to like at least 10 posts today!`,
},
},
}
Expand Down Expand Up @@ -124,15 +138,21 @@ function InnerProgressModal() {
style={{ width: '400px', display: 'none' }}
>
<div className='ant-modal-content p-3 pb-4'>
<ProgressPanel />
<ProgressPanel withFirstPersonPerspective />
</div>
</div>
</CustomModal>
</>
)
}

function ProgressPanel({ withButtons }: { withButtons?: boolean }) {
function ProgressPanel({
withButtons,
withFirstPersonPerspective,
}: {
withButtons?: boolean
withFirstPersonPerspective?: boolean
}) {
const { ipfs } = useSubsocialApi()

const myAddress = useMyAddress() ?? ''
Expand Down Expand Up @@ -221,7 +241,9 @@ function ProgressPanel({ withButtons }: { withButtons?: boolean }) {
/>
</div>
<span className='text-center FontLarge FontWeightBold mb-2'>{usedContent.title}</span>
<p className='text-center ColorSlate mb-0'>{usedContent.subtitle}</p>
<p className='text-center ColorSlate mb-0'>
{usedContent.subtitle(withFirstPersonPerspective)}
</p>
</div>
<div className='d-flex w-100 GapSmall'>
<RewardCard
Expand Down

0 comments on commit b7a9e12

Please sign in to comment.