Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-3552 chore(portal): make home system stats clickable #833

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Changes from all commits
Commits
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
34 changes: 27 additions & 7 deletions apps/portal/app/components/home/home-stats-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React from 'react'

import { Separator, Text } from '@0xintuition/1ui'

import { PATHS } from '@consts/paths'
import { Link } from '@remix-run/react'

interface HomeStatsHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
totalIdentities: number
totalClaims: number
Expand All @@ -26,8 +29,16 @@ export function HomeStatsHeader({
{...props}
>
<div className="flex gap-8 max-lg:flex-col max-lg:gap-2">
<StatItem label="Identities" value={totalIdentities} />
<StatItem label="Claims" value={totalClaims} />
<StatItem
label="Identities"
value={totalIdentities}
link={PATHS.EXPLORE_IDENTITIES}
/>
<StatItem
label="Claims"
value={totalClaims}
link={PATHS.EXPLORE_CLAIMS}
/>
{/* <StatItem label="Users" value={totalUsers} /> */}
</div>
<Separator
Expand All @@ -36,8 +47,16 @@ export function HomeStatsHeader({
/>
<div className="flex gap-8 max-lg:flex-col max-lg:gap-2">
{/* {totalStaked && <StatItem label="TVL" value={`${totalStaked} ETH`} />} */}
<StatItem label="Users" value={totalUsers} />
<StatItem label="Signals" value={totalSignals} />
<StatItem
label="Users"
value={totalUsers}
link={`${PATHS.EXPLORE_IDENTITIES}?isUser=true`}
/>
<StatItem
label="Signals"
value={totalSignals}
link={PATHS.GLOBAL_ACTIVITY}
/>
</div>
</div>
)
Expand All @@ -46,11 +65,12 @@ export function HomeStatsHeader({
interface StatItemProps {
label: string
value: string | number
link: string
}

function StatItem({ label, value }: StatItemProps) {
function StatItem({ label, value, link }: StatItemProps) {
return (
<div className="flex flex-col items-start">
<Link to={link} className="flex flex-col items-start">
<Text
variant="caption"
weight="regular"
Expand All @@ -61,6 +81,6 @@ function StatItem({ label, value }: StatItemProps) {
<Text variant="headline" weight="medium">
{value}
</Text>
</div>
</Link>
)
}
Loading