From 6fcc6ecf3bfec51eb08b64c55c5ff9008240d298 Mon Sep 17 00:00:00 2001 From: Nikita Mashchenko Date: Thu, 19 Oct 2023 01:08:35 -0500 Subject: [PATCH] fix: design issues --- client/src/app/(auth)/layout.tsx | 10 +++++-- client/src/app/(auth)/login/page.tsx | 7 ++--- .../app/(auth)/password/confirmation/page.tsx | 2 +- .../src/app/(auth)/password/expired/page.tsx | 2 +- .../app/(auth)/password/password.module.scss | 8 +++++ .../src/app/(auth)/password/recover/page.tsx | 10 +++++-- .../password/update/[id]/[token]/page.tsx | 8 ++++- client/src/app/(auth)/shared.module.scss | 15 +++++----- .../app/(auth)/signup/confirmation/page.tsx | 2 +- client/src/app/(auth)/signup/page.tsx | 7 ++--- client/src/app/(auth)/styles.module.scss | 7 ----- .../ui/illustration/illustration.module.scss | 4 +++ .../(auth)/ui/illustration/illustration.tsx | 29 ++++++++++--------- client/src/app/styles/reset.scss | 2 +- client/src/shared/assets/icons/index.ts | 2 +- client/src/shared/assets/icons/logo/index.ts | 1 + .../shared/assets/icons/logo/logo-small.tsx | 22 ++++++++++++++ 17 files changed, 90 insertions(+), 48 deletions(-) create mode 100644 client/src/shared/assets/icons/logo/logo-small.tsx diff --git a/client/src/app/(auth)/layout.tsx b/client/src/app/(auth)/layout.tsx index d787d73fb..e4f362337 100644 --- a/client/src/app/(auth)/layout.tsx +++ b/client/src/app/(auth)/layout.tsx @@ -3,12 +3,16 @@ import { GoogleOAuthProvider } from '@react-oauth/google'; import { usePathname, useRouter } from 'next/navigation'; import { ReactNode, useState } from 'react'; -import { LogoBig } from '@/shared/assets'; +import { LogoBig, LogoSmall } from '@/shared/assets'; import { Flex, Tabs } from '@/shared/ui'; import styles from './styles.module.scss'; +import { useGetScreenWidth } from '@/shared/lib'; + +const baseLayouts = ['confirmation', 'expired', 'success']; export default function AuthLayout({ children }: { children: ReactNode }) { const router = useRouter(); + const width = useGetScreenWidth(); const pathname = usePathname(); const options = ['Login', 'Sign Up']; const [tab, setTab] = useState(options[0]); @@ -24,7 +28,7 @@ export default function AuthLayout({ children }: { children: ReactNode }) { const header = (
- + {width > 420 ? : }
@@ -61,7 +65,7 @@ export default function AuthLayout({ children }: { children: ReactNode }) { return ( - {pathname === '/login' || pathname === '/signup' ? alternative : basic} + {baseLayouts.includes(pathname.split('/').at(-1) || '') ? basic : alternative} ); } diff --git a/client/src/app/(auth)/login/page.tsx b/client/src/app/(auth)/login/page.tsx index 66554bd83..160eda5fa 100644 --- a/client/src/app/(auth)/login/page.tsx +++ b/client/src/app/(auth)/login/page.tsx @@ -8,7 +8,7 @@ import { Button, Flex, Input, InputPassword, Typography } from '@/shared/ui'; import { useState } from 'react'; import styles from '../shared.module.scss'; -import { Github, Google, LogoBig } from '@/shared/assets'; +import { Github, Google } from '@/shared/assets'; interface LoginProps { email: string; @@ -35,10 +35,7 @@ export default function LoginPage() { return (
- - - - + ); diff --git a/client/src/app/(auth)/password/expired/page.tsx b/client/src/app/(auth)/password/expired/page.tsx index 72ef31b86..52c59f506 100644 --- a/client/src/app/(auth)/password/expired/page.tsx +++ b/client/src/app/(auth)/password/expired/page.tsx @@ -11,7 +11,7 @@ export default function Expired() { ); diff --git a/client/src/app/(auth)/password/password.module.scss b/client/src/app/(auth)/password/password.module.scss index fae2c9a11..ce6f99ec7 100644 --- a/client/src/app/(auth)/password/password.module.scss +++ b/client/src/app/(auth)/password/password.module.scss @@ -1,3 +1,11 @@ .text_align { text-align: center; } + +.width_limiter { + max-width: 470px; + + @media (width <= 768px) { + max-width: 370px; + } +} diff --git a/client/src/app/(auth)/password/recover/page.tsx b/client/src/app/(auth)/password/recover/page.tsx index c6fcc3fb1..0ab025782 100644 --- a/client/src/app/(auth)/password/recover/page.tsx +++ b/client/src/app/(auth)/password/recover/page.tsx @@ -4,8 +4,8 @@ import { useState } from 'react'; import { SubmitHandler, useForm } from 'react-hook-form'; import { ArrowLeft } from '@/shared/assets'; import { Button, Flex, Input, Typography } from '@/shared/ui'; -import styles from '../password.module.scss'; import { useRouter } from 'next/navigation'; +import styles from '../password.module.scss'; interface RecoverProps { email: string; @@ -28,7 +28,13 @@ export default function Recover() { return ( - + - + ); diff --git a/client/src/app/(auth)/signup/page.tsx b/client/src/app/(auth)/signup/page.tsx index 62890e5cf..b86654a51 100644 --- a/client/src/app/(auth)/signup/page.tsx +++ b/client/src/app/(auth)/signup/page.tsx @@ -2,7 +2,7 @@ import { useGoogleLogin } from '@react-oauth/google'; import { useState } from 'react'; -import { Github, Google, LogoBig } from '@/shared/assets'; +import { Github, Google } from '@/shared/assets'; import { SubmitHandler, useForm } from 'react-hook-form'; import { Button, Flex, Input, InputPassword, Typography } from '@/shared/ui'; import styles from '../shared.module.scss'; @@ -33,10 +33,7 @@ export default function SignupPage() { return ( - - - - + = props => { return (
- - {mainText} - - {subText} - - - {buttonText && ( - - + + + {mainText} + + {subText} + - )} + {buttonText && ( + + + + )} +
); }; diff --git a/client/src/app/styles/reset.scss b/client/src/app/styles/reset.scss index abe9dc68f..018805827 100644 --- a/client/src/app/styles/reset.scss +++ b/client/src/app/styles/reset.scss @@ -27,7 +27,7 @@ a:active { html, body { - height: 100vh; + min-height: 100dvh; } body { diff --git a/client/src/shared/assets/icons/index.ts b/client/src/shared/assets/icons/index.ts index 0668eec54..6a07d9613 100644 --- a/client/src/shared/assets/icons/index.ts +++ b/client/src/shared/assets/icons/index.ts @@ -12,7 +12,7 @@ export { Crown } from './crown'; export { Search } from './search'; export { ArrowLeft } from './arrows'; export { CaretUp, CaretDown } from './caret'; -export { LogoBig } from './logo'; +export { LogoBig, LogoSmall } from './logo'; export { Google, Github } from './socials'; export { C, diff --git a/client/src/shared/assets/icons/logo/index.ts b/client/src/shared/assets/icons/logo/index.ts index ae944dc6c..eadaf4ee2 100644 --- a/client/src/shared/assets/icons/logo/index.ts +++ b/client/src/shared/assets/icons/logo/index.ts @@ -1 +1,2 @@ export { LogoBig } from './logo-big'; +export { LogoSmall } from './logo-small'; diff --git a/client/src/shared/assets/icons/logo/logo-small.tsx b/client/src/shared/assets/icons/logo/logo-small.tsx new file mode 100644 index 000000000..08811eed7 --- /dev/null +++ b/client/src/shared/assets/icons/logo/logo-small.tsx @@ -0,0 +1,22 @@ +import { FC, SVGProps } from 'react'; +export const LogoSmall: FC> = props => { + return ( + + + + + ); +};