|
32 | 32 |
|
33 | 33 | ($ modal
|
34 | 34 | {:show show
|
35 |
| - :title "Log in" |
36 | 35 | :on-close on-close}
|
37 | 36 |
|
38 |
| - ($ :form {:on-submit handle-submit} |
| 37 | + ($ :<> |
39 | 38 | (when error
|
40 |
| - ($ :div {:class "error-message"} |
41 |
| - error)) |
| 39 | + ($ :div {:class "alert alert-error mb-4"} |
| 40 | + ($ :span {:class "font-medium"} error))) |
42 | 41 |
|
43 |
| - (when-let [csrf-token (utils/get-csrf-token)] |
44 |
| - ($ :input |
45 |
| - {:type "hidden" |
46 |
| - :id "__anti-forgery-token" |
47 |
| - :name "__anti-forgery-token" |
48 |
| - :value csrf-token})) |
| 42 | + ($ :form {:on-submit handle-submit} |
49 | 43 |
|
50 |
| - ($ :div {:class "form-group"} |
51 |
| - ($ :label {:for "email"} "Email:") |
52 |
| - ($ :input |
53 |
| - {:type "email" |
54 |
| - :id "email" |
55 |
| - :value email |
56 |
| - :disabled loading |
57 |
| - :on-change #(set-email (.. % -target -value)) |
58 |
| - :required true})) |
| 44 | + (when-let [csrf-token (utils/get-csrf-token)] |
| 45 | + ($ :input |
| 46 | + {:type "hidden" |
| 47 | + :id "__anti-forgery-token" |
| 48 | + :name "__anti-forgery-token" |
| 49 | + :value csrf-token})) |
59 | 50 |
|
60 |
| - ($ :div {:class "form-group"} |
61 |
| - ($ :label {:for "password"} "Password:") |
62 |
| - ($ :input |
63 |
| - {:type "password" |
64 |
| - :id "password" |
65 |
| - :value password |
66 |
| - :disabled loading |
67 |
| - :on-change #(set-password (.. % -target -value)) |
68 |
| - :required true})) |
| 51 | + ($ :fieldset |
| 52 | + {:class "fieldset w-full bg-base-200 border border-base-300 p-4 rounded-box"} |
| 53 | + ($ :legend {:class "fieldset-legend"} "Login") |
69 | 54 |
|
70 |
| - ($ :div {:class "form-actions"} |
71 |
| - ($ :button |
72 |
| - {:type "button" |
73 |
| - :disabled loading |
74 |
| - :on-click on-close} |
75 |
| - "Cancel") |
76 |
| - ($ :button |
77 |
| - {:type "submit" |
78 |
| - :disabled loading |
79 |
| - :class "primary"} |
80 |
| - (if loading "Logging in..." "Log in"))))))) |
| 55 | + ($ :div {:class "form-control mb-3"} |
| 56 | + ($ :label {:class "fieldset-label" :for "email"} |
| 57 | + "Email") |
| 58 | + ($ :input |
| 59 | + {:type "email" |
| 60 | + :id "email" |
| 61 | + |
| 62 | + :class "input input-bordered w-full" |
| 63 | + :value email |
| 64 | + :disabled loading |
| 65 | + :on-change #(set-email (.. % -target -value)) |
| 66 | + :required true})) |
| 67 | + |
| 68 | + ($ :div {:class "form-control"} |
| 69 | + ($ :label {:class "fieldset-label" :for "password"} |
| 70 | + "Password") |
| 71 | + ($ :input |
| 72 | + {:type "password" |
| 73 | + :id "password" |
| 74 | + :class "input input-bordered w-full" |
| 75 | + :value password |
| 76 | + :disabled loading |
| 77 | + :on-change #(set-password (.. % -target -value)) |
| 78 | + :required true})) |
| 79 | + ($ :div {:class "modal-action mt-6 space-x-2 flex"} |
| 80 | + ($ :button |
| 81 | + {:type "button" |
| 82 | + :class "btn btn-outline flex-1" |
| 83 | + :disabled loading |
| 84 | + :on-click on-close} |
| 85 | + "Cancel") |
| 86 | + ($ :button |
| 87 | + {:type "submit" |
| 88 | + :disabled loading |
| 89 | + :class (str "btn btn-primary flex-1" (when loading "loading"))} |
| 90 | + (if loading "Logging in..." "Log in"))))))))) |
0 commit comments