feat: Implement chat page state management in layout and sidebar
- Added `isChatPage` state to the Style context to manage chat page layout. - Updated `PageLayout` component to adjust padding based on the chat page state. - Enhanced `SiderBar` component to dispatch chat page state changes when chat-related items are selected.
This commit is contained in:
@@ -11,6 +11,7 @@ export const StyleProvider = ({ children }) => {
|
||||
const [state, setState] = useState({
|
||||
isMobile: false,
|
||||
showSider: false,
|
||||
isChatPage: false,
|
||||
});
|
||||
|
||||
const dispatch = (action) => {
|
||||
@@ -25,6 +26,9 @@ export const StyleProvider = ({ children }) => {
|
||||
case 'SET_MOBILE':
|
||||
setState(prev => ({ ...prev, isMobile: action.payload }));
|
||||
break;
|
||||
case 'SET_CHAT_PAGE':
|
||||
setState(prev => ({ ...prev, isChatPage: action.payload }));
|
||||
break;
|
||||
default:
|
||||
setState(prev => ({ ...prev, ...action }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user