Skip to content

Commit 0ed96f4

Browse files
authored
fix(settings): tweak settings modal text alignment COMPASS-6413 (#3946)
* tweak settings modal alignment * 50%? * bring back the font weight * rm comment
1 parent 6837019 commit 0ed96f4

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

packages/compass-settings/src/components/settings/theme.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,27 @@ const checkboxStyles = css({
2929
marginBottom: spacing[3],
3030
});
3131

32+
const radioBoxStyles = css({
33+
div: {
34+
textAlign: 'left',
35+
padding: spacing[3],
36+
justifyContent: 'flex-start',
37+
},
38+
});
39+
40+
const themePreviewStyles = css({
41+
marginRight: spacing[2],
42+
maxWidth: '50%',
43+
});
44+
3245
function LightThemePreview() {
3346
return (
3447
<svg
3548
xmlns="http://www.w3.org/2000/svg"
3649
xmlnsXlink="http://www.w3.org/1999/xlink"
3750
fill="none"
3851
viewBox="0 0 171 119"
52+
className={themePreviewStyles}
3953
>
4054
<rect width="171" height="119" fill="#fff" rx="6" />
4155
<rect width="42" height="119" fill="#F9FBFA" rx="6" />
@@ -58,6 +72,7 @@ function DarkThemePreview() {
5872
xmlnsXlink="http://www.w3.org/1999/xlink"
5973
fill="none"
6074
viewBox="0 0 171 119"
75+
className={themePreviewStyles}
6176
>
6277
<rect width="171" height="119" fill="#3D4F58" rx="6" />
6378
<rect width="42" height="119" fill="#1C2D38" rx="6" />
@@ -120,10 +135,12 @@ export const ThemeSettings: React.FunctionComponent<ThemeSettingsProps> = ({
120135
id="theme-selector"
121136
onChange={handleSelectorChange}
122137
value={themeValue}
138+
size="full"
123139
>
124140
<RadioBox
125141
id="theme-selector-light"
126142
data-testid="theme-selector-light"
143+
className={radioBoxStyles}
127144
value="LIGHT"
128145
disabled={!!preferenceStates.theme || themeValue === 'OS_THEME'}
129146
>
@@ -133,6 +150,7 @@ export const ThemeSettings: React.FunctionComponent<ThemeSettingsProps> = ({
133150
<RadioBox
134151
id="theme-selector-dark"
135152
data-testid="theme-selector-dark"
153+
className={radioBoxStyles}
136154
value="DARK"
137155
disabled={!!preferenceStates.theme || themeValue === 'OS_THEME'}
138156
>

packages/compass-settings/src/components/sidebar.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import React from 'react';
2-
import {
3-
css,
4-
cx,
5-
spacing,
6-
palette,
7-
Button,
8-
} from '@mongodb-js/compass-components';
2+
import { css, cx, spacing, palette } from '@mongodb-js/compass-components';
93

104
const buttonStyles = css({
115
borderRadius: spacing[1],
@@ -16,6 +10,7 @@ const buttonStyles = css({
1610
width: '100%',
1711
padding: spacing[2],
1812
textAlign: 'left',
13+
fontWeight: 500,
1914
});
2015

2116
const hoverStyles = css({
@@ -28,8 +23,6 @@ const hoverStyles = css({
2823
const activeStyles = css({
2924
backgroundColor: palette.green.light3,
3025
color: palette.gray.dark3,
31-
// The LG component overwrites the color
32-
// with the default value when the button loses focus.
3326
'&:active,&:focus': {
3427
backgroundColor: palette.green.light3,
3528
color: palette.gray.dark3,
@@ -54,7 +47,8 @@ const SettingsSideNav: React.FunctionComponent<SidebarProps> = ({
5447
aria-labelledby="modal-title"
5548
>
5649
{items.map((item) => (
57-
<Button
50+
<button
51+
type="button"
5852
key={item}
5953
role="tab"
6054
aria-controls={`${item} Section`}
@@ -68,7 +62,7 @@ const SettingsSideNav: React.FunctionComponent<SidebarProps> = ({
6862
onClick={() => onSelectItem(item)}
6963
>
7064
{item}
71-
</Button>
65+
</button>
7266
))}
7367
</div>
7468
);

0 commit comments

Comments
 (0)