|
1 | 1 | <script lang="ts"> |
2 | | - import Button from 'onyx-ui/components/buttons/Button.svelte'; |
| 2 | + import ConfirmButton from 'onyx-ui/components/buttons/ConfirmButton.svelte'; |
3 | 3 | import Card from 'onyx-ui/components/card/Card.svelte'; |
4 | 4 | import CardContent from 'onyx-ui/components/card/CardContent.svelte'; |
5 | 5 | import Divider from 'onyx-ui/components/divider/Divider.svelte'; |
6 | 6 | import FormRow from 'onyx-ui/components/form/FormRow.svelte'; |
7 | 7 | import Typography from 'onyx-ui/components/Typography.svelte'; |
8 | 8 | import View from 'onyx-ui/components/view/View.svelte'; |
9 | 9 | 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'; |
11 | 12 | import { registerView, updateView } from 'onyx-ui/stores/view'; |
12 | 13 | import { onMount } from 'svelte'; |
13 | 14 | import { push } from 'svelte-spa-router'; |
|
88 | 89 | <FormRow label="Plan" navi={{ itemId: `plan`, onSelect: () => {} }}>{data.plan}</FormRow> |
89 | 90 | <Divider title="description" /> |
90 | 91 | <Typography>{data.description || 'No description provided.'}</Typography> |
91 | | - <Button |
| 92 | + <ConfirmButton |
92 | 93 | 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 | + }); |
99 | 103 | }} |
| 104 | + onCancel={() => {}} |
100 | 105 | /> |
101 | 106 | {:catch} |
102 | 107 | <Typography align="center">Failed to load data</Typography> |
|
0 commit comments