-
Notifications
You must be signed in to change notification settings - Fork 2
Remove theme toggle and default to light theme #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sweep-ai-deprecated
wants to merge
8
commits into
main
Choose a base branch
from
sweep/remove-theme-toggle
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d4cbe7
Updated app/layout.tsx
sweep-ai-deprecated[bot] 082e80e
Updated components/site-header.tsx
sweep-ai-deprecated[bot] d3b4db6
Updated components/theme-toggle.tsx
sweep-ai-deprecated[bot] 171999b
Updated app/_examples/client-component/page.tsx
sweep-ai-deprecated[bot] 4e6719b
Updated app/_examples/server-action/page.tsx
sweep-ai-deprecated[bot] d06fe8d
Updated app/layout.tsx
sweep-ai-deprecated[bot] 289e476
Updated app/layout.tsx
sweep-ai-deprecated[bot] 1c1869c
Updated app/layout.tsx
sweep-ai-deprecated[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<any[]>([]) | ||
| const [todos, setTodos] = useState<any[]>([]); | ||
|
|
||
| // 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 <pre>{JSON.stringify(todos, null, 2)}</pre> | ||
| return <pre>{JSON.stringify(todos, null, 2)}</pre>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <form action={addTodo}> | ||
| <input name="title" /> | ||
| </form> | ||
| ) | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <Button | ||
| variant="ghost" | ||
| size="sm" | ||
| onClick={() => setTheme(theme === "light" ? "dark" : "light")} | ||
| > | ||
| <Icons.sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
| <Icons.moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
| <span className="sr-only">Toggle theme</span> | ||
| </Button> | ||
| ); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweep: regenerate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.