From a412d0710bd8bd63b89040d6bc4cc7eac018705e Mon Sep 17 00:00:00 2001 From: Maximilian Liebmann Date: Wed, 18 Jun 2025 22:25:27 +0200 Subject: [PATCH] refactor: organized component folder structure fix: scrolling in login page --- src/app/home/page.tsx | 4 +- src/app/layout.tsx | 2 +- src/app/login/page.tsx | 40 +++++++++---------- src/app/logout/page.tsx | 2 +- src/app/settings/page.tsx | 2 +- src/components/{ => buttons}/icon-button.tsx | 2 +- .../{user => buttons}/redirect-button.tsx | 2 +- .../{user => buttons}/sso-login-button.tsx | 2 +- .../{ => custom-ui}/labeled-input.tsx | 0 src/components/{user => forms}/login-form.tsx | 4 +- src/components/{ => misc}/logo.tsx | 0 .../{user => misc}/theme-picker.tsx | 2 +- src/components/{custom-ui => ui}/button.tsx | 0 .../{custom-ui => ui}/separator.tsx | 0 .../{ => wrappers}/theme-provider.tsx | 0 15 files changed, 31 insertions(+), 31 deletions(-) rename src/components/{ => buttons}/icon-button.tsx (88%) rename src/components/{user => buttons}/redirect-button.tsx (84%) rename src/components/{user => buttons}/sso-login-button.tsx (90%) rename src/components/{ => custom-ui}/labeled-input.tsx (100%) rename src/components/{user => forms}/login-form.tsx (98%) rename src/components/{ => misc}/logo.tsx (100%) rename src/components/{user => misc}/theme-picker.tsx (95%) rename src/components/{custom-ui => ui}/button.tsx (100%) rename src/components/{custom-ui => ui}/separator.tsx (100%) rename src/components/{ => wrappers}/theme-provider.tsx (100%) diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx index 4e6773b..b3294a0 100644 --- a/src/app/home/page.tsx +++ b/src/app/home/page.tsx @@ -1,5 +1,5 @@ -import { RedirectButton } from '@/components/user/redirect-button'; -import { ThemePicker } from '@/components/user/theme-picker'; +import { RedirectButton } from '@/components/buttons/redirect-button'; +import { ThemePicker } from '@/components/misc/theme-picker'; export default function Home() { return ( diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e30808f..55cdd2c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { ThemeProvider } from '@/components/theme-provider'; +import { ThemeProvider } from '@/components/wrappers/theme-provider'; import type { Metadata } from 'next'; import './globals.css'; diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 2933872..76778ae 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,17 +1,17 @@ import { auth, providerMap } from '@/auth'; -import SSOLogin from '@/components/user/sso-login-button'; -import LoginForm from '@/components/user/login-form'; +import SSOLogin from '@/components/buttons/sso-login-button'; +import LoginForm from '@/components/forms/login-form'; import { redirect } from 'next/navigation'; -import { Button } from '@/components/custom-ui/button'; +import { Button } from '@/components/ui/button'; import Image from 'next/image'; -import { Separator } from '@/components/custom-ui/separator'; -import Logo from '@/components/logo'; +import { Separator } from '@/components/ui/separator'; +import Logo from '@/components/misc/logo'; import { Card, CardContent, CardHeader, } from '@/components/custom-ui/login-card'; -import { ThemePicker } from '@/components/user/theme-picker'; +import { ThemePicker } from '@/components/misc/theme-picker'; import { HoverCard, HoverCardTrigger, @@ -26,7 +26,7 @@ export default async function LoginPage() { } return ( -
+
@@ -51,20 +51,20 @@ export default async function LoginPage() {
+ + + + + + dancing penguin + +
- - - - - - dancing penguin - -
); } diff --git a/src/app/logout/page.tsx b/src/app/logout/page.tsx index 38311da..e3da2fd 100644 --- a/src/app/logout/page.tsx +++ b/src/app/logout/page.tsx @@ -1,5 +1,5 @@ import { signOut } from '@/auth'; -import { Button } from '@/components/custom-ui/button'; +import { Button } from '@/components/ui/button'; import { Card, CardContent, diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 7c005aa..563ebab 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -1,4 +1,4 @@ -import { Button } from '@/components/custom-ui/button'; +import { Button } from '@/components/ui/button'; import { Card, CardContent, diff --git a/src/components/icon-button.tsx b/src/components/buttons/icon-button.tsx similarity index 88% rename from src/components/icon-button.tsx rename to src/components/buttons/icon-button.tsx index ad67eaa..17f9945 100644 --- a/src/components/icon-button.tsx +++ b/src/components/buttons/icon-button.tsx @@ -1,4 +1,4 @@ -import { Button } from '@/components/custom-ui/button'; +import { Button } from '@/components/ui/button'; import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; diff --git a/src/components/user/redirect-button.tsx b/src/components/buttons/redirect-button.tsx similarity index 84% rename from src/components/user/redirect-button.tsx rename to src/components/buttons/redirect-button.tsx index e4f8a62..c4bf997 100644 --- a/src/components/user/redirect-button.tsx +++ b/src/components/buttons/redirect-button.tsx @@ -1,4 +1,4 @@ -import { Button } from '../custom-ui/button'; +import { Button } from '../ui/button'; import Link from 'next/link'; export function RedirectButton({ diff --git a/src/components/user/sso-login-button.tsx b/src/components/buttons/sso-login-button.tsx similarity index 90% rename from src/components/user/sso-login-button.tsx rename to src/components/buttons/sso-login-button.tsx index dc070b5..644efce 100644 --- a/src/components/user/sso-login-button.tsx +++ b/src/components/buttons/sso-login-button.tsx @@ -1,5 +1,5 @@ import { signIn } from '@/auth'; -import { IconButton } from '@/components/icon-button'; +import { IconButton } from '@/components/buttons/icon-button'; import { faOpenid } from '@fortawesome/free-brands-svg-icons'; export default function SSOLogin({ diff --git a/src/components/labeled-input.tsx b/src/components/custom-ui/labeled-input.tsx similarity index 100% rename from src/components/labeled-input.tsx rename to src/components/custom-ui/labeled-input.tsx diff --git a/src/components/user/login-form.tsx b/src/components/forms/login-form.tsx similarity index 98% rename from src/components/user/login-form.tsx rename to src/components/forms/login-form.tsx index a0167e2..67d161c 100644 --- a/src/components/user/login-form.tsx +++ b/src/components/forms/login-form.tsx @@ -3,8 +3,8 @@ import React, { useState, useRef } from 'react'; import { useRouter } from 'next/navigation'; -import LabeledInput from '@/components/labeled-input'; -import { Button } from '@/components/custom-ui/button'; +import LabeledInput from '@/components/custom-ui/labeled-input'; +import { Button } from '@/components/ui/button'; import useZodForm from '@/lib/hooks/useZodForm'; import { loginSchema, registerSchema } from '@/lib/validation/user'; import { loginAction } from '@/lib/auth/login'; diff --git a/src/components/logo.tsx b/src/components/misc/logo.tsx similarity index 100% rename from src/components/logo.tsx rename to src/components/misc/logo.tsx diff --git a/src/components/user/theme-picker.tsx b/src/components/misc/theme-picker.tsx similarity index 95% rename from src/components/user/theme-picker.tsx rename to src/components/misc/theme-picker.tsx index 2a1649d..b3397ed 100644 --- a/src/components/user/theme-picker.tsx +++ b/src/components/misc/theme-picker.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { Moon, Sun } from 'lucide-react'; import { useTheme } from 'next-themes'; -import { Button } from '@/components/custom-ui/button'; +import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuContent, diff --git a/src/components/custom-ui/button.tsx b/src/components/ui/button.tsx similarity index 100% rename from src/components/custom-ui/button.tsx rename to src/components/ui/button.tsx diff --git a/src/components/custom-ui/separator.tsx b/src/components/ui/separator.tsx similarity index 100% rename from src/components/custom-ui/separator.tsx rename to src/components/ui/separator.tsx diff --git a/src/components/theme-provider.tsx b/src/components/wrappers/theme-provider.tsx similarity index 100% rename from src/components/theme-provider.tsx rename to src/components/wrappers/theme-provider.tsx