diff --git a/src/app/login/login.module.css b/src/app/login/login.module.css index 73b5f1b..23ce7c8 100644 --- a/src/app/login/login.module.css +++ b/src/app/login/login.module.css @@ -12,7 +12,7 @@ body:has(.loginContainer) { justify-content: center; gap: 1.5rem; padding: 2rem; - width: 300px; + width: min(max(300px, 30svw), 500px); background-color: var(--base-1); border-radius: 1rem; @@ -24,6 +24,7 @@ body:has(.loginContainer) { } .loginContainer form { + width: 100%; display: flex; flex-direction: column; gap: 1rem; diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 27fc99c..aaf2f08 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,14 +1,12 @@ // /home/max/Git/MeetUp/src/app/login/page.tsx import { auth } from '@/auth'; -import LabeledInput from '@/components/labeled-input'; -import Login from '@/components/user/sso-login-button'; import { redirect } from 'next/navigation'; import style from './login.module.css'; import '@/app/globals.css'; import SSOLogin from '@/components/user/sso-login-button'; -import Login from '@/components/user/login-button'; +import LoginForm from '@/components/user/login-form'; export default async function LoginPage() { const session = await auth(); @@ -21,24 +19,13 @@ export default async function LoginPage() {

Login

-
- - - + - +
-
- - + {process.env.AUTH_AUTHENTIK_ISSUER && ( + + )}
); } diff --git a/src/components/button.module.css b/src/components/button.module.css index 0a9df2d..e8523e7 100644 --- a/src/components/button.module.css +++ b/src/components/button.module.css @@ -6,6 +6,7 @@ border: 2px solid var(--color-100); transition: background-color 0.3s ease; height: 50px; + width: min(100%, 300px); } .button:hover { diff --git a/src/components/button.tsx b/src/components/button.tsx index 50d1947..275063f 100644 --- a/src/components/button.tsx +++ b/src/components/button.tsx @@ -8,22 +8,17 @@ export default function Button({ children, mode = 'primary', icon, - width, }: { type?: 'button' | 'submit' | 'reset'; children?: React.ReactNode; mode?: 'primary' | 'warning' | 'success' | 'danger'; icon?: IconProp; - width?: number; }) { if (!icon) { return ( @@ -35,9 +30,6 @@ export default function Button({ style.button + ' ' + style['style_' + mode] + ' ' + style['icon'] } type={type} - style={{ - width: width ? `${width}px` : '100%', - }} > {children} diff --git a/src/components/labeled-input.module.css b/src/components/labeled-input.module.css index 85f46ed..239346e 100644 --- a/src/components/labeled-input.module.css +++ b/src/components/labeled-input.module.css @@ -6,7 +6,7 @@ .input { position: relative; overflow: visible; - width: 250px; + width: 100%; } .input input { diff --git a/src/components/user/login-button.tsx b/src/components/user/login-button.tsx deleted file mode 100644 index f503cec..0000000 --- a/src/components/user/login-button.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import Button from '../button'; - -export default function Login() { - return ( -
- -
- ); -} diff --git a/src/components/user/login-form.module.css b/src/components/user/login-form.module.css new file mode 100644 index 0000000..c857b9e --- /dev/null +++ b/src/components/user/login-form.module.css @@ -0,0 +1,7 @@ +.loginForm { + display: flex; + flex-direction: column; + gap: 1rem; + align-items: center; + justify-content: center; +} diff --git a/src/components/user/login-form.tsx b/src/components/user/login-form.tsx new file mode 100644 index 0000000..a9075ac --- /dev/null +++ b/src/components/user/login-form.tsx @@ -0,0 +1,23 @@ +import style from './login-form.module.css'; +import Button from '../button'; +import LabeledInput from '@/components/labeled-input'; + +export default function LoginForm() { + return ( +
+ + + + + ); +} diff --git a/src/components/user/sso-login-button.tsx b/src/components/user/sso-login-button.tsx index 272872e..65f2844 100644 --- a/src/components/user/sso-login-button.tsx +++ b/src/components/user/sso-login-button.tsx @@ -15,8 +15,15 @@ export default function SSOLogin({ 'use server'; await signIn(provider); }} + style={{ + display: 'flex', + flexDirection: 'column', + gap: '1rem', + width: '100%', + alignItems: 'center', + }} > -