diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/Debug.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/Debug.tsx index 0b4d24cbfbe5..9522b422e547 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/Debug.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/Debug.tsx @@ -3,8 +3,9 @@ import styled from 'styled-components'; import { useHistory } from '../lib/history'; import { useBoolean } from '../lib/utility-hooks'; +import { Spacings } from '../tokens'; import * as AppButton from './AppButton'; -import { measurements, spacings } from './common-styles'; +import { measurements } from './common-styles'; import { BackAction } from './KeyboardNavigation'; import { Layout, SettingsContainer } from './Layout'; import { @@ -24,7 +25,7 @@ const StyledContent = styled.div({ }); const StyledButtonGroup = styled.div({ - margin: `${spacings.spacing6} ${measurements.horizontalViewMargin}`, + margin: `${Spacings.spacing6} ${measurements.horizontalViewMargin}`, }); export default function Debug() { diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/Layout.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/Layout.tsx index 865fc790f63f..8ff848cb12b4 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/Layout.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/Layout.tsx @@ -1,7 +1,8 @@ import styled from 'styled-components'; -import { colors } from '../../config.json'; -import { measurements, spacings } from './common-styles'; +import { Colors, Spacings } from '../tokens'; +import { Flex } from './common/layout/Flex'; +import { measurements } from './common-styles'; import HeaderBar from './HeaderBar'; import { NavigationScrollbars } from './NavigationBar'; @@ -13,7 +14,7 @@ export const Container = styled.div({ display: 'flex', flexDirection: 'column', flex: 1, - backgroundColor: colors.blue, + backgroundColor: Colors.blue, overflow: 'hidden', }); @@ -25,7 +26,7 @@ export const Layout = styled.div({ }); export const SettingsContainer = styled(Container)({ - backgroundColor: colors.darkBlue, + backgroundColor: Colors.darkBlue, }); export const SettingsNavigationScrollbars = styled(NavigationScrollbars)({ @@ -40,32 +41,39 @@ export const SettingsContent = styled.div({ marginBottom: measurements.verticalViewMargin, }); -export const SettingsStack = styled.div({ - display: 'flex', - flexDirection: 'column', - gap: spacings.spacing5, -}); - export const Footer = styled.div({ display: 'flex', flexDirection: 'column', flex: 0, - padding: `${spacings.spacing6} ${measurements.horizontalViewMargin} ${measurements.verticalViewMargin}`, + padding: `${Spacings.spacing6} ${measurements.horizontalViewMargin} ${measurements.verticalViewMargin}`, [`${SettingsContent} &&`]: { paddingBottom: 0, }, }); -export const Spacing = styled.div<{ height: string }>((props) => ({ - height: props.height, -})); +export const SettingsStack = styled(Flex).attrs({ + $flexDirection: 'column', + $gap: Spacings.spacing5, +})({}); -export const ButtonStack = styled.div({ - display: 'flex', - flexDirection: 'column', - gap: spacings.spacing5, - margin: `0 ${spacings.spacing6}`, +export const SettingsGroup = styled(Flex).attrs({ + $flex: 1, + $flexDirection: 'column', +})({}); + +export const ButtonStack = styled(Flex).attrs(() => ({ + $flexDirection: 'column', + $gap: Spacings.spacing5, + $margin: `0 ${Spacings.spacing6}`, +}))({ [`${Footer} &&`]: { - margin: `0 ${spacings.spacing3}`, + margin: `0 ${Spacings.spacing3}`, }, }); + +export const LabelStack = styled(Flex).attrs(() => ({ + $flexGrow: 1, + $flexDirection: 'row', + $alignItems: 'center', + $gap: Spacings.spacing3, +}))({}); diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/Settings.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/Settings.tsx index 4c79f0225cc7..15f760941f32 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/Settings.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/Settings.tsx @@ -1,27 +1,30 @@ import { useCallback } from 'react'; -import { colors, strings } from '../../config.json'; +import { strings } from '../../config.json'; import { messages } from '../../shared/gettext'; import { getDownloadUrl } from '../../shared/version'; import { useAppContext } from '../context'; import { useHistory } from '../lib/history'; import { RoutePath } from '../lib/routes'; import { useSelector } from '../redux/store'; +import { Colors } from '../tokens'; import { RedButton } from './AppButton'; import * as Cell from './cell'; +import { TitleBig } from './common/text'; import { BackAction } from './KeyboardNavigation'; import { ButtonStack, Footer, + LabelStack, Layout, SettingsContainer, SettingsContent, + SettingsGroup, SettingsNavigationScrollbars, SettingsStack, } from './Layout'; import { NavigationBar, NavigationContainer, NavigationItems, TitleBarItem } from './NavigationBar'; -import SettingsHeader, { HeaderTitle } from './SettingsHeader'; -import { StyledCellIcon } from './SettingsStyles'; +import SettingsHeader from './SettingsHeader'; export default function Support() { const history = useHistory(); @@ -52,44 +55,44 @@ export default function Support() { - {messages.pgettext('navigation-bar', 'Settings')} + {messages.pgettext('navigation-bar', 'Settings')} {showSubSettings ? ( <> - + - + {showSplitTunneling && ( - + - + )} ) : ( - + - + )} - + - + - + - + {window.env.development && ( - + - + )}