feat: publishing infernet-container-starter v0.2.0
This commit is contained in:
20
projects/prompt-to-nft/ui/src/pages/_app.tsx
Normal file
20
projects/prompt-to-nft/ui/src/pages/_app.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import "@/styles/globals.css";
|
||||
import type { AppProps } from "next/app";
|
||||
import { WagmiProvider } from "wagmi";
|
||||
import { config } from "@/util/config";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { RainbowKitProvider } from "@rainbow-me/rainbowkit";
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<WagmiProvider config={config}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<RainbowKitProvider>
|
||||
<Component {...pageProps} />
|
||||
</RainbowKitProvider>
|
||||
</QueryClientProvider>
|
||||
</WagmiProvider>
|
||||
);
|
||||
}
|
13
projects/prompt-to-nft/ui/src/pages/_document.tsx
Normal file
13
projects/prompt-to-nft/ui/src/pages/_document.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import { Html, Head, Main, NextScript } from "next/document";
|
||||
|
||||
export default function Document() {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head />
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
);
|
||||
}
|
13
projects/prompt-to-nft/ui/src/pages/api/hello.ts
Normal file
13
projects/prompt-to-nft/ui/src/pages/api/hello.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
type Data = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse<Data>,
|
||||
) {
|
||||
res.status(200).json({ name: "John Doe" });
|
||||
}
|
BIN
projects/prompt-to-nft/ui/src/pages/golden-skiing.png
Normal file
BIN
projects/prompt-to-nft/ui/src/pages/golden-skiing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
54
projects/prompt-to-nft/ui/src/pages/index.tsx
Normal file
54
projects/prompt-to-nft/ui/src/pages/index.tsx
Normal file
@ -0,0 +1,54 @@
|
||||
import { useAccount } from "wagmi";
|
||||
import { ConnectButton } from "@rainbow-me/rainbowkit";
|
||||
import { FaucetButton } from "@/components/FaucetButton";
|
||||
import { useState } from "react";
|
||||
import { ClientRendered } from "@/components/ClientRendered";
|
||||
import { MintButton } from "@/components/MintButton";
|
||||
import { NftCollection } from "@/components/NftCollection";
|
||||
import { addNetwork } from "@/util/chain";
|
||||
import {Button} from "@/components/Button";
|
||||
|
||||
export default function Home() {
|
||||
const account = useAccount();
|
||||
const [prompt, setPrompt] = useState<string>(
|
||||
"A picture of a golden retriever fighting sparta in the 300 movie",
|
||||
);
|
||||
|
||||
return (
|
||||
<ClientRendered>
|
||||
<nav
|
||||
className="
|
||||
backdrop-blur-[17px] bg-white bg-opacity-10 fixed bg-fixed
|
||||
dark:border-b-white dark:border-opacity-[15%] py-4
|
||||
w-[calc(100%-36px)] rounded-[8px] px-[22px] mx-[18px]
|
||||
mt-[30px] gap-3 flex flex-row justify-end"
|
||||
>
|
||||
<Button onClick={addNetwork}>Add Network</Button>
|
||||
<FaucetButton />
|
||||
<ConnectButton />
|
||||
</nav>
|
||||
<main
|
||||
className={`flex min-h-screen flex-col items-center pt-[140px] gap-3`}
|
||||
>
|
||||
<div
|
||||
className={"flex flex-row items-center gap-3 w-[80%] md:max-w-[80%]"}
|
||||
>
|
||||
<label htmlFor="prompt" className={"text-xl"}>
|
||||
Your Prompt
|
||||
</label>
|
||||
<input
|
||||
name={"prompt"}
|
||||
className={
|
||||
"p-2 border-2 rounded-md min-w-96 bg-opacity-20 bg-white border-0 flex-1"
|
||||
}
|
||||
type="text"
|
||||
value={prompt}
|
||||
onChange={(e) => setPrompt(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<MintButton prompt={prompt} />
|
||||
<NftCollection />
|
||||
</main>
|
||||
</ClientRendered>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user