From e6ebd4f8e6596cb8a0d9fe0f30c2567b9ea5df56 Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Tue, 21 Oct 2025 18:05:16 +0300 Subject: [PATCH 1/4] feat: render additional footer items in navigation --- .../AsideNavigation/AsideNavigation.tsx | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/containers/AsideNavigation/AsideNavigation.tsx b/src/containers/AsideNavigation/AsideNavigation.tsx index cec789d2a6..be4d2c2ad0 100644 --- a/src/containers/AsideNavigation/AsideNavigation.tsx +++ b/src/containers/AsideNavigation/AsideNavigation.tsx @@ -58,6 +58,7 @@ export interface AsideNavigationProps { ydbInternalUser: JSX.Element; menuItems?: MenuItem[]; content: React.ReactNode; + renderFooterItems?: (defaultFooterItems: React.ReactNode) => React.ReactNode; user?: {login: string; icon?: IconData}; } @@ -110,10 +111,11 @@ export function AsideNavigation(props: AsideNavigationProps) { onChangeCompact={setIsCompact} className={b()} renderContent={() => props.content} - renderFooter={({compact, asideRef}) => ( - + renderFooter={({compact: footerCompact, asideRef}) => { + const defaultFooterItems = [ + />, - - + compact={footerCompact} + />, + + {props.ydbInternalUser} - - - )} + , + ]; + + return props.renderFooterItems + ? props.renderFooterItems(defaultFooterItems) + : defaultFooterItems; + }} panelItems={[ { id: 'user-settings', From c66277f84a2205cfe02588b20c405de631a903c4 Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Tue, 21 Oct 2025 18:07:52 +0300 Subject: [PATCH 2/4] fix: add fragment --- src/containers/AsideNavigation/AsideNavigation.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/containers/AsideNavigation/AsideNavigation.tsx b/src/containers/AsideNavigation/AsideNavigation.tsx index be4d2c2ad0..e1913403b0 100644 --- a/src/containers/AsideNavigation/AsideNavigation.tsx +++ b/src/containers/AsideNavigation/AsideNavigation.tsx @@ -58,8 +58,8 @@ export interface AsideNavigationProps { ydbInternalUser: JSX.Element; menuItems?: MenuItem[]; content: React.ReactNode; - renderFooterItems?: (defaultFooterItems: React.ReactNode) => React.ReactNode; user?: {login: string; icon?: IconData}; + renderFooterItems?: (defaultFooterItems: React.ReactNode) => React.ReactNode; } enum Panel { @@ -157,9 +157,13 @@ export function AsideNavigation(props: AsideNavigationProps) { , ]; - return props.renderFooterItems - ? props.renderFooterItems(defaultFooterItems) - : defaultFooterItems; + return ( + + {props.renderFooterItems + ? props.renderFooterItems(defaultFooterItems) + : defaultFooterItems} + + ); }} panelItems={[ { From 06a35e02e30704b89dac6ef6b546df7106a607d4 Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Tue, 21 Oct 2025 18:12:03 +0300 Subject: [PATCH 3/4] fix: review fixes --- src/containers/AsideNavigation/AsideNavigation.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/containers/AsideNavigation/AsideNavigation.tsx b/src/containers/AsideNavigation/AsideNavigation.tsx index e1913403b0..0135487d7c 100644 --- a/src/containers/AsideNavigation/AsideNavigation.tsx +++ b/src/containers/AsideNavigation/AsideNavigation.tsx @@ -59,7 +59,10 @@ export interface AsideNavigationProps { menuItems?: MenuItem[]; content: React.ReactNode; user?: {login: string; icon?: IconData}; - renderFooterItems?: (defaultFooterItems: React.ReactNode) => React.ReactNode; + renderFooterItems?: ( + defaultFooterItems: React.ReactNode[], + ctx: {compact: boolean; asideRef: React.RefObject}, + ) => React.ReactNode; } enum Panel { @@ -160,7 +163,10 @@ export function AsideNavigation(props: AsideNavigationProps) { return ( {props.renderFooterItems - ? props.renderFooterItems(defaultFooterItems) + ? props.renderFooterItems(defaultFooterItems, { + compact: footerCompact, + asideRef, + }) : defaultFooterItems} ); From 3d6503fa2921aa9018bdb6c226342088f0fc397f Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Tue, 21 Oct 2025 18:26:32 +0300 Subject: [PATCH 4/4] fix: more clear returntype --- src/containers/AsideNavigation/AsideNavigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/AsideNavigation/AsideNavigation.tsx b/src/containers/AsideNavigation/AsideNavigation.tsx index 0135487d7c..6d7e95760c 100644 --- a/src/containers/AsideNavigation/AsideNavigation.tsx +++ b/src/containers/AsideNavigation/AsideNavigation.tsx @@ -62,7 +62,7 @@ export interface AsideNavigationProps { renderFooterItems?: ( defaultFooterItems: React.ReactNode[], ctx: {compact: boolean; asideRef: React.RefObject}, - ) => React.ReactNode; + ) => React.ReactNode[]; } enum Panel {