-
Notifications
You must be signed in to change notification settings - Fork 360
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
1 parent
63f129d
commit 439288e
Showing
44 changed files
with
1,775 additions
and
432 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 |
---|---|---|
@@ -1,20 +1,53 @@ | ||
'use client' | ||
import { Card, CardContent, CardHeader } from "@/components/ui/card"; | ||
import Transfer from "./transfer"; | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import Image from "next/image"; | ||
import { ConnectWalletButton } from "@/components/ConnectWalletButton"; | ||
import { useAppKitAccount } from "@reown/appkit/react"; | ||
import Navbar from "@/components/Navbar"; | ||
import { GiftDonutModalTrigger } from "@/components/GiftDonutModalTrigger"; | ||
|
||
export default function Home() { | ||
const { status, address } = useAppKitAccount(); | ||
|
||
return ( | ||
<main> | ||
<div> | ||
<Card > | ||
<CardHeader> | ||
<w3m-button /> | ||
</CardHeader> | ||
<CardContent> | ||
<Transfer/> | ||
</CardContent> | ||
</Card> | ||
<div className="sm:w-1/2 flex flex-col sm:mx-10"> | ||
<Navbar /> | ||
<div className="flex flex-col justify-center gap-4 mt-8"> | ||
<div className="flex items-center justify-center h-64 relative "> | ||
<Image | ||
src="/donut-cover.png" | ||
alt="Gift Donut" | ||
className="object-cover" | ||
fill={true} | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-5"> | ||
<div className="flex flex-col text-left"> | ||
<p className=" font-bold text-primary">Donut #1</p> | ||
<p className=" text-secondary">Lorem ipsum dolor sit...</p> | ||
</div> | ||
<div className="flex justify-between items-center w-full"> | ||
<div className="flex flex-col text-left"> | ||
<p className=" text-secondary">Price</p> | ||
<p className=" font-bold text-primary">$10.00</p> | ||
</div> | ||
{status === "connected" || address ? ( | ||
<div> | ||
<GiftDonutModalTrigger | ||
triggerText="Gift Donut" | ||
initialView="Checkout1" | ||
className="bg-blue-500 hover:bg-blue-700 text-invert" | ||
/> | ||
</div> | ||
) : ( | ||
<div> | ||
<ConnectWalletButton /> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
"lib": "@/lib", | ||
"hooks": "@/hooks" | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
advanced/dapps/chain-abstraction-demo/components/ConnectWalletButton.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,18 @@ | ||
import React from "react"; | ||
import { useAppKit } from "@reown/appkit/react"; | ||
import { Button } from "./ui/button"; | ||
|
||
export function ConnectWalletButton() { | ||
const { open } = useAppKit(); | ||
|
||
return ( | ||
<Button | ||
type="button" | ||
className="w-full bg-gray-700 hover:bg-gray-600 text-white" | ||
size="lg" | ||
onClick={() => open({ view: "Connect" })} | ||
> | ||
Connect Wallet | ||
</Button> | ||
); | ||
} |
Oops, something went wrong.