-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update Hey treasury constant and references
- Loading branch information
Showing
6 changed files
with
53 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
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,45 @@ | ||
import Loader from "@components/Shared/Loader"; | ||
import { BLOCK_EXPLORER_URL, HEY_APP, HEY_TREASURY } from "@hey/data/constants"; | ||
import { Card, CardHeader, ErrorMessage, NumberedStat } from "@hey/ui"; | ||
import Link from "next/link"; | ||
import type { FC } from "react"; | ||
import { formatEther } from "viem"; | ||
import { useBalance } from "wagmi"; | ||
|
||
const App: FC = () => { | ||
const { data, isLoading, error } = useBalance({ | ||
address: HEY_TREASURY, | ||
query: { refetchInterval: 2000 } | ||
}); | ||
|
||
return ( | ||
<Card> | ||
<CardHeader title="App" /> | ||
{isLoading ? ( | ||
<Loader className="my-10" message="Loading App..." /> | ||
) : error ? ( | ||
<ErrorMessage error={error} title="Failed to load App" /> | ||
) : ( | ||
<div className="m-5"> | ||
<div className="space-y-5"> | ||
<div className="linkify font-bold"> | ||
<Link | ||
href={`${BLOCK_EXPLORER_URL}/address/${HEY_APP}`} | ||
target="_blank" | ||
> | ||
Open App Contract in Explorer | ||
</Link> | ||
</div> | ||
<NumberedStat | ||
count={formatEther(data?.value || BigInt(0))} | ||
name="Treasury Balance" | ||
suffix="GHO" | ||
/> | ||
</div> | ||
</div> | ||
)} | ||
</Card> | ||
); | ||
}; | ||
|
||
export default App; |
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