Skip to content

Commit 1c80fbf

Browse files
committed
refactor: reset settings component
Signed-off-by: Adam Setch <[email protected]>
1 parent 2e96cb8 commit 1c80fbf

File tree

2 files changed

+56
-49
lines changed

2 files changed

+56
-49
lines changed
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type FC, useCallback, useContext, useState } from 'react';
22

3-
import { Button, Text } from '@primer/react';
3+
import { Button, Stack, Text } from '@primer/react';
44
import { Dialog } from '@primer/react/experimental';
55
import { AppContext } from '../../context/App';
66

@@ -14,7 +14,7 @@ export const SettingsReset: FC = () => {
1414
}, [resetSettings]);
1515

1616
return (
17-
<>
17+
<Stack align="center">
1818
<Button
1919
variant="danger"
2020
onClick={() => setIsOpen(!isOpen)}
@@ -23,29 +23,29 @@ export const SettingsReset: FC = () => {
2323
>
2424
Reset Settings
2525
</Button>
26-
isOpen && (
27-
<Dialog
28-
title="Reset Settings"
29-
width="large"
30-
onClose={onDialogClose}
31-
footerButtons={[
32-
{
33-
buttonType: 'default',
34-
content: 'Cancel',
35-
onClick: onDialogClose,
36-
},
37-
{
38-
buttonType: 'danger',
39-
content: 'Reset',
40-
onClick: onDialogProceed,
41-
},
42-
]}
43-
data-testid="reset-dialog"
44-
>
45-
Please confirm that you want to reset all settings to the{' '}
46-
<Text as="strong">Gitify defaults</Text>
47-
</Dialog>
48-
)
49-
</>
26+
{isOpen && (
27+
<Dialog
28+
title="Reset Settings"
29+
width="large"
30+
onClose={onDialogClose}
31+
footerButtons={[
32+
{
33+
buttonType: 'default',
34+
content: 'Cancel',
35+
onClick: onDialogClose,
36+
},
37+
{
38+
buttonType: 'danger',
39+
content: 'Reset',
40+
onClick: onDialogProceed,
41+
},
42+
]}
43+
data-testid="reset-dialog"
44+
>
45+
Please confirm that you want to reset all settings to the{' '}
46+
<Text as="strong">Gitify defaults</Text>
47+
</Dialog>
48+
)}
49+
</Stack>
5050
);
5151
};

src/renderer/routes/__snapshots__/Settings.test.tsx.snap

Lines changed: 30 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)