Skip to content

Commit e901ed6

Browse files
orgrimarrvraravam
authored andcommitted
chore: handle isWorkspaceDrawerOpen transform
1 parent 4469e84 commit e901ed6

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

src/components/layout/AppLayout.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,21 @@ const styles = (theme: { workspaces: { drawer: { width: any } } }) => ({
5353
// width: `calc(100% + ${theme.workspaces.drawer.width}px)`,
5454
width: '100%',
5555
transition,
56+
},
57+
appContentTransformTextWorkspace: {
5658
transform() {
5759
return workspaceStore.isWorkspaceDrawerOpen
5860
? 'translateX(0)'
5961
: `translateX(-${theme.workspaces.drawer.width}px)`;
6062
},
6163
},
64+
appContentTransformIconWorkspace: {
65+
transform() {
66+
return workspaceStore.isWorkspaceDrawerOpen
67+
? 'translateX(0)'
68+
: `translateX(-75px)`;
69+
},
70+
},
6271
titleBar: {
6372
display: 'block',
6473
zIndex: 1,
@@ -149,7 +158,13 @@ class AppLayout extends Component<PropsWithChildren<IProps>, IState> {
149158
className={classes.titleBar}
150159
/>
151160
)}
152-
<div className={`app__content ${classes.appContent}`}>
161+
<div
162+
className={`app__content ${classes.appContent} ${
163+
settings.all.app.useWorkspaceDrawerIconStyle
164+
? classes.appContentTransformIconWorkspace
165+
: classes.appContentTransformTextWorkspace
166+
}`}
167+
>
153168
{workspacesDrawer}
154169
{sidebar}
155170
<div className="app__service">

src/features/appearance/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,6 @@ function generateOpenWorkspaceStyle() {
381381
`;
382382
}
383383

384-
function generateWorkspaceWidthStyle(widthStr) {
385-
const width = Number(widthStr);
386-
return `
387-
.drawerWithIconWidth {
388-
width: ${width}
389-
}
390-
`;
391-
}
392-
393384
function generateStyle(settings, app) {
394385
let style = '';
395386

@@ -428,8 +419,6 @@ function generateStyle(settings, app) {
428419
isFullScreen,
429420
);
430421

431-
style += generateWorkspaceWidthStyle(serviceRibbonWidth);
432-
433422
if (shouldShowDragArea) {
434423
style += generateShowDragAreaStyle(accentColor);
435424
}

src/features/workspaces/components/WorkspaceDrawer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ const styles = theme => ({
4646
drawerWithText: {
4747
width: `${theme.workspaces.drawer.width}px`,
4848
},
49+
drawerWithIcon: {
50+
width: '75px',
51+
},
4952
headline: {
5053
fontSize: '24px',
5154
marginTop: '38px',
@@ -121,7 +124,7 @@ class WorkspaceDrawer extends Component<IProps> {
121124
: activeWorkspace;
122125

123126
const drawerWithClass = useIconDisplayStyle
124-
? 'drawerWithIconWidth'
127+
? classes.drawerWithIcon
125128
: classes.drawerWithText;
126129
return (
127130
<div className={`${classes.drawer} ${drawerWithClass} workspaces-drawer`}>

0 commit comments

Comments
 (0)