Compare commits

..

1 Commits

Author SHA1 Message Date
Oliver Marks 33557b36df Refactor
continuous-integration/drone/push Build is passing Details
2021-01-29 14:02:49 +00:00
1 changed files with 14 additions and 6 deletions

View File

@ -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