Skip to content

Commit f604405

Browse files
author
Garrett Downs
committed
feat(profile): confirm before signing out
1 parent 7a4acac commit f604405

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

public/global.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
--shortcut-color: var(--secondary-text-color);
7979
--warning-color: hsl(48, 90%, 70%);
8080
--error-color: hsl(0, 90%, 70%);
81-
--success-color: hsl(131, 60%, 70%);
81+
--success-color: var(--app-text-color);
82+
/* --success-color: hsl(131, 60%, 70%); */
8283

8384
font-size: var(--base-font-size);
8485
}

src/routes/AppSettings.svelte

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import { Onyx } from 'onyx-ui/services';
1515
import { registerView, updateView, view } from 'onyx-ui/stores/view';
1616
import { onMount } from 'svelte';
17-
import MdCheck from 'svelte-icons/md/MdCheck.svelte';
1817
import { push, replace } from 'svelte-spa-router';
1918
import { Auth } from '../lib/auth';
2019
import { Cache } from '../lib/cache';
@@ -303,8 +302,7 @@
303302
Cache.invalidate();
304303
Onyx.toaster.show({
305304
title: 'Cache cleared',
306-
icon: MdCheck,
307-
type: 'info',
305+
type: 'success',
308306
});
309307
},
310308
}}
@@ -318,8 +316,7 @@
318316
push('/signin');
319317
Onyx.toaster.show({
320318
title: 'Successfully signed out',
321-
icon: MdCheck,
322-
type: 'info',
319+
type: 'success',
323320
});
324321
}}
325322
onCancel={() => {}}

src/routes/Profile.svelte

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<script lang="ts">
2-
import Button from 'onyx-ui/components/buttons/Button.svelte';
2+
import ConfirmButton from 'onyx-ui/components/buttons/ConfirmButton.svelte';
33
import Card from 'onyx-ui/components/card/Card.svelte';
44
import CardContent from 'onyx-ui/components/card/CardContent.svelte';
55
import Divider from 'onyx-ui/components/divider/Divider.svelte';
66
import FormRow from 'onyx-ui/components/form/FormRow.svelte';
77
import Typography from 'onyx-ui/components/Typography.svelte';
88
import View from 'onyx-ui/components/view/View.svelte';
99
import ViewContent from 'onyx-ui/components/view/ViewContent.svelte';
10-
import { DataStatus } from 'onyx-ui/enums';
10+
import { Color, DataStatus } from 'onyx-ui/enums';
11+
import { Onyx } from 'onyx-ui/services';
1112
import { registerView, updateView } from 'onyx-ui/stores/view';
1213
import { onMount } from 'svelte';
1314
import { push } from 'svelte-spa-router';
@@ -88,15 +89,19 @@
8889
<FormRow label="Plan" navi={{ itemId: `plan`, onSelect: () => {} }}>{data.plan}</FormRow>
8990
<Divider title="description" />
9091
<Typography>{data.description || 'No description provided.'}</Typography>
91-
<Button
92+
<ConfirmButton
9293
title="Sign Out"
93-
navi={{
94-
itemId: `btnSignOut`,
95-
onSelect: () => {
96-
new Auth().clearSession();
97-
push('/signin');
98-
},
94+
color={Color.Accent}
95+
confirmText="Yes, sign out"
96+
onConfirm={() => {
97+
new Auth().clearSession();
98+
push('/signin');
99+
Onyx.toaster.show({
100+
title: 'Successfully signed out',
101+
type: 'success',
102+
});
99103
}}
104+
onCancel={() => {}}
100105
/>
101106
{:catch}
102107
<Typography align="center">Failed to load data</Typography>

0 commit comments

Comments
 (0)