diff --git a/app/_examples/client-component/page.tsx b/app/_examples/client-component/page.tsx index aab0068..55d30c1 100644 --- a/app/_examples/client-component/page.tsx +++ b/app/_examples/client-component/page.tsx @@ -1,29 +1,29 @@ -'use client' +"use client"; // TODO: Duplicate or move this file outside the `_examples` folder to make it a route -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' -import { useEffect, useState } from 'react' +import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; +import { useEffect, useState } from "react"; export default function ClientComponent() { - const [todos, setTodos] = useState([]) + const [todos, setTodos] = useState([]); // Create a Supabase client configured to use cookies - const supabase = createClientComponentClient() + const supabase = createClientComponentClient(); useEffect(() => { const getTodos = async () => { // This assumes you have a `todos` table in Supabase. Check out // the `Create Table and seed with data` section of the README 👇 // https://github.com/vercel/next.js/blob/canary/examples/with-supabase/README.md - const { data } = await supabase.from('todos').select() + const { data } = await supabase.from("todos").select(); if (data) { - setTodos(data) + setTodos(data); } - } + }; - getTodos() - }, [supabase, setTodos]) + getTodos(); + }, [supabase, setTodos]); - return
{JSON.stringify(todos, null, 2)}
+ return
{JSON.stringify(todos, null, 2)}
; } diff --git a/app/_examples/server-action/page.tsx b/app/_examples/server-action/page.tsx index 4807e3e..3140fbb 100644 --- a/app/_examples/server-action/page.tsx +++ b/app/_examples/server-action/page.tsx @@ -1,29 +1,29 @@ // TODO: Duplicate or move this file outside the `_examples` folder to make it a route -import { createServerActionClient } from '@supabase/auth-helpers-nextjs' -import { revalidatePath } from 'next/cache' -import { cookies } from 'next/headers' +import { createServerActionClient } from "@supabase/auth-helpers-nextjs"; +import { revalidatePath } from "next/cache"; +import { cookies } from "next/headers"; export default async function ServerAction() { const addTodo = async (formData: FormData) => { - 'use server' - const title = formData.get('title') + "use server"; + const title = formData.get("title"); if (title) { // Create a Supabase client configured to use cookies - const supabase = createServerActionClient({ cookies }) + const supabase = createServerActionClient({ cookies }); // This assumes you have a `todos` table in Supabase. Check out // the `Create Table and seed with data` section of the README 👇 // https://github.com/vercel/next.js/blob/canary/examples/with-supabase/README.md - await supabase.from('todos').insert({ title }) - revalidatePath('/server-action-example') + await supabase.from("todos").insert({ title }); + revalidatePath("/server-action-example"); } - } + }; return (
- ) + ); } diff --git a/app/layout.tsx b/app/layout.tsx index 4bb31d0..9db4309 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -62,7 +62,6 @@ export default function RootLayout({ - - - ); -} + + + ); diff --git a/components/site-header.tsx b/components/site-header.tsx index 3a7eca4..d0a50ac 100644 --- a/components/site-header.tsx +++ b/components/site-header.tsx @@ -40,7 +40,6 @@ export async function SiteHeader() { GitHub - {user && } diff --git a/components/theme-toggle.tsx b/components/theme-toggle.tsx index 7de133c..e69de29 100644 --- a/components/theme-toggle.tsx +++ b/components/theme-toggle.tsx @@ -1,23 +0,0 @@ -"use client"; - -import * as React from "react"; -import { useTheme } from "next-themes"; - -import { Button } from "@/components/ui/button"; -import { Icons } from "@/components/icons"; - -export function ThemeToggle() { - const { setTheme, theme } = useTheme(); - - return ( - - ); -}