Skip to content

Commit 0114221

Browse files
authored
feat(web): Post Launch Stake QA (#970)
1 parent 2e6feea commit 0114221

File tree

4 files changed

+67
-11
lines changed

4 files changed

+67
-11
lines changed

apps/web/app/(apps)/migrate/_components/migrate-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const MigrateButton = () => {
184184
onClick={handleActivateStellarAccount}
185185
disabled={isActivatingStellarAccount}
186186
>
187-
{isActivatingStellarAccount ? 'Activating Stellar Account' : 'Activate Stellar Account'}
187+
{isActivatingStellarAccount ? 'Activating Stellar' : 'Activate Stellar'}
188188
{isActivatingStellarAccount && <Loader2 className="w-4 h-4 animate-spin" />}
189189
</Button>
190190
) : direction.to === STELLAR_MAINNET_CHAIN_ID && stellarTrustlineValidation?.ok === false && !hasTrustline ? (

apps/web/app/(apps)/stake/_components/stake-input-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export function StakeInputPanel(): React.JSX.Element {
231231
onClick={handleActivateStellarAccount}
232232
disabled={isActivatingStellarAccount}
233233
>
234-
{isActivatingStellarAccount ? 'Activating Stellar Account' : 'Activate Stellar Account'}
234+
{isActivatingStellarAccount ? 'Activating Stellar' : 'Activate Stellar'}
235235
{isActivatingStellarAccount && <Loader2 className="w-4 h-4 animate-spin ml-2" />}
236236
</Button>
237237
) : isStellarChain &&
@@ -275,7 +275,7 @@ export function StakeInputPanel(): React.JSX.Element {
275275
onClick={handleActivateStellarAccount}
276276
disabled={isActivatingStellarAccount}
277277
>
278-
{isActivatingStellarAccount ? 'Activating Stellar Account' : 'Activate Stellar Account'}
278+
{isActivatingStellarAccount ? 'Activating Stellar' : 'Activate Stellar'}
279279
{isActivatingStellarAccount && <Loader2 className="w-4 h-4 animate-spin ml-2" />}
280280
</Button>
281281
) : isStellarChain &&

apps/web/app/(apps)/stake/_components/stake-stats-card.tsx

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import Image from 'next/image';
33
import { Info } from 'lucide-react';
44
import { useStakeState, useStakeActions } from '../_stores/stake-store-provider';
55
import { formatCompactNumber, formatTokenAmount } from '@/lib/utils';
6-
import { STAKING_APR, STAKING_NOW_HOLDERS } from './constants';
6+
import { STAKING_APR } from './constants';
77
import LoadingThreeDotsJumping from '@/components/shared/loading-three-dots-jumping';
88
import { useStakingConfig } from '@sodax/dapp-kit';
99
import { UnstakeModeToggle } from './unstake-mode-toggle';
1010
import { STAKE_MODE } from '../_stores/stake-store';
1111
import { Loader2 } from 'lucide-react';
1212
import { useStakeVaultApy } from '@/hooks/useStakeVaultApy';
13+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
1314

1415
export function StakeStatsCard(): React.JSX.Element {
1516
const {
@@ -61,7 +62,20 @@ export function StakeStatsCard(): React.JSX.Element {
6162
<div className="justify-center text-clay text-(length:--body-small) leading-4">
6263
~{formatTokenAmount(totalUserXSodaValue, 18)} SODA
6364
</div>
64-
<Info className="w-4 h-4 text-clay-light" />
65+
<Tooltip>
66+
<TooltipTrigger asChild>
67+
<button type="button">
68+
<Info className="w-4 h-4 text-clay-light" />{' '}
69+
</button>
70+
</TooltipTrigger>
71+
<TooltipContent
72+
side="top"
73+
sideOffset={10}
74+
className="bg-white px-4 py-2 text-espresso rounded-full text-(length:--body-small)"
75+
>
76+
Approximate equivalent value in SODA{' '}
77+
</TooltipContent>
78+
</Tooltip>
6579
{userXSodaBalance > 0n && <LoadingThreeDotsJumping />}
6680
</div>
6781
</div>
@@ -70,7 +84,20 @@ export function StakeStatsCard(): React.JSX.Element {
7084
<div className="justify-center text-espresso text-(length:--body-super-comfortable) font-bold leading-5">
7185
{displayedApy.toFixed(2)}% APY
7286
</div>
73-
<Info className="w-4 h-4 text-clay-light" />
87+
<Tooltip>
88+
<TooltipTrigger asChild>
89+
<button type="button">
90+
<Info className="w-4 h-4 text-clay-light" />{' '}
91+
</button>
92+
</TooltipTrigger>
93+
<TooltipContent
94+
side="top"
95+
sideOffset={10}
96+
className="bg-white px-4 py-2 text-espresso rounded-full text-(length:--body-small)"
97+
>
98+
APY will change over time{' '}
99+
</TooltipContent>
100+
</Tooltip>{' '}
74101
</div>
75102
<div className="justify-center text-clay text-(length:--body-small) font-normal leading-4">
76103
{formatCompactNumber(formatTokenAmount(stakingInfo?.totalStaked || 0n, 18))} total staked
@@ -92,10 +119,16 @@ export function StakeStatsCard(): React.JSX.Element {
92119

93120
<div className="w-full flex justify-between items-center">
94121
<div className="flex flex-col gap-1">
95-
<div className="justify-center text-clay text-[9px] font-medium uppercase leading-3">STAKING NOW</div>
122+
<div className="justify-center text-clay text-[9px] font-medium uppercase leading-3">MAX PENALTY</div>
96123
<div className="flex justify-start items-center gap-1">
97-
<div className="text-espresso text-(length:--body-comfortable) font-bold leading-5">
98-
{STAKING_NOW_HOLDERS}
124+
<div className="text-espresso text-lg font-semibold leading-5">
125+
{isLoadingStakingConfig ? (
126+
<LoadingThreeDotsJumping />
127+
) : stakingConfig ? (
128+
`${Number(stakingConfig.maxPenalty)}%`
129+
) : (
130+
'—'
131+
)}
99132
</div>
100133
</div>
101134
</div>
@@ -105,7 +138,30 @@ export function StakeStatsCard(): React.JSX.Element {
105138
<div className="text-espresso text-(length:--body-comfortable) font-bold leading-5">
106139
{isLoadingStakingConfig ? <LoadingThreeDotsJumping /> : '180 days'}
107140
</div>
108-
{shouldShowUnstakingPeriodInfo ? <Info className="w-4 h-4 text-clay-light" /> : null}
141+
{shouldShowUnstakingPeriodInfo ? (
142+
<Tooltip>
143+
<TooltipTrigger asChild>
144+
<button type="button">
145+
<Info className="w-4 h-4 text-clay-light" />{' '}
146+
</button>
147+
</TooltipTrigger>
148+
<TooltipContent
149+
side="top"
150+
sideOffset={10}
151+
className="bg-white px-4 py-2 text-espresso rounded-full text-(length:--body-small)"
152+
>
153+
<a
154+
href="https://support.sodax.com/en/articles/13918114-how-do-i-unstake-soda-on-sodax-stake"
155+
target="_blank"
156+
rel="noopener noreferrer"
157+
className="text-yellow-dark font-bold"
158+
>
159+
Faster unstaking options
160+
</a>{' '}
161+
available
162+
</TooltipContent>
163+
</Tooltip>
164+
) : null}
109165
</div>
110166
</div>
111167
</div>

apps/web/app/(apps)/swap/_components/swap-review-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default function SwapReviewButton({
127127
onClick={handleActivateStellarAccount}
128128
disabled={isActivatingStellarAccount || isSwapAndSend}
129129
>
130-
{isActivatingStellarAccount ? 'Activating Stellar Account' : 'Activate Stellar Account'}
130+
{isActivatingStellarAccount ? 'Activating Stellar' : 'Activate Stellar'}
131131
{isActivatingStellarAccount && <Loader2 className="w-4 h-4 animate-spin" />}
132132
</Button>
133133
) : outputToken.xChainId === STELLAR_MAINNET_CHAIN_ID &&

0 commit comments

Comments
 (0)