Skip to content

Commit

Permalink
Adds in everything for Overview with exception of Lists -- still uses…
Browse files Browse the repository at this point in the history
… API for userIdentity/Quests (userIdentity can be stripped back but want to ensure the Quests call succeeds). Leaves in previous implementaiton of OverviewAboutHeader to not break build until we do this in the $wallet route as well
  • Loading branch information
jonathanprozzi committed Nov 27, 2024
1 parent a1ffe83 commit 2cd56e3
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 104 deletions.
82 changes: 82 additions & 0 deletions apps/portal/app/components/profile/overview-about-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,87 @@ export const DataAboutHeaderVariants = {
export type OverviewAboutHeaderVariantType =
(typeof DataAboutHeaderVariants)[keyof typeof DataAboutHeaderVariants]

interface OverviewAboutHeaderPropsNew
extends React.HTMLAttributes<HTMLDivElement> {
variant: OverviewAboutHeaderVariantType
atomImage?: string
atomLabel?: string
atomVariant?: 'user' | 'non-user'
totalClaims?: number
totalPositions?: number
totalStake: number
link: string
}

export function OverviewAboutHeaderNew({
variant,
atomImage,
atomLabel,
atomVariant,
totalClaims,
totalPositions,
totalStake,
link,
...props
}: OverviewAboutHeaderPropsNew) {
return (
<div
className="flex flex-col gap-4 w-full p-6 bg-black rounded-xl theme-border max-md:items-center"
{...props}
>
<div className="flex items-center gap-1.5">
<Text
variant="body"
weight="regular"
className="text-secondary-foreground"
>
{variant === 'claims' ? 'Claims about' : 'Conviction in'}
</Text>
<IdentityTag imgSrc={atomImage} variant={atomVariant}>
<Trunctacular value={atomLabel ?? ''} maxStringLength={40} />
</IdentityTag>
</div>
<div className="flex w-full gap-10 max-sm:flex-col max-sm:gap-4">
<div className="flex w-full gap-10 max-sm:justify-center">
<div className="flex flex-col max-md:items-center">
<Text
variant="caption"
weight="regular"
className="text-secondary-foreground"
>
{variant === 'claims' ? 'Claims' : 'Positions'}
</Text>
<Text variant="bodyLarge" weight="medium" className="items-center">
{variant === 'claims' ? totalClaims ?? 0 : totalPositions ?? 0}
</Text>
</div>
<div className="flex flex-col max-md:items-center">
<Text
variant="caption"
weight="regular"
className="text-secondary-foreground"
>
TVL
</Text>
<MonetaryValue value={totalStake} currency="ETH" />
</div>
</div>
<div className="flex flex-col items-end justify-end ml-auto max-sm:w-full max-sm:items-center">
<Link to={link} prefetch="intent">
<Button variant={ButtonVariant.secondary} className="w-max mb-1">
<Icon
name={variant === 'claims' ? IconName.claim : IconName.ethereum}
className="h-4 w-4"
/>{' '}
View All {variant === 'claims' ? 'Claims' : 'Positions'}
</Button>
</Link>
</div>
</div>
</div>
)
}

interface OverviewAboutHeaderProps
extends React.HTMLAttributes<HTMLDivElement> {
variant: OverviewAboutHeaderVariantType
Expand All @@ -32,6 +113,7 @@ interface OverviewAboutHeaderProps
link: string
}

// Legacy component included until we finish migrating
export function OverviewAboutHeader({
variant,
userIdentity,
Expand Down
Loading

0 comments on commit 2cd56e3

Please sign in to comment.