|
1 | 1 | <script lang="ts"> |
2 | 2 | import Button from 'onyx-ui/components/buttons/Button.svelte'; |
| 3 | + import ConfirmButton from 'onyx-ui/components/buttons/ConfirmButton.svelte'; |
3 | 4 | import Card from 'onyx-ui/components/card/Card.svelte'; |
4 | 5 | import CardContent from 'onyx-ui/components/card/CardContent.svelte'; |
5 | 6 | import CardHeader from 'onyx-ui/components/card/CardHeader.svelte'; |
|
9 | 10 | import ListHeader from 'onyx-ui/components/list/ListHeader.svelte'; |
10 | 11 | import View from 'onyx-ui/components/view/View.svelte'; |
11 | 12 | import ViewContent from 'onyx-ui/components/view/ViewContent.svelte'; |
12 | | - import { Animations, DataStatus, TextSize, TextWeight } from 'onyx-ui/enums'; |
| 13 | + import { Animations, Color, DataStatus, TextSize, TextWeight } from 'onyx-ui/enums'; |
13 | 14 | import { Onyx } from 'onyx-ui/services'; |
14 | 15 | import { registerView, updateView, view } from 'onyx-ui/stores/view'; |
15 | 16 | import { onMount } from 'svelte'; |
16 | 17 | import MdCheck from 'svelte-icons/md/MdCheck.svelte'; |
17 | | - import { replace } from 'svelte-spa-router'; |
| 18 | + import { push, replace } from 'svelte-spa-router'; |
| 19 | + import { Auth } from '../lib/auth'; |
18 | 20 | import { Cache } from '../lib/cache'; |
19 | 21 | import type { Settings } from '../models'; |
20 | 22 | import { settings } from '../stores/settings'; |
|
307 | 309 | }, |
308 | 310 | }} |
309 | 311 | /> |
| 312 | + <ConfirmButton |
| 313 | + title="Sign Out" |
| 314 | + color={Color.Accent} |
| 315 | + confirmText="Yes, sign out" |
| 316 | + onConfirm={() => { |
| 317 | + new Auth().clearSession(); |
| 318 | + push('/signin'); |
| 319 | + Onyx.toaster.show({ |
| 320 | + title: 'Successfully signed out', |
| 321 | + icon: MdCheck, |
| 322 | + type: 'info', |
| 323 | + }); |
| 324 | + }} |
| 325 | + onCancel={() => {}} |
| 326 | + /> |
310 | 327 | </CardContent> |
311 | 328 | </Card> |
312 | 329 | {/if} |
|
0 commit comments