Skip to content

Commit

Permalink
add alert, it is now supported in both iOS and Android
Browse files Browse the repository at this point in the history
  • Loading branch information
drapanjanas committed Dec 21, 2015
1 parent 2af7df1 commit a125852
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions resources/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@

(def logo-img (require-img "./images/cljs.png"))

(defn alert [title]
(.alert (.-Alert js/React) title))

(defn widget []
(let [greeting (subscribe [:get-greeting])]
(fn []
[view {:style {:flexDirection "column" :margin 40 :alignItems "center"}}
[text {:style {:fontSize 30 :fontWeight "100" :marginBottom 20 :textAlign "center"}} @greeting]
[view {:style {:flex-direction "column" :margin 40 :align-items "center"}}
[text {:style {:font-size 30 :font-weight "100" :margin-bottom 20 :text-align "center"}} @greeting]
[image {:source logo-img
:style {:width 80 :height 80 :marginBottom 30}}]
[touchable-highlight {:style {:backgroundColor "#999" :padding 10 :borderRadius 5}}
[text {:style {:color "white" :textAlign "center" :fontWeight "bold"}} "press me"]]])))
:style {:width 80 :height 80 :margin-bottom 30}}]
[touchable-highlight {:style {:background-color "#999" :padding 10 :border-radius 5}
:on-press #(alert "HELLO!")}
[text {:style {:color "white" :text-align "center" :font-weight "bold"}} "press me"]]])))

(defn mount-root []
(r/render [widget] 1))
Expand Down

0 comments on commit a125852

Please sign in to comment.