diff --git a/packages/create-starknet/templates/next/eslintrc.json b/packages/create-starknet/templates/next/.eslintrc.json similarity index 100% rename from packages/create-starknet/templates/next/eslintrc.json rename to packages/create-starknet/templates/next/.eslintrc.json diff --git a/packages/create-starknet/templates/next/gitignore b/packages/create-starknet/templates/next/.gitignore similarity index 94% rename from packages/create-starknet/templates/next/gitignore rename to packages/create-starknet/templates/next/.gitignore index c87c9b39..fd3dbb57 100644 --- a/packages/create-starknet/templates/next/gitignore +++ b/packages/create-starknet/templates/next/.gitignore @@ -4,6 +4,7 @@ /node_modules /.pnp .pnp.js +.yarn/install-state.gz # testing /coverage @@ -23,7 +24,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.pnpm-debug.log* # local env files .env*.local diff --git a/packages/create-starknet/templates/next/README-template.md b/packages/create-starknet/templates/next/README-template.md index 77b8af02..4de24a3a 100644 --- a/packages/create-starknet/templates/next/README-template.md +++ b/packages/create-starknet/templates/next/README-template.md @@ -10,15 +10,13 @@ npm run dev yarn dev # or pnpm dev +# or +bun 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. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. @@ -35,4 +33,4 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next 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 the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/packages/create-starknet/templates/next/components/Header.tsx b/packages/create-starknet/templates/next/components/Header.tsx deleted file mode 100644 index 3d9509c2..00000000 --- a/packages/create-starknet/templates/next/components/Header.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import { useAccount, useDisconnect } from "@starknet-react/core" -import ConnectModal from "./starknet/ConnectModal"; - -export default function Header() { - const { address } = useAccount() - const { disconnect } = useDisconnect(); - - return ( -
-
- {address ? -
-

{`${address.slice(0, 6)}...${address.slice(-4)}`}

-

disconnect()} className="cursor-pointer text-black/50">Disconnect

