Skip to content

Commit 256cad8

Browse files
committed
Avoid layout shifts
1 parent e8b4d94 commit 256cad8

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

web/src/ui/pages/s3Explorer/Explorer.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,36 @@ export function Explorer(props: Props) {
135135

136136
const { cx, css, theme } = useStyles();
137137

138+
if (
139+
isCurrentWorkingDirectoryLoaded &&
140+
currentWorkingDirectoryView.directoryPath !== directoryPath
141+
) {
142+
return (
143+
<div
144+
className={cx(
145+
css({
146+
display: "flex",
147+
justifyContent: "center",
148+
alignItems: "center",
149+
height: "100%"
150+
}),
151+
className
152+
)}
153+
>
154+
<CircularProgress />
155+
</div>
156+
);
157+
}
158+
138159
if (!isCurrentWorkingDirectoryLoaded) {
139160
return (
140161
<div
141162
className={cx(
142163
css({
143164
display: "flex",
144165
justifyContent: "center",
145-
alignItems: "center"
166+
alignItems: "center",
167+
height: "100%"
146168
}),
147169
className
148170
)}

web/src/ui/pages/s3Explorer/Page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ function S3ProfileSelect() {
359359
}
360360

361361
const useStyles = tss.withName({ S3Explorer }).create(({ theme }) => ({
362-
root: {},
362+
root: {
363+
height: "100%"
364+
},
363365
explorer: {
364366
marginTop: theme.spacing(4)
365367
}

0 commit comments

Comments
 (0)