From a485db50650c3c5a671bf3bca84c63a8c5d27dbb Mon Sep 17 00:00:00 2001 From: CalciumIon <1808837298@qq.com> Date: Fri, 13 Dec 2024 19:28:09 +0800 Subject: [PATCH] fix: Refine sider visibility logic in HeaderBar component - Updated the click handler in HeaderBar to correctly toggle the visibility of the sider based on the current item selection. - Ensured that the sider is hidden when navigating to the home item and displayed conditionally for other items, improving the user interface responsiveness. --- web/src/components/HeaderBar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/components/HeaderBar.js b/web/src/components/HeaderBar.js index 6bec50db..759a7278 100644 --- a/web/src/components/HeaderBar.js +++ b/web/src/components/HeaderBar.js @@ -148,10 +148,12 @@ const HeaderBar = () => {
{ if (props.itemKey === 'home') { styleDispatch({ type: 'SET_INNER_PADDING', payload: false }); - // styleDispatch({ type: 'SET_SIDER', payload: false }); + styleDispatch({ type: 'SET_SIDER', payload: false }); } else { styleDispatch({ type: 'SET_INNER_PADDING', payload: true }); - // styleDispatch({ type: 'SET_SIDER', payload: true }); + if (!styleState.isMobile) { + styleDispatch({ type: 'SET_SIDER', payload: true }); + } } }}>