-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new page is supported: etherium airdrops
- Loading branch information
1 parent
8cc1a1c
commit 9c245ce
Showing
8 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
apps/website/src/app/demos/dashboard-etherium-airdrops/Content.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
'use client' | ||
|
||
import {useState} from 'react' | ||
|
||
import Collapse from '@mui/material/Collapse' | ||
|
||
import AdaptiveGridTwoEqualItems from '@/components/AdaptiveGrid/TwoEqualItems' | ||
|
||
import TableBody from '@/components/Coingecko/TableBody' | ||
import TableHeader from '@/components/Coingecko/TableHeader' | ||
import CustomAlert from '@/components/Coingecko/CustomAlert' | ||
import PageHeaderContainer from '@/components/Coingecko/PageHeaderContainer' | ||
|
||
import {Slogan} from '@/styled-components' | ||
import Table from '@/styled-components/Coingecko/Table/Table' | ||
|
||
import { | ||
useCryptoCurrencyList, | ||
useSortingCryptoCurrencyList, | ||
} from '@/hooks/coingecko/simplePrices' | ||
|
||
import {getCoingeckoRequestParams} from './db' | ||
|
||
import stack from './stack' | ||
|
||
import {coinCellParams, usdCellParams} from './setting' | ||
|
||
const Content = () => { | ||
const [priceListNotifacationIsVisible, setPriceListNotifacationIsVisible] = | ||
useState(false) | ||
|
||
const params = getCoingeckoRequestParams() | ||
const {prices, setPrices, apiRequest} = useCryptoCurrencyList({ | ||
setPriceListNotifacationIsVisible, | ||
params, | ||
}) | ||
|
||
const {sorting, setSorting} = useSortingCryptoCurrencyList({ | ||
prices, | ||
setPrices, | ||
setPriceListNotifacationIsVisible, | ||
}) | ||
|
||
return ( | ||
<> | ||
<Slogan>Coingecko portfolio fetcher</Slogan> | ||
<AdaptiveGridTwoEqualItems | ||
ItemA={ | ||
<> | ||
<div>Technologies: {stack.join(', ')}</div> | ||
<p> | ||
Sort by usd price, Old price USD (24h), Old price BTC (24h), Old | ||
price ETH (24h) | ||
</p> | ||
</> | ||
} | ||
ItemB={<PageHeaderContainer apiRequest={apiRequest} />} | ||
/> | ||
|
||
<Collapse in={priceListNotifacationIsVisible}> | ||
<CustomAlert sorting={sorting} /> | ||
</Collapse> | ||
|
||
<Table> | ||
<TableHeader | ||
setSorting={setSorting} | ||
sorting={sorting} | ||
coinCellParams={coinCellParams} | ||
usdCellParams={usdCellParams} | ||
/> | ||
<TableBody | ||
items={prices} | ||
coinCellParams={coinCellParams} | ||
usdCellParams={usdCellParams} | ||
/> | ||
</Table> | ||
</> | ||
) | ||
} | ||
|
||
export default Content |
21 changes: 21 additions & 0 deletions
21
apps/website/src/app/demos/dashboard-etherium-airdrops/db/index.ts
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,21 @@ | ||
import {CoingeckoSimplePriceRequest} from '@/types/coingecko/simplePrices/RequestParams' | ||
import Currency from '@/enums/CoingeckoCryptoCurrency' | ||
|
||
export function getCoingeckoRequestParams(): CoingeckoSimplePriceRequest { | ||
const coingeckoIds = [ | ||
Currency.BTC, | ||
Currency.ETHEREUM, | ||
Currency.ENA, | ||
Currency.ETHFI, | ||
Currency.REZ, | ||
Currency.MANTA, | ||
] | ||
|
||
return { | ||
ids: coingeckoIds.join(','), | ||
vs_currencies: 'usd', | ||
include_24hr_change: true, | ||
include_7d_change: true, | ||
include_last_updated_at: true, | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
apps/website/src/app/demos/dashboard-etherium-airdrops/layout.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import layout from '@/components/NextjsLayout' | ||
import generateMetadata from '@/seo/metadata' | ||
import props from './seo' | ||
|
||
export const metadata = generateMetadata(props) | ||
|
||
export default layout |
39 changes: 39 additions & 0 deletions
39
apps/website/src/app/demos/dashboard-etherium-airdrops/page.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client' | ||
|
||
import type {NextPage} from 'next' | ||
|
||
import Content from './Content' | ||
|
||
import Layout from '@/components/MainLayout' | ||
import LeftDrawer from '@/components/Drawers/LeftDrawer' | ||
import {menuItems} from '@/menu' | ||
|
||
import {drawerWidth} from '@/config/layout' | ||
import {LayoutProvider} from '@/providers' | ||
|
||
import {title} from './seo' | ||
|
||
const Title = () => { | ||
return <h1>{title}</h1> | ||
} | ||
|
||
const PageContent = () => { | ||
return ( | ||
<LayoutProvider> | ||
<Content /> | ||
</LayoutProvider> | ||
) | ||
} | ||
|
||
const Page: NextPage = () => { | ||
return ( | ||
<Layout | ||
PageContent={PageContent} | ||
HeaderTitle={Title} | ||
drawerWidth={drawerWidth} | ||
LeftDrawer={<LeftDrawer items={menuItems} />} | ||
/> | ||
) | ||
} | ||
|
||
export default Page |
15 changes: 15 additions & 0 deletions
15
apps/website/src/app/demos/dashboard-etherium-airdrops/seo.ts
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,15 @@ | ||
import {InternalMetadata} from '@/seo/metadata' | ||
|
||
const title = 'Coingecko: etherium airdrop price checker (2024 edition)' | ||
const description = 'Pairs are' | ||
const canonical = '/demos/dashboard-etherium-airdrops' | ||
|
||
const props: InternalMetadata = { | ||
title, | ||
description, | ||
canonical, | ||
} | ||
|
||
export default props | ||
|
||
export {title} |
28 changes: 28 additions & 0 deletions
28
apps/website/src/app/demos/dashboard-etherium-airdrops/setting.ts
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,28 @@ | ||
import {UICellParams, UICoinCellParams} from '@/types/coingecko/cells' | ||
|
||
export const coinCellParams: UICoinCellParams = { | ||
label: 'Coin', | ||
width: '8%', | ||
mobile: { | ||
hidden: false, | ||
}, | ||
} | ||
|
||
export const usdCellParams: UICellParams = { | ||
lastUpdatedItemParams: { | ||
label: 'USD', | ||
width: '46%', | ||
mobile: { | ||
hidden: false, | ||
width: '46%', | ||
}, | ||
}, | ||
historicItemParams: { | ||
label: 'Day ago', | ||
width: '46%', | ||
mobile: { | ||
hidden: false, | ||
width: '46%', | ||
}, | ||
}, | ||
} |
3 changes: 3 additions & 0 deletions
3
apps/website/src/app/demos/dashboard-etherium-airdrops/stack.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const stack = ['React', 'React Custom Hooks', 'Coingecko API'] | ||
|
||
export default stack |
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