Skip to content

Commit fc4276d

Browse files
committed
Merge branch 'fix-proxy-form-spacing'
2 parents f34d216 + 3b12b55 commit fc4276d

File tree

3 files changed

+26
-33
lines changed

3 files changed

+26
-33
lines changed

desktop/packages/mullvad-vpn/src/renderer/components/EditApiAccessMethod.tsx

+6-14
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ import { useLastDefinedValue } from '../lib/utility-hooks';
1616
import { useSelector } from '../redux/store';
1717
import { SettingsForm } from './cell/SettingsForm';
1818
import { BackAction } from './KeyboardNavigation';
19-
import {
20-
Layout,
21-
SettingsContainer,
22-
SettingsContent,
23-
SettingsNavigationScrollbars,
24-
SettingsStack,
25-
} from './Layout';
19+
import { Layout, SettingsContainer, SettingsContent, SettingsNavigationScrollbars } from './Layout';
2620
import { ModalAlert, ModalAlertType } from './Modal';
2721
import { NavigationBar, NavigationContainer, NavigationItems, TitleBarItem } from './NavigationBar';
2822
import { NamedProxyForm } from './ProxyForm';
@@ -114,13 +108,11 @@ function AccessMethodForm() {
114108
<HeaderSubTitle>{subtitle}</HeaderSubTitle>
115109
</SettingsHeader>
116110

117-
<SettingsStack>
118-
{id !== undefined && method === undefined ? (
119-
<span>Failed to open method</span>
120-
) : (
121-
<NamedProxyForm proxy={method} onSave={onSave} onCancel={pop} />
122-
)}
123-
</SettingsStack>
111+
{id !== undefined && method === undefined ? (
112+
<span>Failed to open method</span>
113+
) : (
114+
<NamedProxyForm proxy={method} onSave={onSave} onCancel={pop} />
115+
)}
124116

125117
<TestingDialog
126118
name={updatedMethod?.name ?? ''}

desktop/packages/mullvad-vpn/src/renderer/components/EditCustomBridge.tsx

+7-15
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import { useBoolean } from '../lib/utility-hooks';
88
import { useSelector } from '../redux/store';
99
import { SettingsForm } from './cell/SettingsForm';
1010
import { BackAction } from './KeyboardNavigation';
11-
import {
12-
Layout,
13-
SettingsContainer,
14-
SettingsContent,
15-
SettingsNavigationScrollbars,
16-
SettingsStack,
17-
} from './Layout';
11+
import { Layout, SettingsContainer, SettingsContent, SettingsNavigationScrollbars } from './Layout';
1812
import { ModalAlert, ModalAlertType } from './Modal';
1913
import { NavigationBar, NavigationContainer, NavigationItems, TitleBarItem } from './NavigationBar';
2014
import { ProxyForm } from './ProxyForm';
@@ -84,14 +78,12 @@ function CustomBridgeForm() {
8478
<HeaderTitle>{title}</HeaderTitle>
8579
</SettingsHeader>
8680

87-
<SettingsStack>
88-
<ProxyForm
89-
proxy={bridgeSettings.custom}
90-
onSave={onSave}
91-
onCancel={pop}
92-
onDelete={bridgeSettings.custom === undefined ? undefined : showDeleteDialog}
93-
/>
94-
</SettingsStack>
81+
<ProxyForm
82+
proxy={bridgeSettings.custom}
83+
onSave={onSave}
84+
onCancel={pop}
85+
onDelete={bridgeSettings.custom === undefined ? undefined : showDeleteDialog}
86+
/>
9587

9688
<ModalAlert
9789
isOpen={deleteDialogVisible}

desktop/packages/mullvad-vpn/src/renderer/components/ProxyForm.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
22
import React from 'react';
3+
import styled from 'styled-components';
34

45
import {
56
CustomProxy,
@@ -156,6 +157,12 @@ interface ProxyFormButtonsProps {
156157
new: boolean;
157158
}
158159

160+
// TODO: Temporary fix, should be replaced with a flex or shared component
161+
const ActionGroup = styled.div({
162+
display: 'flex',
163+
gap: '12px',
164+
});
165+
159166
export function ProxyFormButtons(props: ProxyFormButtonsProps) {
160167
const { onSave, onCancel, onDelete } = useContext(proxyFormContext);
161168

@@ -171,10 +178,12 @@ export function ProxyFormButtons(props: ProxyFormButtonsProps) {
171178
</SmallButton>
172179
</SmallButtonGroupStart>
173180
)}
174-
<SmallButton onClick={onCancel}>{messages.gettext('Cancel')}</SmallButton>
175-
<SmallButton onClick={onSave} disabled={!formSubmittable}>
176-
{props.new ? messages.gettext('Add') : messages.gettext('Save')}
177-
</SmallButton>
181+
<ActionGroup>
182+
<SmallButton onClick={onCancel}>{messages.gettext('Cancel')}</SmallButton>
183+
<SmallButton onClick={onSave} disabled={!formSubmittable}>
184+
{props.new ? messages.gettext('Add') : messages.gettext('Save')}
185+
</SmallButton>
186+
</ActionGroup>
178187
</SmallButtonGroup>
179188
);
180189
}

0 commit comments

Comments
 (0)