Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

chore: Reposition theme button (#1292)

Amanuel Odichob016cc18d9cb
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index b1e22548..49644510 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -10,7 +10,6 @@ import Link from 'next/link';
import { isAdminOrModerator } from '~/utils/auth-guards';
import { getAllFlags } from '~/utils/feature-flags';
import { auth } from '@repo/auth/server';
-import { ThemeButton } from './theme-button';
import { NavWrapper } from './nav-wrapper';
import { LoginLink } from './login-link';
import { SignOutLink } from './signout-link';
@@ -91,7 +90,6 @@ export async function Navigation() {
{/* <Suspense> */}
{/* <Search /> */}
{/* </Suspense> */}
- <ThemeButton />
{featureFlags?.enableLogin ? <LoginButton /> : null}
<MobileNav>
<NavLinks />
diff --git a/apps/web/src/components/Navigation/theme-button.tsx b/apps/web/src/components/Navigation/theme-button.tsx
index 3af19f42..0b1005c9 100644
--- a/apps/web/src/components/Navigation/theme-button.tsx
+++ b/apps/web/src/components/Navigation/theme-button.tsx
@@ -16,14 +16,24 @@ export function ThemeButton() {
{mounted ? (
<button
aria-label="theme button"
- className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none focus-visible:ring-2"
+ className="group rounded-lg p-2 focus:outline-[#2563EB]"
onClick={() => {
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
}}
type="button"
>
- {resolvedTheme === 'dark' && <Moon aria-hidden="true" className="h-5 w-5" />}
- {resolvedTheme === 'light' && <Sun aria-hidden="true" className="h-5 w-5" />}
+ {resolvedTheme === 'dark' && (
+ <Moon
+ aria-hidden="true"
+ className="h-5 w-5 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white"
+ />
+ )}
+ {resolvedTheme === 'light' && (
+ <Sun
+ aria-hidden="true"
+ className="h-5 w-5 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white"
+ />
+ )}
</button>
) : null}
</>
diff --git a/apps/web/src/components/footsies.tsx b/apps/web/src/components/footsies.tsx
index 60f5ad59..985d21e6 100644
--- a/apps/web/src/components/footsies.tsx
+++ b/apps/web/src/components/footsies.tsx
@@ -1,5 +1,6 @@
import { Binary, Github, Twitter } from '@repo/ui/icons';
import Link from 'next/link';
+import { ThemeButton } from './Navigation/theme-button';
export function Footsies() {
return (
@@ -9,22 +10,24 @@ export function Footsies() {
Built with <Binary className="inline-block h-5 w-5 text-[#31bdc6]" /> by the Trash Devs
community.
</span>
- <div className="flex gap-2">
+ <div className="flex items-center gap-2">
+ <ThemeButton />
+ <span className="px-2">|</span>
<a
target="_blank"
rel="noreferrer"
- className="group gap-1 md:inline-flex"
+ className="group rounded-lg p-2"
href="https://github.com/typehero/typehero"
>
- <Github className="h-4 w-4 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white" />
+ <Github className="h-5 w-5 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white" />
</a>
<a
target="_blank"
rel="noreferrer"
- className="group gap-1 md:inline-flex"
+ className="group rounded-lg p-2"
href="https://twitter.com/typeheroapp"
>
- <Twitter className="h-4 w-4 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white" />
+ <Twitter className="h-5 w-5 duration-150 group-hover:scale-110 group-hover:fill-black dark:group-hover:fill-white" />
</a>
</div>
</div>