-
-
Save marcandrefontaine/c32b566b2e981d867967 to your computer and use it in GitHub Desktop.
bootstrap class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns contact-forms.macros | |
(:require [reagent.core :as reagent]) | |
) | |
(defmacro bootstrap-class [classname] | |
`(def ~(symbol classname) (reagent/adapt-react-class (aget js/ReactBootstrap ~classname))) | |
) | |
(defmacro bootstrap-classes [bindings] | |
(cons 'do (for [x bindings] `(def ~(symbol x) (reagent/adapt-react-class (aget js/ReactBootstrap ~x))))) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns contact-forms.views | |
(:require [re-frame.core :as re-frame] | |
[reagent.core :as reagent] | |
[cljsjs.react-bootstrap] | |
[contact-forms.macros :as mac :include-macros true] | |
) | |
) | |
;; THIS WORKS | |
(mac/bootstrap-class "Input") | |
(mac/bootstrap-class "ButtonInput") | |
(mac/bootstrap-class "DropdownButton") | |
(mac/bootstrap-class "MenuItem") | |
(mac/bootstrap-class "Panel") | |
;; THIS DOESN'T WORK | |
(doseq [classname ["Input" "ButtonInput" "DropdownButton" "MenuItem" "Panel"]] | |
(mac/bootstrap-class classname) | |
) | |
;; THIS WORKS | |
(mac/bootstrap-classes ["Input" "ButtonInput" "Button" "DropdownButton" "MenuItem" "Panel"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment