Modify news text

This commit is contained in:
Dan Holmsand 2015-09-09 17:00:49 +02:00
parent c289055133
commit 26dead76b4
1 changed files with 14 additions and 10 deletions

View File

@ -14,20 +14,23 @@
(defn old-and-tired [] (defn old-and-tired []
[:ul [:ul
[:li.foo [:a.bar "Link 1"]] [:li.foo [:a.bar "Text 1"]]
[:li.foo [:a.bar "Link 2"]]]) [:li.foo [:a.bar "Text 2"]]])
(defn new-hotness [] (defn new-hotness []
[:ul [:ul
[:li.foo>a.bar "Link 1"] [:li.foo>a.bar "Text 1"]
[:li.foo>a.bar "Link 2"]]) [:li.foo>a.bar "Text 2"]])
(def upper-value (r/atom "FOOBAR"))
(defn upper-input [] (defn upper-input []
(let [v (r/atom "FOOBAR")] [:div
(fn [] [:p "Value is: " @upper-value]
[:input {:type 'text :value @v [:input {:type 'text :value @upper-value
:on-change #(reset! v (-> % .-target .-value :on-change #(reset! upper-value
clojure.string/upper-case))}]))) (-> % .-target .-value
clojure.string/upper-case))}]])
(defn main [{:keys [summary]}] (defn main [{:keys [summary]}]
@ -71,7 +74,8 @@
whenever you made a change to something like this:"] whenever you made a change to something like this:"]
[demo-component {:comp upper-input [demo-component {:comp upper-input
:src (s/src-of [:upper-input])}] :src [:pre ns-src
(s/src-of [:upper-value :upper-input])]}]
[:h2 "Other news"] [:h2 "Other news"]