feat: Refactor style management for inner padding in layout components
- Updated HeaderBar, PageLayout, and SiderBar components to manage inner padding state based on selected items. - Replaced `isChatPage` state with `shouldInnerPadding` in Style context for better clarity and functionality. - Enhanced user experience by dynamically adjusting content padding based on navigation selections.
This commit is contained in:
@@ -11,7 +11,7 @@ export const StyleProvider = ({ children }) => {
|
||||
const [state, setState] = useState({
|
||||
isMobile: false,
|
||||
showSider: false,
|
||||
isChatPage: false,
|
||||
shouldInnerPadding: false,
|
||||
});
|
||||
|
||||
const dispatch = (action) => {
|
||||
@@ -26,8 +26,8 @@ export const StyleProvider = ({ children }) => {
|
||||
case 'SET_MOBILE':
|
||||
setState(prev => ({ ...prev, isMobile: action.payload }));
|
||||
break;
|
||||
case 'SET_CHAT_PAGE':
|
||||
setState(prev => ({ ...prev, isChatPage: action.payload }));
|
||||
case 'SET_INNER_PADDING':
|
||||
setState(prev => ({ ...prev, shouldInnerPadding: action.payload }));
|
||||
break;
|
||||
default:
|
||||
setState(prev => ({ ...prev, ...action }));
|
||||
|
||||
Reference in New Issue
Block a user