From 23e3d112c3dd5803e199c12ac844b43f0a3daefc Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:27:14 -0400 Subject: [PATCH 1/2] chore(template): reformat app and component content files --- .../src/app/development/page.tsx | 14 ++-- .../next-template/src/app/layout.tsx | 22 +++--- .../templates/next-template/src/app/page.tsx | 6 +- .../next-template/src/app/resources/page.tsx | 10 +-- .../src/app/resources/resources.ts | 58 +++++++------- .../src/components/default/index.tsx | 62 +++++++-------- .../src/components/landing/index.tsx | 76 +++++++++++++++---- 7 files changed, 148 insertions(+), 100 deletions(-) diff --git a/packages/create-sei/templates/next-template/src/app/development/page.tsx b/packages/create-sei/templates/next-template/src/app/development/page.tsx index 39fa5ecc9..8ae1892b7 100644 --- a/packages/create-sei/templates/next-template/src/app/development/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/development/page.tsx @@ -1,8 +1,8 @@ -'use client'; +"use client"; -import { Shell } from '@/components'; -import { Button, Card, Code, Container, Group, Paper, Stack, Text, ThemeIcon, Title } from '@mantine/core'; -import { IconCode, IconExternalLink } from '@tabler/icons-react'; +import { Button, Card, Code, Container, Group, Paper, Stack, Text, ThemeIcon, Title } from "@mantine/core"; +import { IconCode, IconExternalLink } from "@tabler/icons-react"; +import { Shell } from "@/components"; export default function DevelopmentPage() { return ( @@ -42,7 +42,7 @@ export default function DevelopmentPage() { component="a" href="https://wagmi.sh/react/getting-started" target="_blank" - style={{ textDecoration: 'none', cursor: 'pointer' }} + style={{ textDecoration: "none", cursor: "pointer" }} > @@ -62,7 +62,7 @@ export default function DevelopmentPage() { component="a" href="https://viem.sh/" target="_blank" - style={{ textDecoration: 'none', cursor: 'pointer' }} + style={{ textDecoration: "none", cursor: "pointer" }} > @@ -82,7 +82,7 @@ export default function DevelopmentPage() { component="a" href="https://www.rainbowkit.com/docs/introduction" target="_blank" - style={{ textDecoration: 'none', cursor: 'pointer' }} + style={{ textDecoration: "none", cursor: "pointer" }} > diff --git a/packages/create-sei/templates/next-template/src/app/layout.tsx b/packages/create-sei/templates/next-template/src/app/layout.tsx index fe9ddc458..bc0c4f103 100644 --- a/packages/create-sei/templates/next-template/src/app/layout.tsx +++ b/packages/create-sei/templates/next-template/src/app/layout.tsx @@ -1,18 +1,18 @@ -import { Providers } from '@/components/providers'; -import { ColorSchemeScript } from '@mantine/core'; -import type { Metadata } from 'next'; -import { Inter } from 'next/font/google'; -import type { ReactNode } from 'react'; +import { ColorSchemeScript } from "@mantine/core"; +import type { Metadata } from "next"; +import { Inter } from "next/font/google"; +import type { ReactNode } from "react"; +import { Providers } from "@/components/providers"; -import './globals.css'; -import '@mantine/core/styles.css'; -import '@mantine/notifications/styles.css'; +import "./globals.css"; +import "@mantine/core/styles.css"; +import "@mantine/notifications/styles.css"; -const inter = Inter({ subsets: ['latin'] }); +const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: 'Sei Next App (Wagmi)', - description: 'Generated by create sei app', + title: "Sei Next App (Wagmi)", + description: "Generated by create sei app", }; export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) { diff --git a/packages/create-sei/templates/next-template/src/app/page.tsx b/packages/create-sei/templates/next-template/src/app/page.tsx index 1d4d17543..de8777e45 100644 --- a/packages/create-sei/templates/next-template/src/app/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/page.tsx @@ -1,7 +1,7 @@ -'use client'; +"use client"; -import { Default, Landing, Shell } from '@/components'; -import { useAccount } from 'wagmi'; +import { useAccount } from "wagmi"; +import { Default, Landing, Shell } from "@/components"; export default function Home() { const { isConnected } = useAccount(); diff --git a/packages/create-sei/templates/next-template/src/app/resources/page.tsx b/packages/create-sei/templates/next-template/src/app/resources/page.tsx index 5da463e9c..1a69928df 100644 --- a/packages/create-sei/templates/next-template/src/app/resources/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/resources/page.tsx @@ -1,7 +1,7 @@ -import { developerResources, socialLinks } from '@/app/resources/resources'; -import { Shell } from '@/components'; -import { Card, Code, Container, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from '@mantine/core'; -import { IconBook, IconRobot, IconTerminal } from '@tabler/icons-react'; +import { Card, Code, Container, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core"; +import { IconBook, IconRobot, IconTerminal } from "@tabler/icons-react"; +import { developerResources, socialLinks } from "@/app/resources/resources"; +import { Shell } from "@/components"; export default function ResourcesPage() { return ( @@ -151,7 +151,7 @@ export default function ResourcesPage() { {socialLinks.map(({ title, description, href, icon: Icon, color }) => ( - + diff --git a/packages/create-sei/templates/next-template/src/app/resources/resources.ts b/packages/create-sei/templates/next-template/src/app/resources/resources.ts index fab49dd6a..411ffd8be 100644 --- a/packages/create-sei/templates/next-template/src/app/resources/resources.ts +++ b/packages/create-sei/templates/next-template/src/app/resources/resources.ts @@ -1,56 +1,56 @@ -import { IconBook, IconBrandTelegram, IconBrandX, IconCode, IconPackage } from '@tabler/icons-react'; +import { IconBook, IconBrandTelegram, IconBrandX, IconCode, IconPackage } from "@tabler/icons-react"; export const developerResources = [ { - title: 'Sei Docs', - description: 'Official protocol docs, guides, and references.', - href: 'https://docs.sei.io/', + title: "Sei Docs", + description: "Official protocol docs, guides, and references.", + href: "https://docs.sei.io/", icon: IconBook, - color: 'violet', + color: "violet", }, { - title: '@sei-js docs', - description: 'SDKs, examples, templates, and tooling for Sei.', - href: 'https://sei-js.docs.sei.io/introduction', + title: "@sei-js docs", + description: "SDKs, examples, templates, and tooling for Sei.", + href: "https://sei-js.docs.sei.io/introduction", icon: IconBook, - color: 'grape', + color: "grape", }, { - title: 'Wagmi', - description: 'React hooks for Ethereum development.', - href: 'https://wagmi.sh/', + title: "Wagmi", + description: "React hooks for Ethereum development.", + href: "https://wagmi.sh/", icon: IconCode, - color: 'blue', + color: "blue", }, { - title: 'Viem', - description: 'TypeScript interface for Ethereum.', - href: 'https://viem.sh/', + title: "Viem", + description: "TypeScript interface for Ethereum.", + href: "https://viem.sh/", icon: IconPackage, - color: 'green', + color: "green", }, ] as const; export const socialLinks = [ { - title: 'Developer Telegram', - description: 'Chat with the community and get support.', - href: 'https://t.me/seinetwork', + title: "Developer Telegram", + description: "Chat with the community and get support.", + href: "https://t.me/seinetwork", icon: IconBrandTelegram, - color: 'cyan', + color: "cyan", }, { - title: 'Sei on X', - description: 'Follow Sei Network updates on X (Twitter).', - href: 'https://x.com/SeiNetwork', + title: "Sei on X", + description: "Follow Sei Network updates on X (Twitter).", + href: "https://x.com/SeiNetwork", icon: IconBrandX, - color: 'dark', + color: "dark", }, { - title: 'Sei Labs on X', - description: 'Follow Sei Labs announcements on X (Twitter).', - href: 'https://x.com/Sei_Labs', + title: "Sei Labs on X", + description: "Follow Sei Labs announcements on X (Twitter).", + href: "https://x.com/Sei_Labs", icon: IconBrandX, - color: 'dark', + color: "dark", }, ] as const; diff --git a/packages/create-sei/templates/next-template/src/components/default/index.tsx b/packages/create-sei/templates/next-template/src/components/default/index.tsx index a8a5a909a..15fbec2f0 100644 --- a/packages/create-sei/templates/next-template/src/components/default/index.tsx +++ b/packages/create-sei/templates/next-template/src/components/default/index.tsx @@ -1,6 +1,6 @@ -'use client'; +"use client"; -import { CodeHighlight } from '@mantine/code-highlight'; +import { CodeHighlight } from "@mantine/code-highlight"; import { ActionIcon, Alert, @@ -19,18 +19,18 @@ import { TextInput, ThemeIcon, Title, -} from '@mantine/core'; -import { notifications } from '@mantine/notifications'; -import { IconBulb, IconChevronDown, IconChevronUp, IconCoins, IconCopy, IconLogout, IconSend, IconWallet } from '@tabler/icons-react'; -import { useState } from 'react'; -import { formatEther, parseEther } from 'viem'; -import { useAccount, useDisconnect, usePublicClient, useSendTransaction, useWaitForTransactionReceipt } from 'wagmi'; -import { balanceCodeExample, transactionCodeExample, walletCodeExample } from './examples'; +} from "@mantine/core"; +import { notifications } from "@mantine/notifications"; +import { IconBulb, IconChevronDown, IconChevronUp, IconCoins, IconCopy, IconLogout, IconSend, IconWallet } from "@tabler/icons-react"; +import { useState } from "react"; +import { formatEther, parseEther } from "viem"; +import { useAccount, useDisconnect, usePublicClient, useSendTransaction, useWaitForTransactionReceipt } from "wagmi"; +import { balanceCodeExample, transactionCodeExample, walletCodeExample } from "./examples"; function Examples() { - const [balance, setBalance] = useState(''); - const [recipient, setRecipient] = useState(''); - const [amount, setAmount] = useState(''); + const [balance, setBalance] = useState(""); + const [recipient, setRecipient] = useState(""); + const [amount, setAmount] = useState(""); // Code visibility toggles const [showWalletCode, setShowWalletCode] = useState(false); @@ -51,17 +51,17 @@ function Examples() { try { navigator.clipboard.writeText(text).then(() => { notifications.show({ - title: 'Copied!', - message: 'Code copied to clipboard', - color: 'green', + title: "Copied!", + message: "Code copied to clipboard", + color: "green", }); }); } catch (err) { - console.error('Failed to copy text: ', err); + console.error("Failed to copy text: ", err); notifications.show({ - title: 'Error', - message: 'Failed to copy to clipboard', - color: 'red', + title: "Error", + message: "Failed to copy to clipboard", + color: "red", }); } }; @@ -78,9 +78,9 @@ function Examples() { const sendSei = async () => { if (!recipient || !amount) { notifications.show({ - title: 'Missing Information', - message: 'Please enter recipient address and amount', - color: 'orange', + title: "Missing Information", + message: "Please enter recipient address and amount", + color: "orange", }); return; } @@ -91,11 +91,11 @@ function Examples() { value: parseEther(amount), }); } catch (error) { - console.error('Transaction error:', error); + console.error("Transaction error:", error); notifications.show({ - title: 'Transaction Error', - message: 'Failed to send transaction', - color: 'red', + title: "Transaction Error", + message: "Failed to send transaction", + color: "red", }); } }; @@ -147,7 +147,7 @@ function Examples() { - {address || 'No wallet connected'} + {address || "No wallet connected"} {isConnected && address && ( @@ -171,7 +171,7 @@ function Examples() { leftSection={showWalletCode ? : } onClick={() => setShowWalletCode(!showWalletCode)} > - {showWalletCode ? 'Hide' : 'View'} Implementation + {showWalletCode ? "Hide" : "View"} Implementation {showWalletCode && ( copyToClipboard(walletCodeExample)}> @@ -247,7 +247,7 @@ function Examples() { color="green" leftSection={} > - {balance ? 'Refresh' : 'Check Balance'} + {balance ? "Refresh" : "Check Balance"} @@ -261,7 +261,7 @@ function Examples() { leftSection={showBalanceCode ? : } onClick={() => setShowBalanceCode(!showBalanceCode)} > - {showBalanceCode ? 'Hide' : 'View'} Implementation + {showBalanceCode ? "Hide" : "View"} Implementation {showBalanceCode && ( copyToClipboard(balanceCodeExample)}> @@ -377,7 +377,7 @@ function Examples() { leftSection={showTransactionCode ? : } onClick={() => setShowTransactionCode(!showTransactionCode)} > - {showTransactionCode ? 'Hide' : 'View'} Implementation + {showTransactionCode ? "Hide" : "View"} Implementation {showTransactionCode && ( copyToClipboard(transactionCodeExample)}> diff --git a/packages/create-sei/templates/next-template/src/components/landing/index.tsx b/packages/create-sei/templates/next-template/src/components/landing/index.tsx index fb0654f7e..758d6f08c 100644 --- a/packages/create-sei/templates/next-template/src/components/landing/index.tsx +++ b/packages/create-sei/templates/next-template/src/components/landing/index.tsx @@ -1,9 +1,9 @@ -'use client'; +"use client"; -import { Badge, Button, Card, Code, Container, Group, Stack, Text, ThemeIcon, Title } from '@mantine/core'; -import { ConnectButton } from '@rainbow-me/rainbowkit'; -import { IconBook, IconCode, IconRocket } from '@tabler/icons-react'; -import Link from 'next/link'; +import { Badge, Button, Card, Code, Container, Group, Stack, Text, ThemeIcon, Title } from "@mantine/core"; +import { ConnectButton } from "@rainbow-me/rainbowkit"; +import { IconBook, IconCode, IconRocket } from "@tabler/icons-react"; +import Link from "next/link"; export default function Landing() { return ( @@ -21,33 +21,81 @@ export default function Landing() { {/* Tech Stack Badges */} - + Next.js 14 Mantine UI - + Tailwind CSS - + Biome RainbowKit - + Wagmi + Viem - + Vercel @@ -61,7 +109,7 @@ export default function Landing() { bg="gradient-to-r from-blue-50 to-purple-50" w="100%" maw={600} - style={{ border: '2px solid var(--mantine-color-blue-2)' }} + style={{ border: "2px solid var(--mantine-color-blue-2)" }} > @@ -82,7 +130,7 @@ export default function Landing() { {/* Development Tip */} - 💡 Development Tip: Start by exploring the examples in the connected app, then customize{' '} + 💡 Development Tip: Start by exploring the examples in the connected app, then customize{" "} src/components/default/index.tsx to build your unique dApp features. From e6f7231563373a07615912debf17192b774e9b59 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:03:00 -0400 Subject: [PATCH 2/2] Normalize quotes and format imports Apply code-style normalization across the Next template: convert double quotes to single quotes, adjust import ordering and minor spacing/quote fixes in various app pages and components. Affected files under packages/create-sei/templates/next-template: src/app/development/page.tsx, src/app/layout.tsx, src/app/page.tsx, src/app/resources/page.tsx, src/app/resources/resources.ts, src/components/default/index.tsx, and src/components/landing/index.tsx. No functional logic changes. --- .../src/app/development/page.tsx | 14 ++--- .../next-template/src/app/layout.tsx | 22 +++---- .../templates/next-template/src/app/page.tsx | 6 +- .../next-template/src/app/resources/page.tsx | 10 +-- .../src/app/resources/resources.ts | 58 ++++++++--------- .../src/components/default/index.tsx | 62 +++++++++---------- .../src/components/landing/index.tsx | 56 ++++++++--------- 7 files changed, 114 insertions(+), 114 deletions(-) diff --git a/packages/create-sei/templates/next-template/src/app/development/page.tsx b/packages/create-sei/templates/next-template/src/app/development/page.tsx index 8ae1892b7..39fa5ecc9 100644 --- a/packages/create-sei/templates/next-template/src/app/development/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/development/page.tsx @@ -1,8 +1,8 @@ -"use client"; +'use client'; -import { Button, Card, Code, Container, Group, Paper, Stack, Text, ThemeIcon, Title } from "@mantine/core"; -import { IconCode, IconExternalLink } from "@tabler/icons-react"; -import { Shell } from "@/components"; +import { Shell } from '@/components'; +import { Button, Card, Code, Container, Group, Paper, Stack, Text, ThemeIcon, Title } from '@mantine/core'; +import { IconCode, IconExternalLink } from '@tabler/icons-react'; export default function DevelopmentPage() { return ( @@ -42,7 +42,7 @@ export default function DevelopmentPage() { component="a" href="https://wagmi.sh/react/getting-started" target="_blank" - style={{ textDecoration: "none", cursor: "pointer" }} + style={{ textDecoration: 'none', cursor: 'pointer' }} > @@ -62,7 +62,7 @@ export default function DevelopmentPage() { component="a" href="https://viem.sh/" target="_blank" - style={{ textDecoration: "none", cursor: "pointer" }} + style={{ textDecoration: 'none', cursor: 'pointer' }} > @@ -82,7 +82,7 @@ export default function DevelopmentPage() { component="a" href="https://www.rainbowkit.com/docs/introduction" target="_blank" - style={{ textDecoration: "none", cursor: "pointer" }} + style={{ textDecoration: 'none', cursor: 'pointer' }} > diff --git a/packages/create-sei/templates/next-template/src/app/layout.tsx b/packages/create-sei/templates/next-template/src/app/layout.tsx index bc0c4f103..fe9ddc458 100644 --- a/packages/create-sei/templates/next-template/src/app/layout.tsx +++ b/packages/create-sei/templates/next-template/src/app/layout.tsx @@ -1,18 +1,18 @@ -import { ColorSchemeScript } from "@mantine/core"; -import type { Metadata } from "next"; -import { Inter } from "next/font/google"; -import type { ReactNode } from "react"; -import { Providers } from "@/components/providers"; +import { Providers } from '@/components/providers'; +import { ColorSchemeScript } from '@mantine/core'; +import type { Metadata } from 'next'; +import { Inter } from 'next/font/google'; +import type { ReactNode } from 'react'; -import "./globals.css"; -import "@mantine/core/styles.css"; -import "@mantine/notifications/styles.css"; +import './globals.css'; +import '@mantine/core/styles.css'; +import '@mantine/notifications/styles.css'; -const inter = Inter({ subsets: ["latin"] }); +const inter = Inter({ subsets: ['latin'] }); export const metadata: Metadata = { - title: "Sei Next App (Wagmi)", - description: "Generated by create sei app", + title: 'Sei Next App (Wagmi)', + description: 'Generated by create sei app', }; export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) { diff --git a/packages/create-sei/templates/next-template/src/app/page.tsx b/packages/create-sei/templates/next-template/src/app/page.tsx index de8777e45..1d4d17543 100644 --- a/packages/create-sei/templates/next-template/src/app/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/page.tsx @@ -1,7 +1,7 @@ -"use client"; +'use client'; -import { useAccount } from "wagmi"; -import { Default, Landing, Shell } from "@/components"; +import { Default, Landing, Shell } from '@/components'; +import { useAccount } from 'wagmi'; export default function Home() { const { isConnected } = useAccount(); diff --git a/packages/create-sei/templates/next-template/src/app/resources/page.tsx b/packages/create-sei/templates/next-template/src/app/resources/page.tsx index 1a69928df..5da463e9c 100644 --- a/packages/create-sei/templates/next-template/src/app/resources/page.tsx +++ b/packages/create-sei/templates/next-template/src/app/resources/page.tsx @@ -1,7 +1,7 @@ -import { Card, Code, Container, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core"; -import { IconBook, IconRobot, IconTerminal } from "@tabler/icons-react"; -import { developerResources, socialLinks } from "@/app/resources/resources"; -import { Shell } from "@/components"; +import { developerResources, socialLinks } from '@/app/resources/resources'; +import { Shell } from '@/components'; +import { Card, Code, Container, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from '@mantine/core'; +import { IconBook, IconRobot, IconTerminal } from '@tabler/icons-react'; export default function ResourcesPage() { return ( @@ -151,7 +151,7 @@ export default function ResourcesPage() { {socialLinks.map(({ title, description, href, icon: Icon, color }) => ( - + diff --git a/packages/create-sei/templates/next-template/src/app/resources/resources.ts b/packages/create-sei/templates/next-template/src/app/resources/resources.ts index 411ffd8be..fab49dd6a 100644 --- a/packages/create-sei/templates/next-template/src/app/resources/resources.ts +++ b/packages/create-sei/templates/next-template/src/app/resources/resources.ts @@ -1,56 +1,56 @@ -import { IconBook, IconBrandTelegram, IconBrandX, IconCode, IconPackage } from "@tabler/icons-react"; +import { IconBook, IconBrandTelegram, IconBrandX, IconCode, IconPackage } from '@tabler/icons-react'; export const developerResources = [ { - title: "Sei Docs", - description: "Official protocol docs, guides, and references.", - href: "https://docs.sei.io/", + title: 'Sei Docs', + description: 'Official protocol docs, guides, and references.', + href: 'https://docs.sei.io/', icon: IconBook, - color: "violet", + color: 'violet', }, { - title: "@sei-js docs", - description: "SDKs, examples, templates, and tooling for Sei.", - href: "https://sei-js.docs.sei.io/introduction", + title: '@sei-js docs', + description: 'SDKs, examples, templates, and tooling for Sei.', + href: 'https://sei-js.docs.sei.io/introduction', icon: IconBook, - color: "grape", + color: 'grape', }, { - title: "Wagmi", - description: "React hooks for Ethereum development.", - href: "https://wagmi.sh/", + title: 'Wagmi', + description: 'React hooks for Ethereum development.', + href: 'https://wagmi.sh/', icon: IconCode, - color: "blue", + color: 'blue', }, { - title: "Viem", - description: "TypeScript interface for Ethereum.", - href: "https://viem.sh/", + title: 'Viem', + description: 'TypeScript interface for Ethereum.', + href: 'https://viem.sh/', icon: IconPackage, - color: "green", + color: 'green', }, ] as const; export const socialLinks = [ { - title: "Developer Telegram", - description: "Chat with the community and get support.", - href: "https://t.me/seinetwork", + title: 'Developer Telegram', + description: 'Chat with the community and get support.', + href: 'https://t.me/seinetwork', icon: IconBrandTelegram, - color: "cyan", + color: 'cyan', }, { - title: "Sei on X", - description: "Follow Sei Network updates on X (Twitter).", - href: "https://x.com/SeiNetwork", + title: 'Sei on X', + description: 'Follow Sei Network updates on X (Twitter).', + href: 'https://x.com/SeiNetwork', icon: IconBrandX, - color: "dark", + color: 'dark', }, { - title: "Sei Labs on X", - description: "Follow Sei Labs announcements on X (Twitter).", - href: "https://x.com/Sei_Labs", + title: 'Sei Labs on X', + description: 'Follow Sei Labs announcements on X (Twitter).', + href: 'https://x.com/Sei_Labs', icon: IconBrandX, - color: "dark", + color: 'dark', }, ] as const; diff --git a/packages/create-sei/templates/next-template/src/components/default/index.tsx b/packages/create-sei/templates/next-template/src/components/default/index.tsx index 15fbec2f0..a8a5a909a 100644 --- a/packages/create-sei/templates/next-template/src/components/default/index.tsx +++ b/packages/create-sei/templates/next-template/src/components/default/index.tsx @@ -1,6 +1,6 @@ -"use client"; +'use client'; -import { CodeHighlight } from "@mantine/code-highlight"; +import { CodeHighlight } from '@mantine/code-highlight'; import { ActionIcon, Alert, @@ -19,18 +19,18 @@ import { TextInput, ThemeIcon, Title, -} from "@mantine/core"; -import { notifications } from "@mantine/notifications"; -import { IconBulb, IconChevronDown, IconChevronUp, IconCoins, IconCopy, IconLogout, IconSend, IconWallet } from "@tabler/icons-react"; -import { useState } from "react"; -import { formatEther, parseEther } from "viem"; -import { useAccount, useDisconnect, usePublicClient, useSendTransaction, useWaitForTransactionReceipt } from "wagmi"; -import { balanceCodeExample, transactionCodeExample, walletCodeExample } from "./examples"; +} from '@mantine/core'; +import { notifications } from '@mantine/notifications'; +import { IconBulb, IconChevronDown, IconChevronUp, IconCoins, IconCopy, IconLogout, IconSend, IconWallet } from '@tabler/icons-react'; +import { useState } from 'react'; +import { formatEther, parseEther } from 'viem'; +import { useAccount, useDisconnect, usePublicClient, useSendTransaction, useWaitForTransactionReceipt } from 'wagmi'; +import { balanceCodeExample, transactionCodeExample, walletCodeExample } from './examples'; function Examples() { - const [balance, setBalance] = useState(""); - const [recipient, setRecipient] = useState(""); - const [amount, setAmount] = useState(""); + const [balance, setBalance] = useState(''); + const [recipient, setRecipient] = useState(''); + const [amount, setAmount] = useState(''); // Code visibility toggles const [showWalletCode, setShowWalletCode] = useState(false); @@ -51,17 +51,17 @@ function Examples() { try { navigator.clipboard.writeText(text).then(() => { notifications.show({ - title: "Copied!", - message: "Code copied to clipboard", - color: "green", + title: 'Copied!', + message: 'Code copied to clipboard', + color: 'green', }); }); } catch (err) { - console.error("Failed to copy text: ", err); + console.error('Failed to copy text: ', err); notifications.show({ - title: "Error", - message: "Failed to copy to clipboard", - color: "red", + title: 'Error', + message: 'Failed to copy to clipboard', + color: 'red', }); } }; @@ -78,9 +78,9 @@ function Examples() { const sendSei = async () => { if (!recipient || !amount) { notifications.show({ - title: "Missing Information", - message: "Please enter recipient address and amount", - color: "orange", + title: 'Missing Information', + message: 'Please enter recipient address and amount', + color: 'orange', }); return; } @@ -91,11 +91,11 @@ function Examples() { value: parseEther(amount), }); } catch (error) { - console.error("Transaction error:", error); + console.error('Transaction error:', error); notifications.show({ - title: "Transaction Error", - message: "Failed to send transaction", - color: "red", + title: 'Transaction Error', + message: 'Failed to send transaction', + color: 'red', }); } }; @@ -147,7 +147,7 @@ function Examples() { - {address || "No wallet connected"} + {address || 'No wallet connected'} {isConnected && address && ( @@ -171,7 +171,7 @@ function Examples() { leftSection={showWalletCode ? : } onClick={() => setShowWalletCode(!showWalletCode)} > - {showWalletCode ? "Hide" : "View"} Implementation + {showWalletCode ? 'Hide' : 'View'} Implementation {showWalletCode && ( copyToClipboard(walletCodeExample)}> @@ -247,7 +247,7 @@ function Examples() { color="green" leftSection={} > - {balance ? "Refresh" : "Check Balance"} + {balance ? 'Refresh' : 'Check Balance'} @@ -261,7 +261,7 @@ function Examples() { leftSection={showBalanceCode ? : } onClick={() => setShowBalanceCode(!showBalanceCode)} > - {showBalanceCode ? "Hide" : "View"} Implementation + {showBalanceCode ? 'Hide' : 'View'} Implementation {showBalanceCode && ( copyToClipboard(balanceCodeExample)}> @@ -377,7 +377,7 @@ function Examples() { leftSection={showTransactionCode ? : } onClick={() => setShowTransactionCode(!showTransactionCode)} > - {showTransactionCode ? "Hide" : "View"} Implementation + {showTransactionCode ? 'Hide' : 'View'} Implementation {showTransactionCode && ( copyToClipboard(transactionCodeExample)}> diff --git a/packages/create-sei/templates/next-template/src/components/landing/index.tsx b/packages/create-sei/templates/next-template/src/components/landing/index.tsx index 758d6f08c..f17db6db9 100644 --- a/packages/create-sei/templates/next-template/src/components/landing/index.tsx +++ b/packages/create-sei/templates/next-template/src/components/landing/index.tsx @@ -1,9 +1,9 @@ -"use client"; +'use client'; -import { Badge, Button, Card, Code, Container, Group, Stack, Text, ThemeIcon, Title } from "@mantine/core"; -import { ConnectButton } from "@rainbow-me/rainbowkit"; -import { IconBook, IconCode, IconRocket } from "@tabler/icons-react"; -import Link from "next/link"; +import { Badge, Button, Card, Code, Container, Group, Stack, Text, ThemeIcon, Title } from '@mantine/core'; +import { ConnectButton } from '@rainbow-me/rainbowkit'; +import { IconBook, IconCode, IconRocket } from '@tabler/icons-react'; +import Link from 'next/link'; export default function Landing() { return ( @@ -25,9 +25,9 @@ export default function Landing() { variant="light" color="blue" style={{ - backgroundColor: "rgb(239 246 255)", - color: "rgb(29 78 216)", - border: "1px solid rgb(191 219 254)", + backgroundColor: 'rgb(239 246 255)', + color: 'rgb(29 78 216)', + border: '1px solid rgb(191 219 254)', }} > Next.js 14 @@ -36,9 +36,9 @@ export default function Landing() { variant="light" color="violet" style={{ - backgroundColor: "rgb(250 245 255)", - color: "rgb(109 40 217)", - border: "1px solid rgb(196 181 253)", + backgroundColor: 'rgb(250 245 255)', + color: 'rgb(109 40 217)', + border: '1px solid rgb(196 181 253)', }} > Mantine UI @@ -47,9 +47,9 @@ export default function Landing() { variant="light" color="cyan" style={{ - backgroundColor: "rgb(236 254 255)", - color: "rgb(14 116 144)", - border: "1px solid rgb(165 243 252)", + backgroundColor: 'rgb(236 254 255)', + color: 'rgb(14 116 144)', + border: '1px solid rgb(165 243 252)', }} > Tailwind CSS @@ -58,9 +58,9 @@ export default function Landing() { variant="light" color="yellow" style={{ - backgroundColor: "rgb(254 249 195)", - color: "rgb(161 98 7)", - border: "1px solid rgb(254 240 138)", + backgroundColor: 'rgb(254 249 195)', + color: 'rgb(161 98 7)', + border: '1px solid rgb(254 240 138)', }} > Biome @@ -69,9 +69,9 @@ export default function Landing() { variant="light" color="orange" style={{ - backgroundColor: "rgb(255 247 237)", - color: "rgb(194 65 12)", - border: "1px solid rgb(254 215 170)", + backgroundColor: 'rgb(255 247 237)', + color: 'rgb(194 65 12)', + border: '1px solid rgb(254 215 170)', }} > RainbowKit @@ -80,9 +80,9 @@ export default function Landing() { variant="light" color="teal" style={{ - backgroundColor: "rgb(240 253 250)", - color: "rgb(15 118 110)", - border: "1px solid rgb(153 246 228)", + backgroundColor: 'rgb(240 253 250)', + color: 'rgb(15 118 110)', + border: '1px solid rgb(153 246 228)', }} > Wagmi + Viem @@ -91,9 +91,9 @@ export default function Landing() { variant="light" color="dark" style={{ - backgroundColor: "rgb(249 250 251)", - color: "rgb(17 24 39)", - border: "1px solid rgb(209 213 219)", + backgroundColor: 'rgb(249 250 251)', + color: 'rgb(17 24 39)', + border: '1px solid rgb(209 213 219)', }} > Vercel @@ -109,7 +109,7 @@ export default function Landing() { bg="gradient-to-r from-blue-50 to-purple-50" w="100%" maw={600} - style={{ border: "2px solid var(--mantine-color-blue-2)" }} + style={{ border: '2px solid var(--mantine-color-blue-2)' }} > @@ -130,7 +130,7 @@ export default function Landing() { {/* Development Tip */} - 💡 Development Tip: Start by exploring the examples in the connected app, then customize{" "} + 💡 Development Tip: Start by exploring the examples in the connected app, then customize{' '} src/components/default/index.tsx to build your unique dApp features.