From c685f1ade0c2ad20276c179abe81e99ef5a80b95 Mon Sep 17 00:00:00 2001 From: Cedric Karungu Date: Tue, 5 Mar 2024 16:44:08 +0200 Subject: [PATCH 01/13] fest: add FullWidth Switch --- apps/web/lib/components/container.tsx | 15 ++++++++++- apps/web/lib/components/toggler.tsx | 36 ++++++++++++++++++++++++- apps/web/lib/features/user-nav-menu.tsx | 12 ++++++++- 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/apps/web/lib/components/container.tsx b/apps/web/lib/components/container.tsx index 40c8c34fa..a77e1b260 100644 --- a/apps/web/lib/components/container.tsx +++ b/apps/web/lib/components/container.tsx @@ -1,7 +1,20 @@ import { IClassName } from '@app/interfaces'; import { clsxm } from '@app/utils'; +import { Transition } from '@headlessui/react'; import { PropsWithChildren } from 'react'; export function Container({ children, className, fullWidth }: PropsWithChildren) { - return
{children}
; + return ( + +
{children}
; +
+ ); } diff --git a/apps/web/lib/components/toggler.tsx b/apps/web/lib/components/toggler.tsx index f5665af62..47d7ef249 100644 --- a/apps/web/lib/components/toggler.tsx +++ b/apps/web/lib/components/toggler.tsx @@ -12,11 +12,12 @@ import { TimerStopIcon } from 'assets/svg'; import { Text } from './typography'; -import { Cross2Icon, LightningBoltIcon, UpdateIcon } from '@radix-ui/react-icons'; +import { AllSidesIcon, Cross2Icon, LightningBoltIcon, UpdateIcon } from '@radix-ui/react-icons'; import { useRecoilState } from 'recoil'; import { dataSyncModeState, isDataSyncState } from '@app/stores/data-sync'; import { useModal } from '@app/hooks'; import { RealTimePopup } from 'lib/settings/sync.zone'; +import { fullWidthState } from '@app/stores/fullWidth'; type Props = { className?: string; @@ -207,3 +208,36 @@ export function CommonToggle({ ); } + +export function FullWidthToggler({ className }: IClassName) { + const [fullWidth, setFullWidth] = useRecoilState(fullWidthState); + + return ( +
+ + + +
+ ); +} diff --git a/apps/web/lib/features/user-nav-menu.tsx b/apps/web/lib/features/user-nav-menu.tsx index a81c69259..9cb7810d8 100644 --- a/apps/web/lib/features/user-nav-menu.tsx +++ b/apps/web/lib/features/user-nav-menu.tsx @@ -7,7 +7,7 @@ import { publicState } from '@app/stores'; import { clsxm, isValidUrl } from '@app/utils'; import { Popover, Transition } from '@headlessui/react'; import { ChevronDownIcon } from '@heroicons/react/20/solid'; -import { Avatar, Card, Divider, Text, ThemeToggler, Tooltip } from 'lib/components'; +import { Avatar, Card, Divider, FullWidthToggler, Text, ThemeToggler, Tooltip } from 'lib/components'; import { DevicesIcon, LogoutRoundIcon, MoonLightOutlineIcon as MoonIcon, PeoplesIcon } from 'assets/svg'; import { BriefCaseIcon, SettingOutlineIcon } from 'assets/svg'; @@ -25,6 +25,7 @@ import { TeamsDropDown } from './team/teams-dropdown'; import { KeyboardShortcuts } from 'lib/components/keyboard-shortcuts'; import { usePathname } from 'next/navigation'; import { useTranslations } from 'next-intl'; +import { AllSidesIcon } from '@radix-ui/react-icons'; export function UserNavAvatar() { const { user } = useAuthenticateUser(); @@ -126,6 +127,7 @@ function UserNavMenu() { const { timerStatus } = useTimer(); const { activeTeam, isTeamMember } = useOrganizationTeams(); const publicTeam = useRecoilValue(publicState); + const members = activeTeam?.members || []; const currentMember = members.find((m) => { return m.employee.userId === user?.id; @@ -239,6 +241,14 @@ function UserNavMenu() { + {/* Fullwidth menu */} +
  • +
    + {'Full width'} +
    + +
  • + {/* Darkmode menu */}
  • From 5842943e83b40179e403da40deeb27f7e3a298df Mon Sep 17 00:00:00 2001 From: Cedric Karungu Date: Tue, 5 Mar 2024 17:27:22 +0200 Subject: [PATCH 02/13] fix: Footer margins --- apps/web/app/[locale]/settings/layout.tsx | 20 +++++++++----------- apps/web/lib/components/container.tsx | 3 ++- apps/web/lib/layout/main-layout.tsx | 9 ++++++--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/apps/web/app/[locale]/settings/layout.tsx b/apps/web/app/[locale]/settings/layout.tsx index b38a32b6a..07717099b 100644 --- a/apps/web/app/[locale]/settings/layout.tsx +++ b/apps/web/app/[locale]/settings/layout.tsx @@ -28,25 +28,23 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => { className="items-start pb-1 overflow-hidden w-full" childrenClassName="h-[calc(100vh-_300px)] overflow-hidden w-full" > -
    +
    - -
    - - - +
    + + + - -
    - + +
    -
    +
    {children}
    -
    +
    ); } diff --git a/apps/web/lib/components/container.tsx b/apps/web/lib/components/container.tsx index a77e1b260..c9fc3cde7 100644 --- a/apps/web/lib/components/container.tsx +++ b/apps/web/lib/components/container.tsx @@ -13,8 +13,9 @@ export function Container({ children, className, fullWidth }: PropsWithChildren< leave="transition-opacity duration-150" leaveFrom="opacity-100" leaveTo="opacity-0" + className="w-full p-0 m-0" > -
    {children}
    ; +
    {children}
    ); } diff --git a/apps/web/lib/layout/main-layout.tsx b/apps/web/lib/layout/main-layout.tsx index 1a2239170..4aa4e1fb8 100644 --- a/apps/web/lib/layout/main-layout.tsx +++ b/apps/web/lib/layout/main-layout.tsx @@ -30,7 +30,7 @@ export function MainLayout({ }: Props) { const fullWidth = useRecoilValue(fullWidthState); return ( -
    +