Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (36 sloc) 1.42 KB
(ns workshop.material
(:require [devcards.core :as dc :include-macros true]
[hx.react :as hx :refer [defnc]]
["@material-ui/core/Button" :default Button]
["@material-ui/core/CircularProgress" :default CircularProgress]))
(dc/defcard adding-styles*
;; add the Robot font globally on the page
(hx/f [:link {:rel "stylesheet"
:href "https://fonts.googleapis.com/css?family=Roboto:300,400,500"}]))
(defnc ButtonExample [_]
[:<>
(for [variant [nil "outlined" "contained" "fab" "extendedFab"]]
[:div (or variant "default")
(for [color [nil "primary" "secondary"]]
[Button {:variant variant :color color
:style {:margin "5px"}}
(or color "default")])])])
(dc/defcard button
;; hx/f is used here to instantiate the `ButtonExample` component as a React element
;; to work with devcards
(hx/f [ButtonExample]))
(defnc CircularProgressExample [_]
[:<>
[:div "Indeterminate "
[:div {:style {:padding "5px"}}
[CircularProgress {:color "primary"}]]]
[:div "Determinate"
[:div {:style {:padding "5px"}}
[CircularProgress {:color "primary" :value 33
:variant "determinate"}]]]
[:div "Static"
[:div {:style {:padding "5px"}}
[CircularProgress {:color "primary" :value 33
:variant "static"}]]]])
(dc/defcard circular-progress
(hx/f [CircularProgressExample]))
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.