Skip to content

Commit 8585db7

Browse files
authored
chore(global-writes): fix subtab container styles (#6459)
1 parent ab3ba05 commit 8585db7

File tree

1 file changed

+22
-25
lines changed
  • packages/compass-global-writes/src/components

1 file changed

+22
-25
lines changed

packages/compass-global-writes/src/components/index.tsx

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@ import ShardingError from './states/sharding-error';
1818
import IncompleteShardingSetup from './states/incomplete-sharding-setup';
1919

2020
const containerStyles = css({
21-
paddingLeft: spacing[400],
22-
paddingRight: spacing[400],
2321
display: 'flex',
2422
width: '100%',
25-
height: '100%',
26-
maxWidth: '700px',
27-
});
28-
29-
const workspaceContentStyles = css({
3023
paddingTop: spacing[400],
24+
paddingLeft: spacing[400],
25+
paddingRight: spacing[400],
26+
maxWidth: '700px',
3127
});
3228

33-
const centeredContent = css({
29+
const loaderStyles = css({
3430
display: 'flex',
31+
alignItems: 'flex-start',
3532
justifyContent: 'center',
36-
alignItems: 'center',
37-
height: '100%',
33+
width: '100%',
34+
marginTop: spacing[1800] * 2,
3835
});
3936

4037
type GlobalWritesProps = {
@@ -44,16 +41,8 @@ type GlobalWritesProps = {
4441
function ShardingStateView({
4542
shardingStatus,
4643
}: {
47-
shardingStatus: ShardingStatus;
44+
shardingStatus: Exclude<ShardingStatus, 'NOT_READY'>;
4845
}) {
49-
if (shardingStatus === ShardingStatuses.NOT_READY) {
50-
return (
51-
<div className={centeredContent}>
52-
<SpinLoaderWithLabel progressText="Loading …" />
53-
</div>
54-
);
55-
}
56-
5746
if (
5847
shardingStatus === ShardingStatuses.UNSHARDED ||
5948
shardingStatus === ShardingStatuses.SUBMITTING_FOR_SHARDING
@@ -105,14 +94,22 @@ function ShardingStateView({
10594
}
10695

10796
export function GlobalWrites({ shardingStatus }: GlobalWritesProps) {
97+
if (shardingStatus === ShardingStatuses.NOT_READY) {
98+
return (
99+
<div className={loaderStyles}>
100+
<SpinLoaderWithLabel progressText="Loading …" />
101+
</div>
102+
);
103+
}
104+
108105
return (
109-
<div className={containerStyles}>
110-
<WorkspaceContainer className={workspaceContentStyles}>
111-
<ConfirmationModalArea>
106+
<WorkspaceContainer>
107+
<ConfirmationModalArea>
108+
<div className={containerStyles}>
112109
<ShardingStateView shardingStatus={shardingStatus} />
113-
</ConfirmationModalArea>
114-
</WorkspaceContainer>
115-
</div>
110+
</div>
111+
</ConfirmationModalArea>
112+
</WorkspaceContainer>
116113
);
117114
}
118115
export default connect((state: RootState) => ({

0 commit comments

Comments
 (0)