Skip to content

Commit

Permalink
initialize tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
koybasimuhittin committed Nov 18, 2023
1 parent 7c3a1e5 commit 4b82f1f
Show file tree
Hide file tree
Showing 9 changed files with 536 additions and 267 deletions.
3 changes: 3 additions & 0 deletions packages/nextjs/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
51 changes: 27 additions & 24 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"name": "nextjs",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@rainbow-me/rainbowkit": "^1.2.0",
"next": "^13.4.19",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.16.3",
"wagmi": "~1.4.3"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.21",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.19",
"typescript": "^5.0.4"
}
"name": "nextjs",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@rainbow-me/rainbowkit": "^1.2.0",
"next": "^13.4.19",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.16.3",
"wagmi": "~1.4.3"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.21",
"autoprefixer": "^10.4.16",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.19",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"typescript": "^5.0.4"
}
}
84 changes: 42 additions & 42 deletions packages/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
import '../styles/globals.css';
import '@rainbow-me/rainbowkit/styles.css';
import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import type { AppProps } from 'next/app';
import { configureChains, createConfig, WagmiConfig } from 'wagmi';
import "../globals.css"
import "@rainbow-me/rainbowkit/styles.css"
import { getDefaultWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit"
import type { AppProps } from "next/app"
import { configureChains, createConfig, WagmiConfig } from "wagmi"
import {
arbitrum,
goerli,
mainnet,
optimism,
polygon,
base,
zora,
} from 'wagmi/chains';
import { publicProvider } from 'wagmi/providers/public';
arbitrum,
goerli,
mainnet,
optimism,
polygon,
base,
zora,
} from "wagmi/chains"
import { publicProvider } from "wagmi/providers/public"

const { chains, publicClient, webSocketPublicClient } = configureChains(
[
mainnet,
polygon,
optimism,
arbitrum,
base,
zora,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [goerli] : []),
],
[publicProvider()]
);
[
mainnet,
polygon,
optimism,
arbitrum,
base,
zora,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === "true" ? [goerli] : []),
],
[publicProvider()]
)

const { connectors } = getDefaultWallets({
appName: 'RainbowKit App',
projectId: 'YOUR_PROJECT_ID',
chains,
});
appName: "RainbowKit App",
projectId: "YOUR_PROJECT_ID",
chains,
})

const wagmiConfig = createConfig({
autoConnect: true,
connectors,
publicClient,
webSocketPublicClient,
});
autoConnect: true,
connectors,
publicClient,
webSocketPublicClient,
})

function MyApp({ Component, pageProps }: AppProps) {
return (
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains}>
<Component {...pageProps} />
</RainbowKitProvider>
</WagmiConfig>
);
return (
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains}>
<Component {...pageProps} />
</RainbowKitProvider>
</WagmiConfig>
)
}

export default MyApp;
export default MyApp
140 changes: 69 additions & 71 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,84 +1,82 @@
import { ConnectButton } from '@rainbow-me/rainbowkit';
import type { NextPage } from 'next';
import Head from 'next/head';
import styles from '../styles/Home.module.css';
import { ConnectButton } from "@rainbow-me/rainbowkit"
import type { NextPage } from "next"
import Head from "next/head"

const Home: NextPage = () => {
return (
<div className={styles.container}>
<Head>
<title>RainbowKit App</title>
<meta
content="Generated by @rainbow-me/create-rainbowkit"
name="description"
/>
<link href="/favicon.ico" rel="icon" />
</Head>
return (
<div className="bg-red-200 h-20 w-20">
<Head>
<title>RainbowKit App</title>
<meta
content="Generated by @rainbow-me/create-rainbowkit"
name="description"
/>
<link href="/favicon.ico" rel="icon" />
</Head>

<main className={styles.main}>
<ConnectButton />
<main className={""}>
<ConnectButton />

<h1 className={styles.title}>
Welcome to <a href="">RainbowKit</a> + <a href="">wagmi</a> +{' '}
<a href="https://nextjs.org">Next.js!</a>
</h1>
<h1 className={""}>
Welcome to <a href="">RainbowKit</a> + <a href="">wagmi</a> +{" "}
<a href="https://nextjs.org">Next.js!</a>
</h1>

<p className={styles.description}>
Get started by editing{' '}
<code className={styles.code}>pages/index.tsx</code>
</p>
<p className={""}>
Get started by editing <code className={""}>pages/index.tsx</code>
</p>

<div className={styles.grid}>
<a className={styles.card} href="https://rainbowkit.com">
<h2>RainbowKit Documentation &rarr;</h2>
<p>Learn how to customize your wallet connection flow.</p>
</a>
<div className={""}>
<a className={""} href="https://rainbowkit.com">
<h2>RainbowKit Documentation &rarr;</h2>
<p>Learn how to customize your wallet connection flow.</p>
</a>

<a className={styles.card} href="https://wagmi.sh">
<h2>wagmi Documentation &rarr;</h2>
<p>Learn how to interact with Ethereum.</p>
</a>
<a className={""} href="https://wagmi.sh">
<h2>wagmi Documentation &rarr;</h2>
<p>Learn how to interact with Ethereum.</p>
</a>

<a
className={styles.card}
href="https://github.com/rainbow-me/rainbowkit/tree/main/examples"
>
<h2>RainbowKit Examples &rarr;</h2>
<p>Discover boilerplate example RainbowKit projects.</p>
</a>
<a
className={""}
href="https://github.com/rainbow-me/rainbowkit/tree/main/examples"
>
<h2>RainbowKit Examples &rarr;</h2>
<p>Discover boilerplate example RainbowKit projects.</p>
</a>

<a className={styles.card} href="https://nextjs.org/docs">
<h2>Next.js Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>
<a className={""} href="https://nextjs.org/docs">
<h2>Next.js Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>

<a
className={styles.card}
href="https://github.com/vercel/next.js/tree/canary/examples"
>
<h2>Next.js Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>
<a
className={""}
href="https://github.com/vercel/next.js/tree/canary/examples"
>
<h2>Next.js Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>

<a
className={styles.card}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
>
<h2>Deploy &rarr;</h2>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>
<a
className={""}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
>
<h2>Deploy &rarr;</h2>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer className={styles.footer}>
<a href="https://rainbow.me" rel="noopener noreferrer" target="_blank">
Made with ❤️ by your frens at 🌈
</a>
</footer>
</div>
);
};
<footer className="bg-red-500">
<a href="https://rainbow.me" rel="noopener noreferrer" target="_blank">
Made with ❤️ by your frens at 🌈
</a>
</footer>
</div>
)
}

export default Home;
export default Home
6 changes: 6 additions & 0 deletions packages/nextjs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Loading

0 comments on commit 4b82f1f

Please sign in to comment.