[dyad] Added a footer and theme switcher - wrote 6 file(s), deleted 1 file(s)
This commit is contained in:
14
src/components/footer.tsx
Normal file
14
src/components/footer.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
|
||||
export const Footer = () => {
|
||||
return (
|
||||
<footer className="w-full max-w-2xl p-4 row-start-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||
v0.1.0
|
||||
</p>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
export const MadeWithDyad = () => {
|
||||
return (
|
||||
<div className="p-4 text-center">
|
||||
<a
|
||||
href="https://www.dyad.sh/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
||||
>
|
||||
Made with Dyad
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -50,7 +50,7 @@ export function MetaForm() {
|
||||
className="pl-10 h-12 text-base rounded-lg shadow-sm"
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" disabled={loading} className="w-full sm:w-auto h-12 px-8 rounded-lg bg-indigo-600 hover:bg-indigo-700 text-white font-semibold transition-all">
|
||||
<Button type="submit" disabled={loading} className="w-full sm:w-auto h-12 px-8 rounded-lg font-semibold transition-all">
|
||||
{loading ? "Extracting..." : "Extract"}
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
9
src/components/theme-provider.tsx
Normal file
9
src/components/theme-provider.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
||||
import { type ThemeProviderProps } from "next-themes/dist/types"
|
||||
|
||||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
||||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
|
||||
}
|
||||
23
src/components/theme-toggle.tsx
Normal file
23
src/components/theme-toggle.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { Moon, Sun } from "lucide-react"
|
||||
import { useTheme } from "next-themes"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
export function ThemeToggle() {
|
||||
const { setTheme, theme } = useTheme()
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
|
||||
>
|
||||
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
||||
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
||||
<span className="sr-only">Toggle theme</span>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user