Skip to content

Commit 39c09c9

Browse files
authored
fix(compass-global-writes): unite banner btn styles COMPASS-8451 (#6484)
fix(compass-global-writes): unite banner btn styles Co-authored-by: Paula Stachova <[email protected]>
1 parent e084705 commit 39c09c9

File tree

5 files changed

+25
-29
lines changed

5 files changed

+25
-29
lines changed

packages/compass-global-writes/src/components/common-styles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ export const containerStyles = css({
1717
marginBottom: spacing[400],
1818
textAlign: 'justify',
1919
});
20+
21+
export const bannerBtnStyles = css({
22+
float: 'right',
23+
height: `${spacing[600]}px`,
24+
});

packages/compass-global-writes/src/components/states/incomplete-sharding-setup.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
import { connect } from 'react-redux';
2121
import ExampleCommandsMarkup from '../example-commands-markup';
2222
import { ShardZonesTable } from '../shard-zones-table';
23+
import { bannerBtnStyles } from '../common-styles';
2324

2425
const containerStyles = css({
2526
display: 'flex',
@@ -28,10 +29,6 @@ const containerStyles = css({
2829
marginBottom: spacing[400],
2930
});
3031

31-
const manageBtnStyles = css({
32-
marginTop: spacing[100],
33-
});
34-
3532
export interface IncompleteShardingSetupProps {
3633
shardKey: ShardKey;
3734
shardZones: ShardZoneData[];
@@ -70,7 +67,7 @@ export function IncompleteShardingSetup({
7067
variant={ButtonVariant.Default}
7168
isLoading={isSubmittingForSharding}
7269
loadingIndicator={<SpinLoader />}
73-
className={manageBtnStyles}
70+
className={bannerBtnStyles}
7471
>
7572
Enable Global Writes
7673
</Button>

packages/compass-global-writes/src/components/states/shard-key-mismatch.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import {
22
Banner,
33
BannerVariant,
44
Button,
5-
spacing,
6-
css,
75
ButtonVariant,
86
SpinLoader,
97
} from '@mongodb-js/compass-components';
@@ -17,11 +15,11 @@ import {
1715
} from '../../store/reducer';
1816
import { connect } from 'react-redux';
1917
import type { ManagedNamespace } from '../../services/atlas-global-writes-service';
20-
import { containerStyles, bannerStyles } from '../common-styles';
21-
22-
const unmanageBtnStyles = css({
23-
marginTop: spacing[100],
24-
});
18+
import {
19+
containerStyles,
20+
bannerStyles,
21+
bannerBtnStyles,
22+
} from '../common-styles';
2523

2624
const getRequestedShardKey = (
2725
managedNamespace: ManagedNamespace
@@ -71,7 +69,7 @@ export function ShardKeyMismatch({
7169
variant={ButtonVariant.Default}
7270
isLoading={isUnmanagingNamespace}
7371
loadingIndicator={<SpinLoader />}
74-
className={unmanageBtnStyles}
72+
className={bannerBtnStyles}
7573
>
7674
Unmanage collection
7775
</Button>

packages/compass-global-writes/src/components/states/sharding-error.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ import {
1414
ShardingStatuses,
1515
} from '../../store/reducer';
1616
import CreateShardKeyForm from '../create-shard-key-form';
17-
import { containerStyles, bannerStyles } from '../common-styles';
18-
19-
const btnStyles = css({
20-
float: 'right',
21-
height: spacing[600],
22-
});
17+
import {
18+
containerStyles,
19+
bannerStyles,
20+
bannerBtnStyles,
21+
} from '../common-styles';
2322

2423
const errorStyles = css({
2524
marginTop: spacing[200],
@@ -47,7 +46,7 @@ export function ShardingError({
4746
make any necessary changes to your collection, and try again.
4847
<div className={errorStyles}>{shardingError}</div>
4948
<Button
50-
className={btnStyles}
49+
className={bannerBtnStyles}
5150
data-testid="cancel-sharding-btn"
5251
disabled={isCancellingSharding || isSubmittingForSharding}
5352
isLoading={isCancellingSharding}

packages/compass-global-writes/src/components/states/sharding.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import {
44
BannerVariant,
55
Body,
66
Button,
7-
css,
87
Link,
9-
spacing,
108
SpinLoader,
119
} from '@mongodb-js/compass-components';
1210
import { connect } from 'react-redux';
@@ -15,15 +13,14 @@ import {
1513
type RootState,
1614
ShardingStatuses,
1715
} from '../../store/reducer';
18-
import { containerStyles, bannerStyles } from '../common-styles';
16+
import {
17+
containerStyles,
18+
bannerStyles,
19+
bannerBtnStyles,
20+
} from '../common-styles';
1921

2022
const nbsp = '\u00a0';
2123

22-
const btnStyles = css({
23-
float: 'right',
24-
height: spacing[600],
25-
});
26-
2724
interface ShardingStateProps {
2825
isCancellingSharding: boolean;
2926
onCancelSharding: () => void;
@@ -39,7 +36,7 @@ export function ShardingState({
3936
<strong>Sharding your collection …</strong>
4037
{nbsp}this should not take too long.
4138
<Button
42-
className={btnStyles}
39+
className={bannerBtnStyles}
4340
data-testid="cancel-sharding-btn"
4441
onClick={onCancelSharding}
4542
isLoading={isCancellingSharding}

0 commit comments

Comments
 (0)