Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): onchainkit #27

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 237 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
"lint": "next lint"
},
"dependencies": {
"@tanstack/react-query": "^5.49.0",
"@coinbase/onchainkit": "^0.23.4",
"next": "^14.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.16.4",
"wagmi": "^2.10.8"
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^20.14.8",
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/components/SponsorshipSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { abi } from "../../../backend/ignition/deployments/chain-84532/artifacts
import deployed_addresses from "../../../backend/ignition/deployments/chain-84532/deployed_addresses.json";
import LoadingIndicator from "./LoadingIndicator";
import { Address, formatEther } from "viem";
import { Avatar, Name } from "@coinbase/onchainkit/identity";

export default function SponsorshipSummary({ queueIndex }: any) {
console.debug("SponsorshipSummary");
Expand Down Expand Up @@ -30,10 +31,14 @@ export default function SponsorshipSummary({ queueIndex }: any) {
const sponsor = sponsorship[2];
return (
<>
Queue number: #{queueIndex}<br />
Date: {new Date(timestamp * 1_000).toISOString().substring(0,16)}<br />
Amount: {formatEther(estimatedCost)} ETH<br />
Sponsor: <code>{sponsor.substring(0,5)}...{sponsor.substring(38,42)}</code>
Queue number: #{queueIndex + 1}
<div className="mt-2">
{new Date(timestamp * 1_000).toISOString().substring(0,10)} {new Date(timestamp * 1_000).toISOString().substring(11,16)}
</div>
Amount: {formatEther(estimatedCost)} ETH
<div className="mt-2">
Sponsor: <code><Name address={sponsor} className="p-8 rounded-lg bg-purple-100 dark:bg-purple-900" /></code>
</div>
</>
)
}
2 changes: 1 addition & 1 deletion frontend/src/components/Sponsorships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Sponsorships() {
return (
<>
{Array(queueCount).fill(1).map((el, i) =>
<Link key={i} href={`/sponsorships/${i}`}>
<Link key={i} href={`/sponsorships/${i + 1}`}>
<div className="p-4 text-2xl bg-purple-200 dark:bg-purple-950 rounded-lg border-purple-400 border-r-4 border-b-4 hover:border-r-8 hover:border-b-8 hover:-translate-y-1">
<SponsorshipSummary queueIndex={i} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default function SponsorshipDetails() {
console.debug("SponsorshipDetails");

const router = useRouter();
const queueIndex = router.query.queueIndex;
const queueNumber = Number(router.query.queueNumber);
console.debug("queueNumber:", queueNumber);
const queueIndex = queueNumber - 1;
console.debug("queueIndex:", queueIndex);

return (
Expand Down
Loading