-
- : } -
- ) -} \ No newline at end of file diff --git a/packages/create-starknet/templates/next/components/starknet/ConnectModal.tsx b/packages/create-starknet/templates/next/components/starknet/ConnectModal.tsx deleted file mode 100644 index b984c20c..00000000 --- a/packages/create-starknet/templates/next/components/starknet/ConnectModal.tsx +++ /dev/null @@ -1,29 +0,0 @@ -"use client"; -import React from "react"; -import { useConnect, Connector } from "@starknet-react/core"; -import { Button } from "../ui/Button"; -import Dialog from "../ui/Dialog"; - -export default function ConnectModal() { - const { connect, connectors } = useConnect(); - - return ( - -
- {connectors.map((connector: Connector) => { - return - })} -
-
- ); -} diff --git a/packages/create-starknet/templates/next/components/ui/Dialog.tsx b/packages/create-starknet/templates/next/components/ui/Dialog.tsx deleted file mode 100644 index 1ecc370f..00000000 --- a/packages/create-starknet/templates/next/components/ui/Dialog.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; -import { Button } from './Button'; - -export default function Dialog({ children, title }: { children: React.ReactNode, title: string }) { - const [isOpen, setIsOpen] = React.useState(false); - - return ( -
- - {isOpen && ( -
-
-
-

{title}

- -
- {children} -
-
- )} -
- ); -} diff --git a/packages/create-starknet/templates/next/next.config.js b/packages/create-starknet/templates/next/next.config.js index 91ef62f0..658404ac 100644 --- a/packages/create-starknet/templates/next/next.config.js +++ b/packages/create-starknet/templates/next/next.config.js @@ -1,6 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = { - reactStrictMode: true, -}; +const nextConfig = {}; module.exports = nextConfig; diff --git a/packages/create-starknet/templates/next/package.json b/packages/create-starknet/templates/next/package.json index b0f15469..5e639ca0 100644 --- a/packages/create-starknet/templates/next/package.json +++ b/packages/create-starknet/templates/next/package.json @@ -9,24 +9,23 @@ "lint": "next lint" }, "dependencies": { - "@next/font": "13.1.6", - "@starknet-react/chains": "^0.1.0-next.1", + "@starknet-react/chains": "0.1.0-next.1", "@starknet-react/core": "2.0.0-next.6", "get-starknet-core": "^3.2.0", - "next": "^14.0.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "starknet": "^5.19.5", - "tailwindcss": "^3.3.5" + "next": "14.0.2", + "react": "^18", + "react-dom": "^18", + "starknet": "^5.19.5" }, "devDependencies": { - "@types/node": "18.11.18", - "@types/react": "^18.2.37", - "@types/react-dom": "^18.2.15", - "autoprefixer": "^10.4.16", - "eslint": "8.33.0", - "eslint-config-next": "13.1.6", - "postcss": "^8.4.31", - "typescript": "4.9.5" + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "autoprefixer": "^10.0.1", + "eslint": "^8", + "eslint-config-next": "14.0.2", + "postcss": "^8", + "tailwindcss": "^3.3.0", + "typescript": "^5" } } diff --git a/packages/create-starknet/templates/next/pages/_app.tsx b/packages/create-starknet/templates/next/pages/_app.tsx deleted file mode 100644 index 27cc766d..00000000 --- a/packages/create-starknet/templates/next/pages/_app.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import type { AppProps } from "next/app"; -import { devnet, goerli, mainnet } from "@starknet-react/chains"; -import { - StarknetConfig, - publicProvider, - argent, - braavos, - useInjectedConnectors, -} from "@starknet-react/core"; -import "./globals.css" - -export default function App({ Component, pageProps }: AppProps) { - const chains = [goerli, mainnet, devnet]; - const provider = publicProvider(); - const { connectors } = useInjectedConnectors({ - // Show these connectors if the user has no connector installed. - recommended: [ - argent(), - braavos(), - ], - // Randomize the order of the connectors. - order: "random" - }); - - return ( - - - - ); -} diff --git a/packages/create-starknet/templates/next/pages/_document.tsx b/packages/create-starknet/templates/next/pages/_document.tsx deleted file mode 100644 index ffc3f3cc..00000000 --- a/packages/create-starknet/templates/next/pages/_document.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Head, Html, Main, NextScript } from "next/document"; - -export default function Document() { - return ( - - - -
- - - - ); -} diff --git a/packages/create-starknet/templates/next/pages/globals.css b/packages/create-starknet/templates/next/pages/globals.css deleted file mode 100644 index 4e9b1692..00000000 --- a/packages/create-starknet/templates/next/pages/globals.css +++ /dev/null @@ -1,20 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 255, 255, 255; - --background-end-rgb: 255, 255, 255; - } - - body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); - } - \ No newline at end of file diff --git a/packages/create-starknet/templates/next/pages/index.tsx b/packages/create-starknet/templates/next/pages/index.tsx deleted file mode 100644 index 077c881d..00000000 --- a/packages/create-starknet/templates/next/pages/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import Head from "next/head"; -import Header from "@/components/Header"; - -export default function Home() { - return ( - <> - - Create Starknet - - - - -
-
-

- Get started by editing  - pages/index.tsx -

-
- - starknet-icon -

- Starknet Documentation{">"} -

-
- - react-icon -

- Starknet React Documentation{">"} -

-
-
-
- - ); -} diff --git a/packages/create-starknet/templates/next/postcss.config.js b/packages/create-starknet/templates/next/postcss.config.js index 33ad091d..12a703d9 100644 --- a/packages/create-starknet/templates/next/postcss.config.js +++ b/packages/create-starknet/templates/next/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/packages/create-starknet/templates/next/public/next.svg b/packages/create-starknet/templates/next/public/next.svg new file mode 100644 index 00000000..5174b28c --- /dev/null +++ b/packages/create-starknet/templates/next/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/create-starknet/templates/next/public/vercel.svg b/packages/create-starknet/templates/next/public/vercel.svg new file mode 100644 index 00000000..d2f84222 --- /dev/null +++ b/packages/create-starknet/templates/next/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/create-starknet/templates/next/public/favicon.ico b/packages/create-starknet/templates/next/src/app/favicon.ico similarity index 100% rename from packages/create-starknet/templates/next/public/favicon.ico rename to packages/create-starknet/templates/next/src/app/favicon.ico diff --git a/packages/create-starknet/templates/next/src/app/globals.css b/packages/create-starknet/templates/next/src/app/globals.css new file mode 100644 index 00000000..fd81e885 --- /dev/null +++ b/packages/create-starknet/templates/next/src/app/globals.css @@ -0,0 +1,27 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} diff --git a/packages/create-starknet/templates/next/src/app/layout.tsx b/packages/create-starknet/templates/next/src/app/layout.tsx new file mode 100644 index 00000000..701b99ba --- /dev/null +++ b/packages/create-starknet/templates/next/src/app/layout.tsx @@ -0,0 +1,25 @@ +import type { Metadata } from 'next' +import { Inter } from 'next/font/google' +import { StarknetProvider } from '@/components/starknet-provider' +import './globals.css' + +const inter = Inter({ subsets: ['latin'] }) + +export const metadata: Metadata = { + title: 'Create Next App', + description: 'Generated by create next app', +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + + {children} + + + ); +} diff --git a/packages/create-starknet/templates/next/src/app/page.tsx b/packages/create-starknet/templates/next/src/app/page.tsx new file mode 100644 index 00000000..b3e73c1f --- /dev/null +++ b/packages/create-starknet/templates/next/src/app/page.tsx @@ -0,0 +1,51 @@ +import WalletBar from "@/components/WalletBar"; + +export default function Home() { + return ( +
+ +

+ Get started by editing  + pages/index.tsx +

+
+ + starknet-icon +

+ Starknet Documentation + + {">"} + +

+
+ + react-icon +

+ Starknet React Documentation + + {">"} + +

+
+
+
+ ); +} diff --git a/packages/create-starknet/templates/next/components/WalletBar.tsx b/packages/create-starknet/templates/next/src/components/WalletBar.tsx similarity index 60% rename from packages/create-starknet/templates/next/components/WalletBar.tsx rename to packages/create-starknet/templates/next/src/components/WalletBar.tsx index 4eb93bf6..c6cc4ca7 100644 --- a/packages/create-starknet/templates/next/components/WalletBar.tsx +++ b/packages/create-starknet/templates/next/src/components/WalletBar.tsx @@ -1,9 +1,11 @@ -import { useAccount, useConnectors } from "@starknet-react/core"; +"use client"; +import { useAccount, useConnect, useDisconnect } from "@starknet-react/core"; import { useMemo } from "react"; +import { Button } from "./ui/Button"; function WalletConnected() { const { address } = useAccount(); - const { disconnect } = useConnectors(); + const { disconnect } = useDisconnect(); const shortenedAddress = useMemo(() => { if (!address) return ""; @@ -13,28 +15,26 @@ function WalletConnected() { return (
Connected: {shortenedAddress} - +
); } function ConnectWallet() { - const { connectors, connect } = useConnectors(); + const { connectors, connect } = useConnect(); return (
- Choose a wallet: + Choose a wallet: {connectors.map((connector) => { return ( - + ); })}
diff --git a/packages/create-starknet/templates/next/src/components/starknet-provider.tsx b/packages/create-starknet/templates/next/src/components/starknet-provider.tsx new file mode 100644 index 00000000..1fc05e22 --- /dev/null +++ b/packages/create-starknet/templates/next/src/components/starknet-provider.tsx @@ -0,0 +1,32 @@ +"use client"; +import { ReactNode } from "react"; + +import { goerli, mainnet } from "@starknet-react/chains"; +import { + StarknetConfig, + publicProvider, + argent, + braavos, + useInjectedConnectors, +} from "@starknet-react/core"; + +export function StarknetProvider({ children }: { children: ReactNode }) { + const { connectors } = useInjectedConnectors({ + // Show these connectors if the user has no connector installed. + recommended: [argent(), braavos()], + // Hide recommended connectors if the user has any connector installed. + includeRecommended: "onlyIfNoConnectors", + // Randomize the order of the connectors. + order: "random", + }); + + return ( + + {children} + + ); +} diff --git a/packages/create-starknet/templates/next/components/ui/Button.tsx b/packages/create-starknet/templates/next/src/components/ui/Button.tsx similarity index 52% rename from packages/create-starknet/templates/next/components/ui/Button.tsx rename to packages/create-starknet/templates/next/src/components/ui/Button.tsx index 9740de09..855b232a 100644 --- a/packages/create-starknet/templates/next/components/ui/Button.tsx +++ b/packages/create-starknet/templates/next/src/components/ui/Button.tsx @@ -1,17 +1,19 @@ import React from "react"; interface ButtonProps extends React.ButtonHTMLAttributes { - children: React.ReactNode + children: React.ReactNode; } export const Button = ({ children, ...props }: ButtonProps) => { return ( - - ) - -} - - - + ); +}; diff --git a/packages/create-starknet/templates/next/tailwind.config.js b/packages/create-starknet/templates/next/tailwind.config.js deleted file mode 100644 index 6aa0dc48..00000000 --- a/packages/create-starknet/templates/next/tailwind.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - './pages/**/*.{js,ts,jsx,tsx,mdx}', - './components/**/*.{js,ts,jsx,tsx,mdx}', - './app/**/*.{js,ts,jsx,tsx,mdx}', - ], - theme: { - extend: {}, - }, - plugins: [], -}; diff --git a/packages/create-starknet/templates/next/tailwind.config.ts b/packages/create-starknet/templates/next/tailwind.config.ts new file mode 100644 index 00000000..e9a0944e --- /dev/null +++ b/packages/create-starknet/templates/next/tailwind.config.ts @@ -0,0 +1,20 @@ +import type { Config } from "tailwindcss"; + +const config: Config = { + content: [ + "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", + "./src/components/**/*.{js,ts,jsx,tsx,mdx}", + "./src/app/**/*.{js,ts,jsx,tsx,mdx}", + ], + theme: { + extend: { + backgroundImage: { + "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", + "gradient-conic": + "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", + }, + }, + }, + plugins: [], +}; +export default config; diff --git a/packages/create-starknet/templates/next/tsconfig.json b/packages/create-starknet/templates/next/tsconfig.json index f4ab65fd..e59724b2 100644 --- a/packages/create-starknet/templates/next/tsconfig.json +++ b/packages/create-starknet/templates/next/tsconfig.json @@ -5,20 +5,23 @@ "allowJs": true, "skipLibCheck": true, "strict": true, - "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "incremental": true, - "baseUrl": ".", + "plugins": [ + { + "name": "next" + } + ], "paths": { - "@/*": ["./*"] + "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] } diff --git a/packages/create-starknet/templates/vite/.eslintrc.cjs b/packages/create-starknet/templates/vite/.eslintrc.cjs index 1e1167f2..5d94793c 100644 --- a/packages/create-starknet/templates/vite/.eslintrc.cjs +++ b/packages/create-starknet/templates/vite/.eslintrc.cjs @@ -1,35 +1,29 @@ module.exports = { - "env": { - "browser": true, - "es2021": true + env: { + browser: true, + es2021: true, + }, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react/recommended", + ], + overrides: [ + { + env: { + node: true, + }, + files: [".eslintrc.{js,cjs}"], + parserOptions: { + sourceType: "script", + }, }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended" - ], - "overrides": [ - { - "env": { - "node": true - }, - "files": [ - ".eslintrc.{js,cjs}" - ], - "parserOptions": { - "sourceType": "script" - } - } - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "react" - ], - "rules": { - } -} + ], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + plugins: ["@typescript-eslint", "react"], + rules: {}, +}; diff --git a/packages/create-starknet/templates/vite/postcss.config.cjs b/packages/create-starknet/templates/vite/postcss.config.cjs index 33ad091d..12a703d9 100644 --- a/packages/create-starknet/templates/vite/postcss.config.cjs +++ b/packages/create-starknet/templates/vite/postcss.config.cjs @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/packages/create-starknet/templates/vite/src/App.tsx b/packages/create-starknet/templates/vite/src/App.tsx index 7de60a9e..9310021e 100644 --- a/packages/create-starknet/templates/vite/src/App.tsx +++ b/packages/create-starknet/templates/vite/src/App.tsx @@ -1,6 +1,6 @@ // import { useBlock } from "@starknet-react/core"; import Header from "./components/Header"; -import React from 'react'; +import React from "react"; function App() { return ( @@ -11,16 +11,40 @@ function App() { src/App.tsx

- - starknet-icon + + starknet-icon

- Starknet Documentation{">"} + Starknet Documentation + + {">"} +

- - react-icon + + react-icon

- Starknet React Documentation{">"} + Starknet React Documentation + + {">"} +

diff --git a/packages/create-starknet/templates/vite/src/components/Header.tsx b/packages/create-starknet/templates/vite/src/components/Header.tsx index 3d9509c2..b9c13c2a 100644 --- a/packages/create-starknet/templates/vite/src/components/Header.tsx +++ b/packages/create-starknet/templates/vite/src/components/Header.tsx @@ -1,20 +1,30 @@ import React from "react"; -import { useAccount, useDisconnect } from "@starknet-react/core" +import { useAccount, useDisconnect } from "@starknet-react/core"; import ConnectModal from "./starknet/ConnectModal"; export default function Header() { - const { address } = useAccount() - const { disconnect } = useDisconnect(); + const { address } = useAccount(); + const { disconnect } = useDisconnect(); - return ( -
-
- {address ? -
-

{`${address.slice(0, 6)}...${address.slice(-4)}`}

-

disconnect()} className="cursor-pointer text-black/50">Disconnect

-
- : } + return ( +
+
+ {address ? ( +
+

{`${address.slice( + 0, + 6, + )}...${address.slice(-4)}`}

+

disconnect()} + className="cursor-pointer text-black/50" + > + Disconnect +

- ) -} \ No newline at end of file + ) : ( + + )} +
+ ); +} diff --git a/packages/create-starknet/templates/vite/src/components/starknet/ConnectModal.tsx b/packages/create-starknet/templates/vite/src/components/starknet/ConnectModal.tsx index 09b3f4d1..70b74f4e 100644 --- a/packages/create-starknet/templates/vite/src/components/starknet/ConnectModal.tsx +++ b/packages/create-starknet/templates/vite/src/components/starknet/ConnectModal.tsx @@ -7,24 +7,28 @@ import Dialog from "../ui/Dialog"; export default function ConnectModal() { const { connect, connectors } = useConnect(); - console.log(connectors) + console.log(connectors); return (
{connectors.map((connector: Connector) => { - return + return ( + + ); })}
); -} \ No newline at end of file +} diff --git a/packages/create-starknet/templates/vite/src/components/ui/Button.tsx b/packages/create-starknet/templates/vite/src/components/ui/Button.tsx index 9740de09..e4138be2 100644 --- a/packages/create-starknet/templates/vite/src/components/ui/Button.tsx +++ b/packages/create-starknet/templates/vite/src/components/ui/Button.tsx @@ -1,17 +1,19 @@ import React from "react"; interface ButtonProps extends React.ButtonHTMLAttributes { - children: React.ReactNode + children: React.ReactNode; } export const Button = ({ children, ...props }: ButtonProps) => { return ( - - ) - -} - - - + ); +}; diff --git a/packages/create-starknet/templates/vite/src/components/ui/Dialog.tsx b/packages/create-starknet/templates/vite/src/components/ui/Dialog.tsx index 1ecc370f..9abc779a 100644 --- a/packages/create-starknet/templates/vite/src/components/ui/Dialog.tsx +++ b/packages/create-starknet/templates/vite/src/components/ui/Dialog.tsx @@ -1,25 +1,32 @@ -import React from 'react'; -import { Button } from './Button'; +import React from "react"; +import { Button } from "./Button"; -export default function Dialog({ children, title }: { children: React.ReactNode, title: string }) { - const [isOpen, setIsOpen] = React.useState(false); +export default function Dialog({ + children, + title, +}: { children: React.ReactNode; title: string }) { + const [isOpen, setIsOpen] = React.useState(false); - return ( -
- - {isOpen && ( -
-
-
-

{title}

- -
- {children} -
-
- )} + return ( +
+ + {isOpen && ( +
+
+
+

{title}

+ +
+ {children} +
- ); + )} +
+ ); } diff --git a/packages/create-starknet/templates/vite/src/main.tsx b/packages/create-starknet/templates/vite/src/main.tsx index 5e38534f..9eea3c98 100644 --- a/packages/create-starknet/templates/vite/src/main.tsx +++ b/packages/create-starknet/templates/vite/src/main.tsx @@ -1,28 +1,33 @@ -import { StarknetConfig, argent, braavos, publicProvider, useInjectedConnectors } from "@starknet-react/core"; +import { + StarknetConfig, + argent, + braavos, + publicProvider, + useInjectedConnectors, +} from "@starknet-react/core"; import { devnet, goerli, mainnet } from "@starknet-react/chains"; import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; -import "./globals.css" +import "./globals.css"; function Root({ children }: { children: React.ReactNode }) { const chains = [goerli, mainnet, devnet]; const provider = publicProvider(); const { connectors } = useInjectedConnectors({ // Show these connectors if the user has no connector installed. - recommended: [ - argent(), - braavos(), - ], + recommended: [argent(), braavos()], // Randomize the order of the connectors. - order: "random" + order: "random", }); return ( - + connectors={connectors} + > {children} ); diff --git a/packages/create-starknet/templates/vite/tailwind.config.js b/packages/create-starknet/templates/vite/tailwind.config.js index 368885ac..90246381 100644 --- a/packages/create-starknet/templates/vite/tailwind.config.js +++ b/packages/create-starknet/templates/vite/tailwind.config.js @@ -1,8 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: [ - './src/**/*.{js,ts,jsx,tsx,mdx}', - ], + content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"], theme: { extend: {}, },