Compare commits
1 Commits
2b50b3a65f
...
33557b36df
Author | SHA1 | Date |
---|---|---|
|
33557b36df |
|
@ -80,7 +80,8 @@
|
|||
(defn my-component [title]
|
||||
(let [local-state (reagent/atom true)]
|
||||
(fn []
|
||||
[:h1 {:class (when @local-state "hid") :on-click (fn [] (swap! local-state not))} title])))
|
||||
[:h1 {:class (when @local-state "hid")
|
||||
:on-click (fn [] (swap! local-state not))} title])))
|
||||
|
||||
|
||||
;; form one homepage component
|
||||
|
@ -114,9 +115,6 @@
|
|||
(fn [route]
|
||||
;[:div (-> route :parameters :path :page)]
|
||||
[:main.mt4
|
||||
[my-component "component 1"]
|
||||
[my-component "component 2"]
|
||||
[circle {:alt "test"}]
|
||||
|
||||
[:div.mw7.center.avenir @content]
|
||||
#_[article {:title "Homepage"
|
||||
|
@ -125,8 +123,18 @@
|
|||
|
||||
;; form one render about page component
|
||||
(defn about-page []
|
||||
[:div "about"
|
||||
[product-card {:title "title" :amount "10.59" :description "long description here" :href "test-link"}]])
|
||||
[:main.mt4
|
||||
[:section.mw7.center.avenir
|
||||
[:h1 "Clojure library examples to aid learning"]
|
||||
[:p "Selection of clojure demos, rendered in reagent which itself is an example of using reagent."]
|
||||
[my-component "component 1"]
|
||||
[my-component "component 2"]
|
||||
[circle {:alt "test"}]
|
||||
[product-card
|
||||
{:title "title"
|
||||
:amount "10.59"
|
||||
:description "long description here"
|
||||
:href "test-link"}]]])
|
||||
|
||||
;; form 3 component wrap rendering to catch errors and render them
|
||||
;; or just render the rest of the page if all is good
|
||||
|
|
Loading…
Reference in New Issue