Skip to content

Commit

Permalink
added: sitelayout, thirdweb wallet integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Salmandabbakuti committed Jun 5, 2024
1 parent 9f7cd68 commit f65bdc9
Show file tree
Hide file tree
Showing 9 changed files with 14,861 additions and 151 deletions.
1 change: 1 addition & 0 deletions client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=
69 changes: 69 additions & 0 deletions client/app/components/SiteLayout.jsx
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>
);
}
44 changes: 44 additions & 0 deletions client/app/components/Web3Provider.jsx
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>
);
}
81 changes: 34 additions & 47 deletions client/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,77 +1,67 @@
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono",
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
"Fira Mono", "Droid Sans Mono", "Courier New", monospace;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;

--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;

--primary-glow: conic-gradient(
from 180deg at 50% 50%,
#16abff33 0deg,
#0885ff33 55deg,
#54d6ff33 120deg,
#0071ff33 160deg,
transparent 360deg
);
--secondary-glow: radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);
--primary-glow: conic-gradient(from 180deg at 50% 50%,
#16abff33 0deg,
#0885ff33 55deg,
#54d6ff33 120deg,
#0071ff33 160deg,
transparent 360deg);
--secondary-glow: radial-gradient(rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0));

--tile-start-rgb: 239, 245, 249;
--tile-end-rgb: 228, 232, 233;
--tile-border: conic-gradient(
#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080
);
--tile-border: conic-gradient(#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080);

--callout-rgb: 238, 240, 241;
--callout-border-rgb: 172, 175, 176;
--card-rgb: 180, 185, 188;
--card-border-rgb: 131, 134, 135;
}

@media (prefers-color-scheme: dark) {
/* @media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);
--secondary-glow: linear-gradient(to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3));
--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);
--tile-border: conic-gradient(#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80);
--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;
}
}
} */

* {
box-sizing: border-box;
Expand All @@ -87,12 +77,9 @@ body {

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
background: linear-gradient(to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
}

a {
Expand All @@ -104,4 +91,4 @@ a {
html {
color-scheme: dark;
}
}
}
17 changes: 0 additions & 17 deletions client/app/layout.js

This file was deleted.

23 changes: 23 additions & 0 deletions client/app/layout.jsx
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>
);
}
87 changes: 1 addition & 86 deletions client/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,7 @@ import styles from "./page.module.css";
export default function Home() {
return (
<main className={styles.main}>
<div className={styles.description}>
<p>
Get started by editing&nbsp;
<code className={styles.code}>app/page.js</code>
</p>
<div>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className={styles.center}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className={styles.grid}>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Docs <span>-&gt;</span>
</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Learn <span>-&gt;</span>
</h2>
<p>Learn about Next.js in an interactive course with&nbsp;quizzes!</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Templates <span>-&gt;</span>
</h2>
<p>Explore starter templates for Next.js.</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Deploy <span>-&gt;</span>
</h2>
<p>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
<h1 className={styles.title}>Welcome to Next.js!</h1>
</main>
);
}
Loading

0 comments on commit f65bdc9

Please sign in to comment.