File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
(ns renderer.snap.db )
2
2
3
+ (def options
4
+ [:enum :centers :midpoints :corners :nodes ])
5
+
3
6
(def snap
4
7
[:map
5
8
[:enabled? boolean?]
6
9
[:threshold double?]
7
- [:options [ :set keyword?] ]])
10
+ [:options options ]])
Original file line number Diff line number Diff line change 2
2
(:require
3
3
[" @radix-ui/react-dropdown-menu" :as DropdownMenu]
4
4
[re-frame.core :as rf]
5
- [renderer.components :as comp]))
5
+ [renderer.components :as comp]
6
+ [renderer.snap.db :as snap.db]))
6
7
7
8
(defn options-dropdown
8
9
[]
24
25
:alignOffset -5
25
26
:position " popper"
26
27
:class " menu-content rounded select-content" }
27
- (for [option #{ :centers :midpoints :corners :nodes } ]
28
+ (for [option ( rest snap.db/options) ]
28
29
^{:key option}
29
30
[:> DropdownMenu/CheckboxItem
30
31
{:class " menu-checkbox-item inset"
31
32
:on-click #(.stopPropagation %)
32
33
:onSelect #(do (.preventDefault %)
33
- (rf/dispatch [:element/import-traced-image option]))
34
+ (rf/dispatch [:snap/toggle-option option]))
34
35
:checked (contains? options option)}
35
36
[:> DropdownMenu/ItemIndicator
36
37
{:class " menu-item-indicator" }
You can’t perform that action at this time.
0 commit comments