|
22 | 22 | [:div.p-5
|
23 | 23 | [:div.flex.gap-3.items-start.pb-2
|
24 | 24 | [:div
|
25 |
| - [:div [:strong "Version: "] config/version] |
26 |
| - [:div [:strong "Browser: "] platform/user-agent]]] |
| 25 | + [:div [:strong "Version: "] config/version] |
| 26 | + [:div [:strong "Browser: "] platform/user-agent]]] |
27 | 27 | [:button.button.px-2.bg-primary.rounded.w-full
|
28 | 28 | {:auto-focus true
|
29 | 29 | :on-click #(rf/dispatch [::dialog.e/close])}
|
30 | 30 | "OK"]
|
31 | 31 | [close-button]])
|
32 | 32 |
|
33 |
| -#_(defn confirmation |
34 |
| - [{:keys [title description action]}] |
35 |
| - [:div.p-4 |
36 |
| - [:h1.text-3xl.mb-2.font-light title] |
37 |
| - [:div description] |
38 |
| - [:div.flex.justify-end |
39 |
| - [:button.button.px-2.bg-primary.rounded |
40 |
| - {:on-click #(rf/dispatch [::dialog.e/close])} |
41 |
| - "No"] |
42 |
| - [:button.button.px-2.bg-primary.rounded |
43 |
| - {:auto-focus true |
44 |
| - :on-click #(do (rf/dispatch [::dialog.e/close]) |
45 |
| - (rf/dispatch action))} |
46 |
| - "Yes"]] |
47 |
| - [close-button]]) |
| 33 | +(defn confirmation |
| 34 | + [{:keys [description action confirm-label cancel-label]}] |
| 35 | + [:div.p-5 |
| 36 | + [:p description] |
| 37 | + [:div.flex.gap-2.flex-wrap |
| 38 | + [:button.button.px-2.bg-primary.rounded.flex-1 |
| 39 | + {:on-click #(rf/dispatch [::dialog.e/close])} |
| 40 | + (or cancel-label "Cancel")] |
| 41 | + [:button.button.px-2.bg-primary.rounded.flex-1 |
| 42 | + {:auto-focus true |
| 43 | + :on-click #(do (rf/dispatch [::dialog.e/close]) |
| 44 | + (rf/dispatch action))} |
| 45 | + (or confirm-label "OK")]] |
| 46 | + [close-button]]) |
48 | 47 |
|
49 | 48 | (defn save
|
50 | 49 | [k]
|
|
53 | 52 | [:p
|
54 | 53 | "Your changes to " [:strong (:title document)]
|
55 | 54 | " will be lost if you close the document without saving."]
|
56 |
| - [:div.flex.gap-2 |
| 55 | + [:div.flex.gap-2.flex-wrap |
57 | 56 | [:button.button.px-2.bg-primary.rounded.flex-1
|
58 | 57 | {:on-click #(do (rf/dispatch [::dialog.e/close])
|
59 | 58 | (rf/dispatch [::document.e/close k false]))}
|
|
0 commit comments