mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 23:29:47 +01:00
fix: fixed sidebar toggle width issues
This commit is contained in:
parent
80f9e33be5
commit
05a290839b
@ -70,13 +70,16 @@ const Sidebar = () => {
|
|||||||
setAsideWidth(leftSidebarWidth);
|
setAsideWidth(leftSidebarWidth);
|
||||||
}, [leftSidebarWidth]);
|
}, [leftSidebarWidth]);
|
||||||
|
|
||||||
|
const leftMenuBarWidth = leftMenuBarOpen ? 48 : 0;
|
||||||
|
const collectionsWidth = asideWidth - leftMenuBarWidth;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="flex relative">
|
<StyledWrapper className="flex relative">
|
||||||
<aside style={{ width: `${asideWidth}px`, minWidth: `${asideWidth}px` }}>
|
<aside>
|
||||||
<div className="flex flex-row h-full w-full">
|
<div className="flex flex-row h-full w-full">
|
||||||
{leftMenuBarOpen && <MenuBar />}
|
{leftMenuBarOpen && <MenuBar />}
|
||||||
|
|
||||||
<div className="flex flex-col w-full">
|
<div className="flex flex-col w-full" style={{width: collectionsWidth}}>
|
||||||
<div className="flex flex-col flex-grow">
|
<div className="flex flex-col flex-grow">
|
||||||
<TitleBar />
|
<TitleBar />
|
||||||
<Collections />
|
<Collections />
|
||||||
|
@ -18,7 +18,11 @@ export const appSlice = createSlice({
|
|||||||
},
|
},
|
||||||
toggleLeftMenuBar: (state) => {
|
toggleLeftMenuBar: (state) => {
|
||||||
state.leftMenuBarOpen = !state.leftMenuBarOpen;
|
state.leftMenuBarOpen = !state.leftMenuBarOpen;
|
||||||
state.leftSidebarWidth = state.leftMenuBarOpen ? 270 : 222;
|
if(state.leftMenuBarOpen) {
|
||||||
|
state.leftSidebarWidth += 48;
|
||||||
|
} else {
|
||||||
|
state.leftSidebarWidth -= 48;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
refreshScreenWidth: (state) => {
|
refreshScreenWidth: (state) => {
|
||||||
state.screenWidth = window.innerWidth;
|
state.screenWidth = window.innerWidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user