|
2 | 2 | import { goto, invalidate } from '$app/navigation';
|
3 | 3 | import { base } from '$app/paths';
|
4 | 4 | import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
5 |
| - import { BoxAvatar, Confirm, CardGrid } from '$lib/components'; |
| 5 | + import { BoxAvatar, CardGrid, Modal } from '$lib/components'; |
6 | 6 | import { Button, InputText } from '$lib/elements/forms';
|
7 | 7 | import { toLocaleDateTime } from '$lib/helpers/date';
|
8 | 8 | import { addNotification } from '$lib/stores/notifications';
|
|
11 | 11 | import { project, projectRegion } from '../store';
|
12 | 12 | import { organization } from '$lib/stores/organization';
|
13 | 13 | import { Dependencies } from '$lib/constants';
|
14 |
| -
|
15 | 14 | let error: string;
|
16 | 15 | let showDelete = false;
|
17 | 16 | let name: string = null;
|
|
62 | 61 | </svelte:fragment>
|
63 | 62 | </CardGrid>
|
64 | 63 |
|
65 |
| -<Confirm |
66 |
| - disabled={name !== $project.name} |
67 |
| - onSubmit={handleDelete} |
68 |
| - title="Delete project" |
69 |
| - bind:open={showDelete} |
70 |
| - bind:error> |
71 |
| - <p> |
72 |
| - <b>This project will be deleted</b>, along with all of its metadata, stats, and other |
73 |
| - resources. <b>This action is irreversible</b>. |
74 |
| - </p> |
| 64 | +<Modal size="s" bind:show={showDelete} title="Delete project" onSubmit={handleDelete} bind:error> |
| 65 | + <svelte:fragment slot="description"> |
| 66 | + This project will be deleted along with all of its metadata, stats, and other resources. |
| 67 | + <b>This action is irreversible.</b> |
| 68 | + </svelte:fragment> |
| 69 | + |
75 | 70 | <InputText
|
76 | 71 | label={`Enter "${$project.name}" to continue`}
|
77 | 72 | placeholder="Enter name"
|
78 | 73 | id="project-name"
|
79 | 74 | autofocus
|
80 | 75 | required
|
81 | 76 | bind:value={name} />
|
82 |
| -</Confirm> |
| 77 | + |
| 78 | + <svelte:fragment slot="footer"> |
| 79 | + <Button text on:click={() => (showDelete = false)}>Cancel</Button> |
| 80 | + <Button submissionLoader submit disabled={name !== $project.name}>Delete</Button> |
| 81 | + </svelte:fragment> |
| 82 | +</Modal> |
0 commit comments