Skip to content

Commit

Permalink
feat: add tooltip + tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Aug 30, 2023
1 parent 80aa00a commit da8d27c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/common/SafeTokenWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const canRedeemSep5Airdrop = (allocation?: Vesting[]): boolean => {
return !sep5Allocation.isRedeemed && !sep5Allocation.isExpired
}

const SEP5_DEADLINE = '27.10.2023 10:00 UTC'

const SafeTokenWidget = () => {
const chainId = useChainId()
const router = useRouter()
Expand All @@ -58,7 +60,9 @@ const SafeTokenWidget = () => {

return (
<Box className={css.buttonContainer}>
<Tooltip title={url ? `Open ${governanceApp?.name}` : ''}>
<Tooltip
title={url ? (canRedeemSep5 ? `New airdrop until ${SEP5_DEADLINE}` : `Open ${governanceApp?.name}`) : ''}
>
<span>
<Track {...OVERVIEW_EVENTS.SAFE_TOKEN_WIDGET}>
<Link href={url || ''} passHref legacyBehavior>
Expand Down Expand Up @@ -90,9 +94,11 @@ const SafeTokenWidget = () => {
</UnreadBadge>
</Typography>
{canRedeemSep5 && (
<Button variant="contained" className={css.redeemButton}>
New allocation
</Button>
<Track {...OVERVIEW_EVENTS.SEP5_ALLOCATION_BUTTON}>
<Button variant="contained" className={css.redeemButton}>
New allocation
</Button>
</Track>
)}
</ButtonBase>
</Link>
Expand Down
4 changes: 4 additions & 0 deletions src/services/analytics/events/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,8 @@ export const OVERVIEW_EVENTS = {
action: 'Open relaying help article',
category: OVERVIEW_CATEGORY,
},
SEP5_ALLOCATION_BUTTON: {
action: 'Click on SEP5 allocation button',
category: OVERVIEW_CATEGORY,
},
}

0 comments on commit da8d27c

Please sign in to comment.