Skip to content

Commit

Permalink
add explore to mobile nav, fix fdv and borrow rate
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Dec 17, 2023
1 parent 76d4642 commit 012434e
Show file tree
Hide file tree
Showing 5 changed files with 28,421 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/(pages)/token/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function TokenPage({ params }: TokenPageProps) {
<TokenInfo
coingeckoData={coingeckoData}
tokenPageData={tokenPageData}
volume={birdeyeData?.v24hUSD}
birdeyeData={birdeyeData}
/>
</div>
</div>
Expand Down
23 changes: 15 additions & 8 deletions app/components/explore/token-page/TokenInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ import {
DocumentDuplicateIcon,
} from '@heroicons/react/20/solid'
import Link from 'next/link'
import { BirdeyeOverviewData } from '../../../types/birdeye'
dayjs.extend(relativeTime)

const TokenInfo = ({
coingeckoData,
tokenPageData,
volume,
birdeyeData,
}: {
coingeckoData: CoingeckoData | undefined
tokenPageData: TokenPageWithData
volume: number | undefined
birdeyeData: BirdeyeOverviewData | undefined
}) => {
const { mint, tags } = tokenPageData
const [copied, setCopied] = useState(false)
Expand Down Expand Up @@ -61,7 +62,11 @@ const TokenInfo = ({
/>
<KeyValuePair
label="24h Volume"
value={volume ? `$${numberCompacter.format(volume)}` : '–'}
value={
birdeyeData?.v24hUSD
? `$${numberCompacter.format(birdeyeData?.v24hUSD)}`
: '–'
}
/>
<KeyValuePair
label="Market cap"
Expand All @@ -80,11 +85,13 @@ const TokenInfo = ({
<KeyValuePair
label="Fully diluted value"
value={
coingeckoData?.market_data?.fully_diluted_valuation?.usd
? `$${numberCompacter.format(
coingeckoData.market_data.fully_diluted_valuation.usd,
)}`
: '–'
birdeyeData?.mc
? `$${numberCompacter.format(birdeyeData.mc)}`
: coingeckoData?.market_data?.fully_diluted_valuation?.usd
? `$${numberCompacter.format(
coingeckoData.market_data.fully_diluted_valuation.usd,
)}`
: '–'
}
/>
<KeyValuePair
Expand Down
2 changes: 1 addition & 1 deletion app/components/explore/token-page/TokenMangoStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const TokenMangoStats = ({
? (mangoData.deposit_rate * 100).toFixed(2)
: '–'
const borrowRate = !isNaN(mangoData?.borrow_rate)
? (mangoData.borrow_rate * 100).toFixed(2)
? (mangoData.borrow_rate * 100 + 0.5).toFixed(2)
: '–'
const available = !isNaN(mangoData?.available)
? numberCompacter.format(mangoData.available)
Expand Down
23 changes: 23 additions & 0 deletions app/components/navigation/MobileNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@ const MenuPanel = ({
</IconButton>
</div>
<div className="grid grid-cols-2 grid-row-flow gap-6 px-4">
<div>
<h4 className="px-4 mb-2">Explore</h4>
<NavigationItemLink
path="/explore"
onClick={closeOnClick}
title="All"
/>
<NavigationItemLink
path="/explore/defi"
onClick={closeOnClick}
title="DeFi"
/>
<NavigationItemLink
path="/explore/meme"
onClick={closeOnClick}
title="Meme"
/>
<NavigationItemLink
path="/explore/exchange"
onClick={closeOnClick}
title="Exchange"
/>
</div>
<div>
<h4 className="px-4 mb-2">Developers</h4>
<NavigationItemLink
Expand Down
28,382 changes: 28,381 additions & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 012434e

Please sign in to comment.