|
1 | 1 | import { Button } from "@/components/ui/button"; |
2 | 2 | import { |
3 | | - Dialog, |
4 | | - DialogContent, |
5 | | - DialogHeader, |
6 | | - DialogTitle, |
7 | | -} from "@/components/ui/dialog"; |
| 3 | + Credenza, |
| 4 | + CredenzaContent, |
| 5 | + CredenzaHeader, |
| 6 | + CredenzaTitle, |
| 7 | +} from "@/components/ui/credenza"; |
8 | 8 | import { Input } from "@/components/ui/input"; |
9 | 9 | import { Label } from "@/components/ui/label"; |
10 | 10 | import { Switch } from "@/components/ui/switch"; |
@@ -80,7 +80,6 @@ export function EditVideoDialog() { |
80 | 80 | toast.error("An error occurred while editing the video.", { |
81 | 81 | description: "Please try again", |
82 | 82 | }); |
83 | | - // TODO: this might not be the best way to do this |
84 | 83 | router.navigate({ to: "/videos" }); |
85 | 84 | } |
86 | 85 | } |
@@ -115,20 +114,20 @@ export function EditVideoDialog() { |
115 | 114 | } |
116 | 115 |
|
117 | 116 | return ( |
118 | | - <Dialog |
| 117 | + <Credenza |
119 | 118 | onOpenChange={(o) => { |
120 | 119 | if (!o) { |
121 | 120 | closeEditVideoDialog(); |
122 | 121 | } |
123 | 122 | }} |
124 | 123 | open={isEditVideoDialogOpen} |
125 | 124 | > |
126 | | - <DialogContent> |
127 | | - <DialogHeader> |
128 | | - <DialogTitle>Edit {editVideoDialogData.videoTitle}</DialogTitle> |
129 | | - </DialogHeader> |
| 125 | + <CredenzaContent> |
| 126 | + <CredenzaHeader> |
| 127 | + <CredenzaTitle>Edit {editVideoDialogData.videoTitle}</CredenzaTitle> |
| 128 | + </CredenzaHeader> |
130 | 129 | <form |
131 | | - className="flex flex-col gap-2" |
| 130 | + className="flex flex-col gap-4" |
132 | 131 | onSubmit={(e) => { |
133 | 132 | e.preventDefault(); |
134 | 133 | form.handleSubmit(); |
@@ -182,18 +181,19 @@ export function EditVideoDialog() { |
182 | 181 | }} |
183 | 182 | /> |
184 | 183 | <div className="flex gap-2 mt-2"> |
185 | | - <Button className="grow basis-1/2" onClick={closeEditVideoDialog}> |
186 | | - Cancel |
187 | | - </Button> |
188 | 184 | <Button |
189 | | - className="grow basis-1/2 bg-red-600 text-white" |
190 | | - type="submit" |
| 185 | + variant="outline" |
| 186 | + className="grow basis-1/2" |
| 187 | + onClick={closeEditVideoDialog} |
191 | 188 | > |
| 189 | + Cancel |
| 190 | + </Button> |
| 191 | + <Button className="grow basis-1/2" type="submit"> |
192 | 192 | Save Changes |
193 | 193 | </Button> |
194 | 194 | </div> |
195 | 195 | </form> |
196 | | - </DialogContent> |
197 | | - </Dialog> |
| 196 | + </CredenzaContent> |
| 197 | + </Credenza> |
198 | 198 | ); |
199 | 199 | } |
0 commit comments