Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9f474dd
chore: add skeleton to staking page
iamonuwa Nov 6, 2025
41edf74
chore: add changelog
iamonuwa Nov 6, 2025
42f4ec2
Merge branch 'release/hub' into add-loading-to-staking
iamonuwa Nov 6, 2025
0fc8835
fix(release): scope remark linting to content directory only
JulesFiliot Nov 7, 2025
0f43dee
Rename 'Mobile' to 'New mobile' in routes (#845)
felicio Nov 7, 2025
2f06902
refactor: clean up imports and improve vault locking logic
iamonuwa Nov 9, 2025
8250815
Merge branch 'release/hub', remote-tracking branch 'origin' into add-…
iamonuwa Nov 9, 2025
c7f8b9b
Fix vercel comments (#853)
iamonuwa Nov 14, 2025
2cff15b
add withdraw (#813)
jkbktl Nov 10, 2025
237d916
feat(layout): add Umami analytics script to RootLayout component
jinhojang6 Nov 11, 2025
85e67b5
fix(layout): update Umami analytics script domains in RootLayout comp…
jinhojang6 Nov 11, 2025
ce4c7ec
u
felicio Nov 11, 2025
4e00b6d
update max amount
jkbktl Nov 11, 2025
f85e656
fix testnet tag and letter-spacing for text-13 class
jkbktl Nov 11, 2025
824e413
fix label for app
jkbktl Nov 13, 2025
e6b6530
chore: point learn more to https://docs.status.network/tokenomics/snt…
iamonuwa Nov 14, 2025
1b32b4f
chore: refactor stake amount input properly
iamonuwa Nov 14, 2025
c751fd7
chore: keep stake-amount-input dry
iamonuwa Nov 14, 2025
a7325e1
Merge branch 'release/hub' into add-loading-to-staking
iamonuwa Nov 14, 2025
d2d4ac8
fix: fix emergency withdraw mode check
iamonuwa Nov 14, 2025
7905e2c
chore: replace px with tailwind measurement
iamonuwa Nov 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/big-tables-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hub': patch
---

update status wallet discovery
2 changes: 1 addition & 1 deletion .changeset/pretty-mugs-heal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"status.app": patch
'status.app': patch
---

reference new mobile app
5 changes: 5 additions & 0 deletions .changeset/slimy-ears-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hub': patch
---

add skeleton to staking page
2 changes: 1 addition & 1 deletion .changeset/three-snakes-grab.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"status.app": patch
'status.app': patch
---

Rename 'Mobile' to 'New mobile' in routes
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { InfoIcon } from '@status-im/icons/16'
import { formatUnits } from 'viem'

import { LaunchIcon } from '~components/icons'
import { SNT_TOKEN } from '~constants/index'
import { useMultiplierPointsBalance } from '~hooks/useMultiplierPoints'
import { useStakingVaults } from '~hooks/useStakingVaults'
import { useWeightedBoost } from '~hooks/useWeightedBoost'
import { formatSNT } from '~utils/currency'

import { SNT_TOKEN } from '../../_constants'

export const CompoundStatusContent = () => {
const { data: vaults } = useStakingVaults()
const weightedBoost = useWeightedBoost(vaults)
Expand Down
8 changes: 8 additions & 0 deletions apps/hub/src/app/_components/stake/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export * from './action-status-dialog'
export * from './compound-status-content'
export * from './promo-modal'
export * from './stake-amount-input'
export * from './stake-faucet-card'
export * from './stake-form'
export * from './stake-total-staked-card'
export * from './stake-weighted-boost-card'
85 changes: 85 additions & 0 deletions apps/hub/src/app/_components/stake/stake-amount-input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { Skeleton } from '@status-im/components'
import { type UseFormRegister } from 'react-hook-form'

import { SNTIcon } from '~components/icons'
import { formatCurrency, formatSNT } from '~utils/currency'

type StakeAmountInputProps = {
balance?: bigint
amountInUSD?: number
onMaxClick: () => void
register: UseFormRegister<any>
isConnected: boolean
isLoading?: boolean
}

const StakeAmountInput = ({
balance,
amountInUSD = 0,
onMaxClick,
register,
isConnected,
isLoading = false,
}: StakeAmountInputProps) => {
const showBottomRow = isLoading || isConnected
const containerClassName = !isConnected && !isLoading ? 'opacity-[40%]' : ''

return (
<div className={`space-y-2 ${containerClassName}`}>
<label
htmlFor="stake-amount"
className="block text-13 font-medium text-neutral-50"
>
Amount to stake
</label>
<div className="rounded-16 border border-neutral-20 bg-white-100 px-4 py-3">
<div className="flex items-center justify-between">
{isConnected ? (
<input
id="stake-amount"
type="text"
inputMode="decimal"
{...register('amount')}
placeholder="0"
className="h-[38px] w-full border-none bg-transparent text-27 font-semibold text-neutral-100 outline-none placeholder:text-neutral-40"
/>
) : (
<span className="text-27 font-semibold text-neutral-40">0</span>
)}
<div className="flex items-center gap-1">
<SNTIcon />
<span className="text-19 font-semibold text-neutral-80">SNT</span>
</div>
</div>

{showBottomRow && (
<>
<div className="-mx-4 my-3 h-px w-[calc(100%+32px)] bg-neutral-10" />
<div className="flex items-center justify-between text-13 font-500 text-neutral-50">
{isLoading ? (
<>
<Skeleton height={18} width={100} className="rounded-6" />
<Skeleton height={18} width={100} className="rounded-6" />
</>
) : (
<>
<span>{formatCurrency(amountInUSD)}</span>
<button
type="button"
onClick={onMaxClick}
className="uppercase text-neutral-100"
>
{`MAX ${formatSNT(balance ?? 0)} SNT`}
</button>
</>
)}
</div>
</>
)}
</div>
</div>
)
}

export { StakeAmountInput }
export type { StakeAmountInputProps }
134 changes: 134 additions & 0 deletions apps/hub/src/app/_components/stake/stake-faucet-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
'use client'

import { useMemo } from 'react'

import { Skeleton } from '@status-im/components'
import { PlaceholderIcon } from '@status-im/icons/20'
import { Button } from '@status-im/status-network/components'
import { useSIWE } from 'connectkit'
import Image from 'next/image'
import { useAccount } from 'wagmi'

import { TIME_CONSTANTS } from '~constants/staking'
import { useFaucetMutation, useFaucetQuery } from '~hooks/useFaucet'
import { formatSNT } from '~utils/currency'

const FaucetCard = () => {
const { data: faucetData, isLoading } = useFaucetQuery()
const { isSignedIn, isLoading: isLoadingSIWE } = useSIWE()
const { mutate: claimTokens, isPending: isClaimingTokens } =
useFaucetMutation()
const { isConnected, isConnecting } = useAccount()

const hasReachedDailyLimit = useMemo(() => {
if (!faucetData) return false

const currentTimestamp = BigInt(
Math.floor(Date.now() / TIME_CONSTANTS.MILLISECONDS_PER_SECOND)
)
const isWithinResetWindow = faucetData.accountResetTime > currentTimestamp
const hasExceededLimit =
faucetData.accountDailyRequests >= faucetData.dailyLimit

return hasExceededLimit && isWithinResetWindow
}, [faucetData])

if (isLoading || isConnecting || isLoadingSIWE) {
return (
<div className="flex flex-col gap-8 rounded-32 border border-neutral-10 bg-white-100 p-6 shadow-2 md:flex-row md:items-center md:justify-between md:p-8">
<div className="flex items-start gap-4 md:gap-6">
<div className="relative h-[88px]">
<Image
width="103"
height="174"
src="/piggy-bank.png"
alt="Piggy Bank"
className="-mt-12"
/>
</div>

<div className="space-y-3">
<div>
<p className="text-19 font-500">Free Testnet SNT faucet</p>
</div>

<div className="flex flex-wrap gap-4 md:gap-6">
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Daily limit</p>
<Skeleton height={18} width={80} className="rounded-6" />
</div>
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Used today</p>
<Skeleton height={18} width={80} className="rounded-6" />
</div>
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Available</p>
<Skeleton height={18} width={80} className="rounded-6" />
</div>
</div>
</div>
</div>

<Button className="self-end" disabled>
<PlaceholderIcon className="text-blur-white/70" />
Claim testnet SNT
</Button>
</div>
)
}

return (
<div className="flex flex-col gap-8 rounded-32 border border-neutral-10 bg-white-100 p-6 shadow-2 md:flex-row md:items-center md:justify-between md:p-8">
<div className="flex items-start gap-4 md:gap-6">
<div className="relative h-[88px]">
<Image
width="103"
height="174"
src="/piggy-bank.png"
alt="Piggy Bank"
className="-mt-12"
/>
</div>

<div className="space-y-3">
<div>
<p className="text-19 font-500">Free Testnet SNT faucet</p>
</div>

<div className="flex flex-wrap gap-4 md:gap-6">
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Daily limit</p>
<span>{formatSNT(faucetData?.dailyLimit ?? 0)} SNT</span>
</div>
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Used today</p>
<span>{formatSNT(faucetData?.actualUsedToday ?? 0)} SNT</span>
</div>
<div className="min-w-[128px] space-y-1 text-13 font-500">
<p className="text-neutral-50">Available</p>
<span>{formatSNT(faucetData?.remainingAmount ?? 0)} SNT</span>
</div>
</div>
</div>
</div>

<Button
className="self-end"
disabled={
!isConnected ||
hasReachedDailyLimit ||
isClaimingTokens ||
!isSignedIn
}
onClick={() =>
claimTokens({ amount: faucetData?.remainingAmount ?? BigInt(0) })
}
>
<PlaceholderIcon className="text-blur-white/70" />
{isClaimingTokens ? 'Claiming...' : 'Claim testnet SNT'}
</Button>
</div>
)
}

export { FaucetCard }
Loading
Loading