Compare commits

..

1 Commits

Author SHA1 Message Date
Oliver Marks 2b50b3a65f Refactor
continuous-integration/drone/push Build is passing Details
2021-01-29 12:44:59 +00:00
1 changed files with 6 additions and 14 deletions

View File

@ -80,8 +80,7 @@
(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
@ -115,6 +114,9 @@
(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"
@ -123,18 +125,8 @@
;; form one render about page component
(defn about-page []
[: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"}]]])
[:div "about"
[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