From d88e2ca606ac1d64438a49da11ed9f90d40bb013 Mon Sep 17 00:00:00 2001 From: Ikraam Date: Fri, 19 Jan 2024 18:40:10 +0000 Subject: [PATCH 1/6] removed settings link from the profile circle --- libs/client/features/src/layout/DesktopLayout.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/client/features/src/layout/DesktopLayout.tsx b/libs/client/features/src/layout/DesktopLayout.tsx index 55eaf49a..efa556c3 100644 --- a/libs/client/features/src/layout/DesktopLayout.tsx +++ b/libs/client/features/src/layout/DesktopLayout.tsx @@ -191,9 +191,7 @@ export function DesktopLayout({ children, sidebar }: DesktopLayoutProps) { - - - + From 427717c7b7ab9ac3fef1c095c03ced6ae59589b2 Mon Sep 17 00:00:00 2001 From: Ikraam Date: Fri, 19 Jan 2024 19:43:36 +0000 Subject: [PATCH 2/6] added MenuPopover to ProfileCircle --- libs/client/features/src/layout/DesktopLayout.tsx | 8 +++++--- libs/client/features/src/layout/MenuPopover.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/client/features/src/layout/DesktopLayout.tsx b/libs/client/features/src/layout/DesktopLayout.tsx index efa556c3..581dcb81 100644 --- a/libs/client/features/src/layout/DesktopLayout.tsx +++ b/libs/client/features/src/layout/DesktopLayout.tsx @@ -16,7 +16,6 @@ import { RiFolderOpenLine, RiMenuFoldLine, RiMenuUnfoldLine, - RiMore2Fill, RiPieChart2Line, RiFlagLine, RiArrowRightSLine, @@ -191,7 +190,11 @@ export function DesktopLayout({ children, sidebar }: DesktopLayoutProps) { - + } + buttonClassName="w-12 h-12 rounded-full" + /> @@ -342,7 +345,6 @@ function DefaultContent({

{name ?? ''}

{email ?? ''}

- } /> ) diff --git a/libs/client/features/src/layout/MenuPopover.tsx b/libs/client/features/src/layout/MenuPopover.tsx index 6413d08f..36c838bd 100644 --- a/libs/client/features/src/layout/MenuPopover.tsx +++ b/libs/client/features/src/layout/MenuPopover.tsx @@ -6,19 +6,24 @@ import { RiShutDownLine as LogoutIcon, RiDatabase2Line, } from 'react-icons/ri' +import classNames from 'classnames' export function MenuPopover({ icon, + buttonClassName, placement = 'top-end', isHeader, }: { icon: JSX.Element + buttonClassName?: string placement?: ComponentProps['placement'] isHeader: boolean }) { return ( - {icon} + + {icon} + Date: Sat, 20 Jan 2024 03:10:50 +0530 Subject: [PATCH 3/6] Add loader to Button component and clean login page --- apps/client/pages/login.tsx | 25 +++++++------ apps/client/pages/register.tsx | 4 ++ libs/design-system/src/lib/Button/Button.tsx | 39 ++++++++++++++++++++ 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/apps/client/pages/login.tsx b/apps/client/pages/login.tsx index aabcc715..57cbfa70 100644 --- a/apps/client/pages/login.tsx +++ b/apps/client/pages/login.tsx @@ -1,6 +1,6 @@ import { useState, type ReactElement } from 'react' import { FullPageLayout } from '@maybe-finance/client/features' -import { Input, InputPassword, Button } from '@maybe-finance/design-system' +import { Input, InputPassword, Button, LoadingSpinner } from '@maybe-finance/design-system' import { signIn, useSession } from 'next-auth/react' import { useRouter } from 'next/router' import { useEffect } from 'react' @@ -10,8 +10,9 @@ import Link from 'next/link' export default function LoginPage() { const [email, setEmail] = useState('') const [password, setPassword] = useState('') - const [isValid, setIsValid] = useState(false) + const [isValid, setIsValid] = useState(true) const [errorMessage, setErrorMessage] = useState(null) + const [isLoading, setIsLoading] = useState(false) const { data: session } = useSession() const router = useRouter() @@ -26,6 +27,7 @@ export default function LoginPage() { e.preventDefault() setErrorMessage(null) setPassword('') + setIsLoading(true) const response = await signIn('credentials', { email, @@ -35,9 +37,16 @@ export default function LoginPage() { if (response && response.error) { setErrorMessage(response.error) + setIsLoading(false) } } + const onPasswordChange = (e: React.ChangeEvent) => { + setErrorMessage(null) + setPassword(e.target.value) + setIsValid(e.target.value.length > 0) + } + return ( <>