Skip to content

Commit

Permalink
chore(global-writes): fix subtab container styles (#6459)
Browse files Browse the repository at this point in the history
  • Loading branch information
gribnoysup authored Nov 7, 2024
1 parent ab3ba05 commit 8585db7
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions packages/compass-global-writes/src/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@ import ShardingError from './states/sharding-error';
import IncompleteShardingSetup from './states/incomplete-sharding-setup';

const containerStyles = css({
paddingLeft: spacing[400],
paddingRight: spacing[400],
display: 'flex',
width: '100%',
height: '100%',
maxWidth: '700px',
});

const workspaceContentStyles = css({
paddingTop: spacing[400],
paddingLeft: spacing[400],
paddingRight: spacing[400],
maxWidth: '700px',
});

const centeredContent = css({
const loaderStyles = css({
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'center',
alignItems: 'center',
height: '100%',
width: '100%',
marginTop: spacing[1800] * 2,
});

type GlobalWritesProps = {
Expand All @@ -44,16 +41,8 @@ type GlobalWritesProps = {
function ShardingStateView({
shardingStatus,
}: {
shardingStatus: ShardingStatus;
shardingStatus: Exclude<ShardingStatus, 'NOT_READY'>;
}) {
if (shardingStatus === ShardingStatuses.NOT_READY) {
return (
<div className={centeredContent}>
<SpinLoaderWithLabel progressText="Loading …" />
</div>
);
}

if (
shardingStatus === ShardingStatuses.UNSHARDED ||
shardingStatus === ShardingStatuses.SUBMITTING_FOR_SHARDING
Expand Down Expand Up @@ -105,14 +94,22 @@ function ShardingStateView({
}

export function GlobalWrites({ shardingStatus }: GlobalWritesProps) {
if (shardingStatus === ShardingStatuses.NOT_READY) {
return (
<div className={loaderStyles}>
<SpinLoaderWithLabel progressText="Loading …" />
</div>
);
}

return (
<div className={containerStyles}>
<WorkspaceContainer className={workspaceContentStyles}>
<ConfirmationModalArea>
<WorkspaceContainer>
<ConfirmationModalArea>
<div className={containerStyles}>
<ShardingStateView shardingStatus={shardingStatus} />
</ConfirmationModalArea>
</WorkspaceContainer>
</div>
</div>
</ConfirmationModalArea>
</WorkspaceContainer>
);
}
export default connect((state: RootState) => ({
Expand Down

0 comments on commit 8585db7

Please sign in to comment.