-
Notifications
You must be signed in to change notification settings - Fork 19
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
14 changed files
with
220 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ArrowLeftIcon } from '@heroicons/react/20/solid' | ||
import Link from 'next/link' | ||
|
||
export default function TokenPageLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<> | ||
<Link | ||
className="text-th-fgd-4 flex items-center space-x-1" | ||
href="/explore" | ||
shallow | ||
> | ||
<ArrowLeftIcon className="h-5 w-5" /> | ||
<span>View all tokens</span> | ||
</Link> | ||
<div className="mt-8">{children}</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
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
import { ReactNode } from 'react' | ||
import Tooltip from '../../shared/Tooltip' | ||
|
||
const KeyValuePairDisplay = ({ | ||
label, | ||
value, | ||
tooltipContent, | ||
}: { | ||
label: string | ||
value: number | string | ReactNode | ||
tooltipContent?: string | ||
}) => { | ||
return ( | ||
<div> | ||
<div className="w-max"> | ||
<Tooltip content={tooltipContent}> | ||
<p | ||
className={`mb-1 leading-tight ${ | ||
tooltipContent ? 'tooltip-underline' : '' | ||
}`} | ||
> | ||
{label} | ||
</p> | ||
</Tooltip> | ||
</div> | ||
<span className="text-3xl font-display text-th-fgd-1">{value}</span> | ||
</div> | ||
) | ||
} | ||
|
||
export default KeyValuePairDisplay |
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,12 @@ | ||
import { Document as RichTextDocument } from '@contentful/rich-text-types' | ||
import RichText from '../../../../contentful/RichText' | ||
|
||
const TokenAbout = ({ content }: { content: RichTextDocument | null }) => { | ||
return ( | ||
<div className="max-w-4xl"> | ||
<RichText document={content} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default TokenAbout |
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 @@ | ||
'use client' | ||
|
||
import { MangoTokenData } from '../../../types/mango' | ||
import { numberCompacter } from '../../../utils/numbers' | ||
import KeyValuePairDisplay from './KeyValuePairDisplay' | ||
|
||
const TokenMangoStats = ({ | ||
mangoData, | ||
}: { | ||
mangoData: MangoTokenData | undefined | ||
}) => { | ||
if (!mangoData) return null | ||
return ( | ||
<div className="grid grid-cols-3 grid-flow-row gap-6"> | ||
<KeyValuePairDisplay | ||
label="Deposit rate" | ||
value={<span className="text-th-up">5.42%</span>} | ||
/> | ||
<KeyValuePairDisplay | ||
label="Borrow rate" | ||
value={<span className="text-th-down">7.33%</span>} | ||
/> | ||
<KeyValuePairDisplay | ||
label="Available" | ||
value={numberCompacter.format(234956688)} | ||
/> | ||
<KeyValuePairDisplay label="Asset weight" value="0.00x" /> | ||
<KeyValuePairDisplay label="Liability weight" value="1.80x" /> | ||
<KeyValuePairDisplay label="Max leverage" value="5x" /> | ||
</div> | ||
) | ||
} | ||
|
||
export default TokenMangoStats |
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,31 @@ | ||
'use client' | ||
|
||
import { TokenPageWithData } from '../../../../contentful/tokenPage' | ||
import { numberCompacter } from '../../../utils/numbers' | ||
import KeyValuePairDisplay from './KeyValuePairDisplay' | ||
|
||
const TokenMarketStats = ({ tokenData }: { tokenData: TokenPageWithData }) => { | ||
if (!tokenData?.birdeyeData) return null | ||
const { birdeyeData } = tokenData | ||
return ( | ||
<div className="grid grid-cols-3 grid-flow-row gap-6"> | ||
<KeyValuePairDisplay | ||
label="FDMC" | ||
value={ | ||
birdeyeData?.mc ? `$${numberCompacter.format(birdeyeData.mc)}` : '–' | ||
} | ||
tooltipContent="Fully diluted market cap" | ||
/> | ||
<KeyValuePairDisplay | ||
label="Supply" | ||
value={ | ||
birdeyeData?.supply | ||
? `$${numberCompacter.format(birdeyeData.supply)}` | ||
: '–' | ||
} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default TokenMarketStats |
6 changes: 3 additions & 3 deletions
6
app/components/explore/TokenPriceChart.tsx → ...ts/explore/token-page/TokenPriceChart.tsx
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
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
Large diffs are not rendered by default.
Oops, something went wrong.