diff --git a/README.md b/README.md index 83b7eb4..5d1534a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,9 @@ -This project a [Vite](https://vitejs.dev/) app bootstrapped with [@near-js/client](https://github.com/near/near-api-js/tree/master/packages/client), [@tanstack/react-router](https://tanstack.com/router/latest), and [@tanstack/react-query](https://tanstack.com/query/latest). It uses [tailwind](https://tailwindcss.com/docs/installation) for styling, and offers a [playwright suite](https://playwright.dev/) for testing. +This project a [Vite](https://vitejs.dev/) app bootstrapped with [@near-js/client](https://github.com/near/near-api-js/tree/master/packages/client), [@tanstack/react-router](https://tanstack.com/router/latest), and [@tanstack/react-query](https://tanstack.com/query/latest). It uses [tailwind](https://tailwindcss.com/docs/installation) for styling, [shadcn](https://ui.shadcn.com/) components, and offers a [playwright suite](https://playwright.dev/) for testing. + +To easily add more components, [browse the shadcn catalog](https://ui.shadcn.com/docs/components/button) and follow its installation guide. You can also easily generate themes through tools [like this one](https://zippystarter.com/tools/shadcn-ui-theme-generator), and copy and paste your colors into the [input.css](./src/input.css). ## Getting Started diff --git a/src/components/Messages.tsx b/src/components/guestbook/messages.tsx similarity index 76% rename from src/components/Messages.tsx rename to src/components/guestbook/messages.tsx index e439f56..7f8d051 100644 --- a/src/components/Messages.tsx +++ b/src/components/guestbook/messages.tsx @@ -1,9 +1,7 @@ import { GuestBookMessage, useGuestBookMessages } from "@/lib/guestbook"; -import { useTheme } from "@/components/theme-provider"; export default function Messages() { const { data, isLoading, isError } = useGuestBookMessages(); - const { theme } = useTheme(); if (isLoading) return
Loading messages...
; if (isError) @@ -17,10 +15,7 @@ export default function Messages() {
{data && data.length > 0 ? ( data.map((message: GuestBookMessage, i: number) => ( -
+

{message.text}

{message.sender} diff --git a/src/components/GuestbookSigner.tsx b/src/components/guestbook/signer.tsx similarity index 76% rename from src/components/GuestbookSigner.tsx rename to src/components/guestbook/signer.tsx index 57d87a6..69feedf 100644 --- a/src/components/GuestbookSigner.tsx +++ b/src/components/guestbook/signer.tsx @@ -1,7 +1,8 @@ import { useWallet } from "@/contexts/near"; import { useWriteMessage } from "@/lib/guestbook"; import { FormEvent } from "react"; -import { Button } from "./ui/button"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; export default function GuestbookSigner() { const { signedAccountId } = useWallet(); @@ -43,12 +44,11 @@ export default function GuestbookSigner() { -
@@ -57,7 +57,7 @@ export default function GuestbookSigner() { Donation (optional):
-
- diff --git a/src/components/Header.tsx b/src/components/header.tsx similarity index 59% rename from src/components/Header.tsx rename to src/components/header.tsx index 1ae2fc0..941c984 100644 --- a/src/components/Header.tsx +++ b/src/components/header.tsx @@ -1,31 +1,25 @@ +import { Button } from "@/components/ui/button"; +import { ModeToggle } from "@/components/ui/mode-toggle"; import { useWallet } from "@/contexts/near"; import { Link } from "@tanstack/react-router"; -import { ModeToggle } from "./mode-toggle"; -import { Button } from "./ui/button"; export default function Header() { const { signedAccountId } = useWallet(); return ( -
+
- + 📖 NEAR Guest Book