-
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.
added: sitelayout, thirdweb wallet integration
- Loading branch information
1 parent
9f7cd68
commit f65bdc9
Showing
9 changed files
with
14,861 additions
and
151 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 @@ | ||
NEXT_PUBLIC_THIRDWEB_CLIENT_ID= |
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,69 @@ | ||
"use client"; | ||
import { Divider, Layout } from "antd"; | ||
import { ConnectWallet } from "@thirdweb-dev/react"; | ||
import "antd/dist/reset.css"; | ||
|
||
const { Header, Footer, Content } = Layout; | ||
|
||
export default function SiteLayout({ children }) { | ||
return ( | ||
<Layout style={{ minHeight: "100vh" }}> | ||
<Header | ||
style={{ | ||
position: "sticky", | ||
top: 0, | ||
zIndex: 99, | ||
padding: 0, | ||
color: "#fff", | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
borderRadius: "5px" | ||
}} | ||
> | ||
<h3 | ||
style={{ | ||
margin: 0, | ||
padding: "0 6px", | ||
fontWeight: "bold" | ||
}} | ||
> | ||
Superfluid Dashboard | ||
</h3> | ||
<ConnectWallet | ||
style={{ marginRight: "10px" }} | ||
theme={"dark"} // light | dark | ||
switchToActiveChain={true} | ||
hideTestnetFaucet={false} | ||
modalSize={"compact"} // compact | wide | ||
termsOfServiceUrl="https://example.com/terms" | ||
privacyPolicyUrl="https://example.com/privacy" | ||
/> | ||
</Header> | ||
|
||
<Content | ||
style={{ | ||
margin: "12px 8px", | ||
padding: 12, | ||
minHeight: "100%", | ||
color: "black", | ||
maxHeight: "100%" | ||
}} | ||
> | ||
{children} | ||
</Content> | ||
<Divider plain /> | ||
<Footer style={{ textAlign: "center" }}> | ||
<a | ||
href="https://github.com/Salmandabbakuti" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
©{new Date().getFullYear()} Salman Dabbakuti. Powered by TheGraph & | ||
Superfluid | ||
</a> | ||
<p style={{ fontSize: "12px" }}>v0.0.1</p> | ||
</Footer> | ||
</Layout> | ||
); | ||
} |
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,44 @@ | ||
"use client"; | ||
import { useState, useEffect } from "react"; | ||
import { | ||
ThirdwebProvider, | ||
metamaskWallet, | ||
coinbaseWallet, | ||
walletConnect, | ||
rainbowWallet, | ||
trustWallet | ||
} from "@thirdweb-dev/react"; | ||
import { Sepolia } from "@thirdweb-dev/chains"; | ||
|
||
const supportedWallets = [ | ||
metamaskWallet({ recommended: true }), | ||
coinbaseWallet({ recommended: true }), | ||
walletConnect(), | ||
rainbowWallet(), | ||
trustWallet() | ||
]; | ||
const clientId = process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID; | ||
|
||
export default function Web3Provider({ children }) { | ||
const [mounted, setMounted] = useState(false); | ||
useEffect(() => setMounted(true), []); | ||
|
||
return ( | ||
<ThirdwebProvider | ||
activeChain={11155111} | ||
supportedChains={[Sepolia]} | ||
supportedWallets={supportedWallets} | ||
autoConnect={true} | ||
clientId={clientId} | ||
dAppMeta={{ | ||
name: "Superfluid Dashboard", | ||
description: "Superfluid Dashboard", | ||
logoUrl: "https://example.com/logo.png", | ||
url: "https://example.com", | ||
isDarkMode: true | ||
}} | ||
> | ||
{mounted && children} | ||
</ThirdwebProvider> | ||
); | ||
} |
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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Inter } from "next/font/google"; | ||
import SiteLayout from "./components/SiteLayout"; | ||
import Web3Provider from "./components/Web3Provider"; | ||
import "./globals.css"; | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export const metadata = { | ||
title: "Superfluid Dashboard", | ||
description: "Superfluid Dashboard" | ||
}; | ||
|
||
export default function RootLayout({ children }) { | ||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}> | ||
<Web3Provider> | ||
<SiteLayout>{children}</SiteLayout> | ||
</Web3Provider> | ||
</body> | ||
</html> | ||
); | ||
} |
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
Oops, something went wrong.