|
1 | 1 | import { QwikIntrinsicElements, component$, useSignal } from '@builder.io/qwik';
|
2 | 2 | import {
|
3 | 3 | Modal,
|
4 |
| - ModalPopup, |
5 | 4 | ModalContent,
|
6 | 5 | ModalFooter,
|
7 | 6 | ModalHeader,
|
8 |
| - ModalTrigger, |
9 |
| - ModalClose, |
| 7 | + ModalPopup, |
10 | 8 | } from '@qwik-ui/headless';
|
11 | 9 |
|
12 | 10 | export default component$(() => {
|
13 |
| - const showSignal = useSignal(false); |
| 11 | + const showSig = useSignal(false); |
14 | 12 |
|
15 | 13 | return (
|
16 |
| - <Modal bind:show={showSignal}> |
17 |
| - <ModalTrigger class="rounded-md border-2 border-slate-300 bg-slate-700 px-3 py-2 text-white"> |
| 14 | + <> |
| 15 | + <button |
| 16 | + onClick$={() => (showSig.value = true)} |
| 17 | + class="rounded-md border-2 border-slate-300 bg-slate-700 px-3 py-2 text-white" |
| 18 | + > |
18 | 19 | Open Modal
|
19 |
| - </ModalTrigger> |
20 |
| - <ModalPopup class="shadow-dark-medium max-w-[25rem] rounded-md bg-white p-[28px] text-slate-950"> |
21 |
| - <ModalHeader class="relative"> |
22 |
| - <h2 class="mb-2 text-lg font-bold">Edit Profile</h2> |
23 |
| - <p class="leading-5"> |
24 |
| - You can update your profile here. Hit the save button when finished. |
25 |
| - </p> |
26 |
| - </ModalHeader> |
27 |
| - <ModalContent class="mb-2 py-4"> |
28 |
| - <fieldset class="mb-1 flex items-baseline justify-between"> |
29 |
| - <label for="name">Name</label> |
30 |
| - <input |
31 |
| - class="mt-2 rounded-sm px-4 py-[10px] text-white" |
32 |
| - id="name" |
33 |
| - type="text" |
34 |
| - placeholder="John Doe" |
35 |
| - /> |
36 |
| - </fieldset> |
37 |
| - <fieldset class="flex items-baseline justify-between"> |
38 |
| - <label for="email">Email</label> |
39 |
| - <input |
40 |
| - class="mt-2 rounded-sm px-4 py-3 text-white" |
41 |
| - id="email" |
42 |
| - type="text" |
43 |
| - |
44 |
| - /> |
45 |
| - </fieldset> |
46 |
| - </ModalContent> |
47 |
| - <ModalFooter class="flex justify-end gap-4"> |
48 |
| - <button |
49 |
| - class="rounded-sm border border-none bg-slate-200 px-4 py-[10px] text-slate-600 outline-none focus-visible:outline-slate-700" |
50 |
| - onClick$={() => (showSignal.value = false)} |
51 |
| - > |
52 |
| - Cancel |
53 |
| - </button> |
54 |
| - <button |
55 |
| - class="rounded-sm border border-none bg-green-200 px-4 py-[10px] text-green-900 outline-none focus-visible:outline-green-700" |
56 |
| - onClick$={() => (showSignal.value = false)} |
57 |
| - > |
58 |
| - Save Changes |
| 20 | + </button> |
| 21 | + <Modal bind:show={showSig}> |
| 22 | + <ModalPopup class="shadow-dark-medium max-w-[25rem] rounded-md bg-white p-[28px] text-slate-950"> |
| 23 | + <ModalHeader class="relative"> |
| 24 | + <h2 class="mb-2 text-lg font-bold">Edit Profile</h2> |
| 25 | + <p class="leading-5"> |
| 26 | + You can update your profile here. Hit the save button when finished. |
| 27 | + </p> |
| 28 | + </ModalHeader> |
| 29 | + <ModalContent class="mb-2 py-4"> |
| 30 | + <fieldset class="mb-1 flex items-baseline justify-between"> |
| 31 | + <label for="name">Name</label> |
| 32 | + <input |
| 33 | + class="mt-2 rounded-sm px-4 py-[10px] text-white" |
| 34 | + id="name" |
| 35 | + type="text" |
| 36 | + placeholder="John Doe" |
| 37 | + /> |
| 38 | + </fieldset> |
| 39 | + <fieldset class="flex items-baseline justify-between"> |
| 40 | + <label for="email">Email</label> |
| 41 | + <input |
| 42 | + class="mt-2 rounded-sm px-4 py-3 text-white" |
| 43 | + id="email" |
| 44 | + type="text" |
| 45 | + |
| 46 | + /> |
| 47 | + </fieldset> |
| 48 | + </ModalContent> |
| 49 | + <ModalFooter class="flex justify-end gap-4"> |
| 50 | + <button |
| 51 | + class="rounded-sm border border-none bg-slate-200 px-4 py-[10px] text-slate-600 outline-none focus-visible:outline-slate-700" |
| 52 | + onClick$={() => (showSig.value = false)} |
| 53 | + > |
| 54 | + Cancel |
| 55 | + </button> |
| 56 | + <button |
| 57 | + class="rounded-sm border border-none bg-green-200 px-4 py-[10px] text-green-900 outline-none focus-visible:outline-green-700" |
| 58 | + onClick$={() => (showSig.value = false)} |
| 59 | + > |
| 60 | + Save Changes |
| 61 | + </button> |
| 62 | + </ModalFooter> |
| 63 | + <button onClick$={() => (showSig.value = false)} class="absolute right-6 top-6"> |
| 64 | + <CloseIcon class="h-8 w-8" /> |
59 | 65 | </button>
|
60 |
| - </ModalFooter> |
61 |
| - <ModalClose class="absolute right-6 top-6"> |
62 |
| - <CloseIcon class="h-8 w-8" /> |
63 |
| - </ModalClose> |
64 |
| - </ModalPopup> |
65 |
| - </Modal> |
| 66 | + </ModalPopup> |
| 67 | + </Modal> |
| 68 | + </> |
66 | 69 | );
|
67 | 70 | });
|
68 | 71 |
|
|
0 commit comments