-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
218 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { SolidButton } from 'src/components/buttons/SolidButton'; | ||
import { Card } from 'src/components/layout/Card'; | ||
import { Section } from 'src/components/layout/Section'; | ||
|
||
export default function Index() { | ||
return ( | ||
<div className="space-y-8"> | ||
<HeroSection /> | ||
<ListSection /> | ||
</div> | ||
); | ||
} | ||
|
||
function HeroSection() { | ||
return ( | ||
<Section className="bg-purple-500 text-white"> | ||
<div className="my-10 flex items-center justify-between gap-20 lg:gap-x-40 xl:gap-x-80"> | ||
<div className="flex w-80 flex-col space-y-6"> | ||
<h1 className="font-serif text-4xl">Discover Validators</h1> | ||
<p>Stake your CELO with validators to start earning rewards immediately.</p> | ||
<SolidButton>{`Stake and earn up to 6%`}</SolidButton> | ||
</div> | ||
<div className="hidden grid-cols-2 grid-rows-2 gap-10 border border-white/20 p-6 md:grid"> | ||
<HeroStat label="Staking APY" value="6%" /> | ||
<HeroStat label="Validators Groups" value="100" /> | ||
<HeroStat label="Elected Minimum Votes" value="12345" /> | ||
<HeroStat label="Total Staked CELO" value="1234567" /> | ||
</div> | ||
</div> | ||
</Section> | ||
); | ||
} | ||
|
||
function HeroStat({ label, value }: { label: string; value: string }) { | ||
return ( | ||
<div className="flex flex-col"> | ||
<label>{label}</label> | ||
<div className="mt-1 font-serif text-3xl">{value}</div> | ||
</div> | ||
); | ||
} | ||
|
||
function ListSection() { | ||
return ( | ||
<Section> | ||
<Card>TODO</Card> | ||
</Section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ButtonHTMLAttributes, PropsWithChildren } from 'react'; | ||
|
||
export function OutlineButton({ | ||
children, | ||
className, | ||
...props | ||
}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>) { | ||
return ( | ||
<button | ||
className={`border-taupe-300 btn btn-outline h-fit min-h-fit rounded-full px-4 py-2.5 font-semibold text-black hover:bg-black/5 ${className}`} | ||
{...props} | ||
> | ||
{children} | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { PropsWithChildren } from 'react'; | ||
|
||
export function Card({ className, children }: PropsWithChildren<{ className?: string }>) { | ||
return ( | ||
<div className={`card rounded-none bg-white shadow ${className}`}> | ||
<div className="card-body">{children}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { PropsWithChildren } from 'react'; | ||
|
||
export function Section({ className, children }: PropsWithChildren<{ className?: string }>) { | ||
return ( | ||
<section className={`flex w-full grow items-center ${className}`}> | ||
<div className="mx-auto max-w-screen-xl px-2 sm:px-4">{children}</div> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import BigNumber from 'bignumber.js'; | ||
import { CELO, TokenId, getTokenByAddress, getTokenById } from 'src/config/tokens'; | ||
import { fromWei } from 'src/utils/amount'; | ||
|
||
const NUMBER_FORMAT = { | ||
decimalSeparator: '.', | ||
groupSeparator: ',', | ||
groupSize: 3, | ||
}; | ||
|
||
export function Amount({ | ||
value, | ||
valueWei, | ||
tokenId, | ||
tokenAddress, | ||
className, | ||
}: { | ||
value?: BigNumber.Value | bigint; | ||
valueWei?: string; | ||
tokenId?: TokenId; | ||
tokenAddress?: Address; | ||
className?: string; | ||
}) { | ||
if (valueWei) { | ||
value = fromWei(valueWei); | ||
} | ||
const valueFormatted = BigNumber(value?.toString() || '0').toFormat(NUMBER_FORMAT); | ||
|
||
const token = | ||
(tokenId ? getTokenById(tokenId) : tokenAddress ? getTokenByAddress(tokenAddress) : null) || | ||
CELO; | ||
|
||
return <span className={`font-serif ${className}`}>{`${valueFormatted} ${token.symbol}`}</span>; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters