Skip to content

Commit

Permalink
Merge branch 'rainbow-me:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
frontierpawan authored Jun 26, 2023
2 parents 371e263 + edc8121 commit 437f08b
Show file tree
Hide file tree
Showing 105 changed files with 3,047 additions and 1,327 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [pull_request, push]

env:
pnpm: 8
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: TEST_PROJECT_ID

jobs:
tests:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You can use the CodeSandbox links below try out RainbowKit:

- with [Create React App](https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-create-react-app)
- with [Next.js](https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-next)
- with [Next.js App Router](https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-next-app)
- with [Remix](https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-remix)
- with [Vite](https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-vite)

Expand All @@ -43,6 +44,7 @@ The following examples are provided in the [examples](./examples/) folder of thi

- `with-create-react-app`
- `with-next`
- `with-next-app`
- `with-next-custom-button`
- `with-next-mint-nft`
- `with-next-siwe-next-auth`
Expand Down
24 changes: 24 additions & 0 deletions examples/with-create-react-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# with-create-react-app

## 0.1.55

### Patch Changes

- Updated dependencies [d00c777]
- @rainbow-me/rainbowkit@1.0.3

## 0.1.54

### Patch Changes

- Updated dependencies [e2b1072]
- Updated dependencies [e2b1072]
- @rainbow-me/rainbowkit@1.0.2

## 0.1.53

### Patch Changes

- Updated dependencies [9432a2f]
- Updated dependencies [b2c66ff]
- Updated dependencies [bcb3d18]
- @rainbow-me/rainbowkit@1.0.1

## 0.1.52

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions examples/with-create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "with-create-react-app",
"version": "0.1.52",
"version": "0.1.55",
"private": true,
"dependencies": {
"@rainbow-me/rainbowkit": "workspace:*",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.35",
"@types/react": "^18.0.9",
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react": "^18.2.0",
"typescript": "^5.0.4",
"util": "0.12.4",
"viem": "~0.3.19",
"wagmi": "^1.0.1",
"viem": "~1.0.6",
"wagmi": "~1.2.1",
"web-vitals": "^2.1.4",
"buffer": "npm:buffer@6.0.3"
},
Expand Down Expand Up @@ -45,4 +45,4 @@
"last 1 safari version"
]
}
}
}
10 changes: 9 additions & 1 deletion examples/with-create-react-app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import './index.css';
import '@rainbow-me/rainbowkit/styles.css';
import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { configureChains, createConfig, WagmiConfig } from 'wagmi';
import { mainnet, polygon, optimism, arbitrum, goerli } from 'wagmi/chains';
import {
mainnet,
polygon,
optimism,
arbitrum,
zora,
goerli,
} from 'wagmi/chains';
import { publicProvider } from 'wagmi/providers/public';
import App from './App';

Expand All @@ -17,6 +24,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
polygon,
optimism,
arbitrum,
zora,
...(process.env.REACT_APP_ENABLE_TESTNETS === 'true' ? [goerli] : []),
],
[publicProvider()]
Expand Down
15 changes: 15 additions & 0 deletions examples/with-next-app/.codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://codesandbox.io/schemas/tasks.json",
"setupTasks": ["yarn add @rainbow-me/rainbowkit@latest", "yarn build"],
"tasks": {
"install-dependencies": {
"name": "Install Dependencies",
"command": "yarn add @rainbow-me/rainbowkit@latest"
},
"start-app": {
"name": "Run Dev Server",
"command": "yarn dev",
"runAtStart": true
}
}
}
3 changes: 3 additions & 0 deletions examples/with-next-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
38 changes: 38 additions & 0 deletions examples/with-next-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo
32 changes: 32 additions & 0 deletions examples/with-next-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# with-next-app

## 0.0.4

### Patch Changes

- Updated dependencies [d00c777]
- @rainbow-me/rainbowkit@1.0.3

## 0.0.3

### Patch Changes

- Updated dependencies [e2b1072]
- Updated dependencies [e2b1072]
- @rainbow-me/rainbowkit@1.0.2

## 0.0.2

### Patch Changes

- Updated dependencies [9432a2f]
- Updated dependencies [b2c66ff]
- Updated dependencies [bcb3d18]
- @rainbow-me/rainbowkit@1.0.1

## 0.0.1

### Patch Changes

- Updated dependencies [9838acf]
- @rainbow-me/rainbowkit@0.12.0
30 changes: 30 additions & 0 deletions examples/with-next-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
This is a [Next.js](https://nextjs.org/) 13 App Router project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
15 changes: 15 additions & 0 deletions examples/with-next-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import '../styles/global.css';
import '@rainbow-me/rainbowkit/styles.css';
import { Providers } from './providers';

function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}

export default RootLayout;
17 changes: 17 additions & 0 deletions examples/with-next-app/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ConnectButton } from '@rainbow-me/rainbowkit';

function Page() {
return (
<div
style={{
display: 'flex',
justifyContent: 'flex-end',
padding: 12,
}}
>
<ConnectButton />
</div>
);
}

export default Page;
78 changes: 78 additions & 0 deletions examples/with-next-app/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
'use client';

import * as React from 'react';
import {
RainbowKitProvider,
getDefaultWallets,
connectorsForWallets,
} from '@rainbow-me/rainbowkit';
import {
argentWallet,
trustWallet,
ledgerWallet,
} from '@rainbow-me/rainbowkit/wallets';
import { configureChains, createConfig, WagmiConfig } from 'wagmi';
import {
mainnet,
polygon,
optimism,
arbitrum,
zora,
goerli,
} from 'wagmi/chains';
import { publicProvider } from 'wagmi/providers/public';

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

const projectId = 'YOUR_PROJECT_ID';

const { wallets } = getDefaultWallets({
appName: 'RainbowKit demo',
projectId,
chains,
});

const demoAppInfo = {
appName: 'Rainbowkit Demo',
};

const connectors = connectorsForWallets([
...wallets,
{
groupName: 'Other',
wallets: [
argentWallet({ projectId, chains }),
trustWallet({ projectId, chains }),
ledgerWallet({ projectId, chains }),
],
},
]);

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

export function Providers({ children }: { children: React.ReactNode }) {
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => setMounted(true), []);
return (
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains} appInfo={demoAppInfo}>
{mounted && children}
</RainbowKitProvider>
</WagmiConfig>
);
}
5 changes: 5 additions & 0 deletions examples/with-next-app/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
13 changes: 13 additions & 0 deletions examples/with-next-app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
},
webpack: config => {
config.resolve.fallback = { fs: false, net: false, tls: false };
return config;
},
};

module.exports = nextConfig;
Loading

0 comments on commit 437f08b

Please sign in to comment.