Skip to content

Commit

Permalink
Move schema before function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed Nov 13, 2023
1 parent ffad93a commit 292a6ad
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/quo/components/counter/step/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
[schema.core :as schema]
[utils.number]))

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:accessibility-label {:optional true} [:maybe :keyword]]
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
[:in-blur-view? {:optional true} [:maybe :boolean]]
[:theme :schema.common/theme]
[:type {:optional true} [:enum :active :complete :neutral]]]]
[:value [:maybe [:or :string :int]]]]
:any])

(defn- view-internal
[{:keys [type accessibility-label theme in-blur-view? customization-color]} value]
(let [type (or type :neutral)
Expand All @@ -27,19 +40,6 @@
:style {:color (style/text-color type theme)}}
label]]))

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:accessibility-label {:optional true} [:maybe :keyword]]
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
[:in-blur-view? {:optional true} [:maybe :boolean]]
[:theme :schema.common/theme]
[:type {:optional true} [:enum :active :complete :neutral]]]]
[:value [:maybe [:or :string :int]]]]
:any])

(def view
(quo.theme/with-theme
(schema/instrument #'view-internal ?schema)))

0 comments on commit 292a6ad

Please sign in to comment.