generated from defi-wonderland/web3-nextjs-boilerplate
-
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.
- Loading branch information
Showing
11 changed files
with
111 additions
and
6 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,7 @@ | ||
export const SearchBar = () => { | ||
return ( | ||
<form> | ||
<input type='text' placeholder='Search...' /> | ||
</form> | ||
); | ||
}; |
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 { useData } from '~/hooks'; | ||
|
||
export const Table = () => { | ||
const { ecosystemData } = useData(); | ||
return ( | ||
<table> | ||
<tr> | ||
<th>Chain</th> | ||
<th>Chain ID</th> | ||
<th>Native token</th> | ||
<th>TVL - L1</th> | ||
<th>Type</th> | ||
</tr> | ||
|
||
{ecosystemData?.chains.map((data, index) => { | ||
return ( | ||
<tr key={index}> | ||
<td>{data.name}</td> | ||
<td>{data.id}</td> | ||
<td>{data.nativeToken}</td> | ||
<td>{data.tvl}</td> | ||
<td>{data.type}</td> | ||
</tr> | ||
); | ||
})} | ||
</table> | ||
); | ||
}; |
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,10 @@ | ||
export const TitleBanner = () => { | ||
return ( | ||
<div> | ||
<span>zkSync Ecosystem</span> | ||
<div> | ||
<span>Gas Price: 10 wei · ERC-20 Transfer: $10</span> | ||
</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,21 @@ | ||
export interface TokenValueLocked { | ||
token: string; | ||
value: number; | ||
} | ||
|
||
interface TotalValueLockedProps { | ||
tvl: { [token: string]: number }[]; | ||
} | ||
|
||
export const TotalValueLocked = ({ tvl }: TotalValueLockedProps) => { | ||
return ( | ||
<div> | ||
{tvl.map((data, index) => ( | ||
<div key={index}> | ||
<span>{data.token}</span> | ||
<span>{data.value}</span> | ||
</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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export * from './Theme'; | ||
export * from './Disclaimer'; | ||
export * from './CustomHead'; | ||
export * from './Table'; | ||
export * from './SearchBar'; | ||
export * from './TotalValueLocked'; |
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 { SearchBar, Table } from '~/components'; | ||
|
||
const Dashboard = () => { | ||
return ( | ||
<div> | ||
<div> | ||
<h1>Chain list</h1> | ||
<SearchBar /> | ||
</div> | ||
<Table /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Dashboard; |
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,17 @@ | ||
import { TotalValueLocked } from '~/components'; | ||
import { useData } from '~/hooks'; | ||
|
||
export const LockedAssets = () => { | ||
const { ecosystemData } = useData(); | ||
|
||
return ( | ||
<div> | ||
{ecosystemData && ( | ||
<> | ||
<h2>Locked assets in shared bridge: {ecosystemData.total}</h2> | ||
<TotalValueLocked tvl={ecosystemData.tvl} /> | ||
</> | ||
)} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
"type": "Validium" | ||
} | ||
], | ||
"total": 7000000, | ||
"tvl": [ | ||
{ | ||
"token": "ETH", | ||
|
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