Skip to content

Commit 42de6e8

Browse files
author
awb99
committed
dialog custom size
1 parent a85d5a3 commit 42de6e8

23 files changed

+18
-16
lines changed

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ jobs:
3131
run: |
3232
git config --global user.email "[email protected]"
3333
git config --global user.name "CI/CD"
34-
cd ui-keybindings
3534
clojure -T:build jar
3635
clojure -T:build deploy

ui-keybindings/build.clj build.clj

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(ns build
22
(:require
3-
[babashka.fs :as fs]
43
[clojure.tools.build.api :as b]
54
[deps-deploy.deps-deploy :as dd]))
65

ui-keybindings/deps.edn deps.edn

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
:sha "cc75980b43011773162b485f46f939dc5fba91e4"}}
99
:main-opts ["-m" "cognitect.test-runner"]
1010
:exec-fn cognitect.test-runner.api/test}
11-
12-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
13-
slipset/deps-deploy {:mvn/version "0.2.1"}
14-
babashka/fs {:mvn/version "0.0.5"}}
11+
12+
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
13+
slipset/deps-deploy {:mvn/version "0.2.1"}}
1514
:ns-default build}
1615

1716
;
File renamed without changes.
File renamed without changes.

ui-keybindings/src/frontend/dialog.cljs src/frontend/dialog.cljs

+15-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{:show? true
1717
:child child
1818
:close (or close nil) ; optionally dispatch on close reframe event
19-
:size (or size :default)})))
19+
:size (or size nil)})))
2020

2121
(reg-event-db
2222
:modal/close
@@ -27,7 +27,7 @@
2727
(dispatch close))
2828
(assoc-in db [:modal] {:show? false
2929
:child nil
30-
:size :default
30+
:size nil
3131
:close nil}))
3232
db))))
3333

@@ -39,13 +39,18 @@
3939
(dispatch [:modal/close])
4040
(.preventDefault event)
4141
(.stopPropagation event))}]
42-
[:div {:class "modal-child"
43-
:style {:width (case size
44-
:extra-small "15%"
45-
:small "30%"
46-
:large "70%"
47-
:extra-large "85%"
48-
"50%")}} child]])
42+
(if size
43+
;wrap % size
44+
[:div {:class "modal-child"
45+
:style {:width (case size
46+
:extra-small "15%"
47+
:small "30%"
48+
:large "70%"
49+
:extra-large "85%"
50+
"50%")}} child]
51+
; just wrap the class we use.
52+
[:div {:class "modal-child"}
53+
child])])
4954

5055
(reg-sub-raw
5156
:modal
@@ -60,7 +65,7 @@
6065

6166
(defn dialog-show
6267
([ui]
63-
(dispatch [:modal/open ui :small]))
68+
(dispatch [:modal/open ui]))
6469
([ui size]
6570
(dispatch [:modal/open ui size]))
6671
([ui size close]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)