From 40145ec2bfeaa3801c19e40b0e0ecde3555735a3 Mon Sep 17 00:00:00 2001 From: Anishali2 Date: Sat, 18 May 2024 03:16:02 +0500 Subject: [PATCH 1/3] fix: breadcrumbs issue in setting page --- apps/web/app/[locale]/settings/layout.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/web/app/[locale]/settings/layout.tsx b/apps/web/app/[locale]/settings/layout.tsx index b7f9eeb22..2d8cd798e 100644 --- a/apps/web/app/[locale]/settings/layout.tsx +++ b/apps/web/app/[locale]/settings/layout.tsx @@ -12,16 +12,21 @@ import React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; import { clsxm } from '@app/utils'; import { withAuthentication } from 'lib/app/authenticator'; +import { usePathname } from 'next/navigation'; const SettingsLayout = ({ children }: { children: JSX.Element }) => { const t = useTranslations(); const [user] = useRecoilState(userState); const fullWidth = useRecoilValue(fullWidthState); - + const pathName = usePathname(); + const getEndPath: any = pathName?.split('settings/')[1]; + const endCapitlizeWord: 'TEAM' | 'PERSONAL' = getEndPath?.toUpperCase(); const breadcrumb = [ { title: JSON.parse(t('pages.home.BREADCRUMB')), href: '/' }, - { title: JSON.parse(t('pages.settings.BREADCRUMB')), href: '/settings/personnal' } + { title: t('common.SETTINGS'), href: pathName as string }, + { title: t(`common.${endCapitlizeWord}`), href: pathName as string } ]; + console.log('breadcrumb', breadcrumb); if (!user) { return ; } else { @@ -33,7 +38,7 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => {
{/*
*/} From 4a95b68deb45ecbb85434c4f32af54fb709b2fe3 Mon Sep 17 00:00:00 2001 From: Anishali2 Date: Sat, 18 May 2024 03:18:49 +0500 Subject: [PATCH 2/3] fix: breadcrumbs issue in setting page --- apps/web/app/[locale]/settings/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/app/[locale]/settings/layout.tsx b/apps/web/app/[locale]/settings/layout.tsx index 2d8cd798e..03349068f 100644 --- a/apps/web/app/[locale]/settings/layout.tsx +++ b/apps/web/app/[locale]/settings/layout.tsx @@ -20,11 +20,11 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => { const fullWidth = useRecoilValue(fullWidthState); const pathName = usePathname(); const getEndPath: any = pathName?.split('settings/')[1]; - const endCapitlizeWord: 'TEAM' | 'PERSONAL' = getEndPath?.toUpperCase(); + const endWord: 'TEAM' | 'PERSONAL' = getEndPath?.toUpperCase(); const breadcrumb = [ { title: JSON.parse(t('pages.home.BREADCRUMB')), href: '/' }, { title: t('common.SETTINGS'), href: pathName as string }, - { title: t(`common.${endCapitlizeWord}`), href: pathName as string } + { title: t(`common.${endWord}`), href: pathName as string } ]; console.log('breadcrumb', breadcrumb); if (!user) { From 341b570f907b3b7726b53a191cd7eca1c814ae0e Mon Sep 17 00:00:00 2001 From: Ruslan Konviser Date: Sat, 18 May 2024 11:08:46 +0200 Subject: [PATCH 3/3] Update layout.tsx --- apps/web/app/[locale]/settings/layout.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/web/app/[locale]/settings/layout.tsx b/apps/web/app/[locale]/settings/layout.tsx index 03349068f..92570dc47 100644 --- a/apps/web/app/[locale]/settings/layout.tsx +++ b/apps/web/app/[locale]/settings/layout.tsx @@ -26,7 +26,7 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => { { title: t('common.SETTINGS'), href: pathName as string }, { title: t(`common.${endWord}`), href: pathName as string } ]; - console.log('breadcrumb', breadcrumb); + if (!user) { return ; } else { @@ -39,14 +39,12 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => { - {/*
*/} + > - - {/*
*/} +