(ns syng-im.components.chat (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [syng-im.components.react :refer [view text image touchable-highlight navigator]] [syng-im.utils.logging :as log])) (def logo-img (js/require "./images/cljs.png")) (defn alert [title] (.alert (.-Alert js/React) title)) (defn chat [{:keys [navigator]}] (let [greeting (subscribe [:get-greeting])] (fn [] [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 :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"]]])))