Components

Former-commit-id: 0da2757450
This commit is contained in:
virvar 2016-03-18 16:29:33 +03:00
parent 3eb242c539
commit 6f2863eae0
5 changed files with 19 additions and 21 deletions

View File

@ -8,9 +8,8 @@
(:require [om.next :as om :refer-macros [defui]]
[re-natal.support :as sup]
[messenger.state :as state]
[messenger.utils.resources :as res]))
(set! js/InvertibleScrollView (js/require "react-native-invertible-scroll-view"))
[messenger.utils.resources :as res]
[messenger.components.invertible-scroll-view :refer [invertible-scroll-view]]))
(defn nav-pop [nav]
(binding [state/*nav-render* false]
@ -200,9 +199,7 @@
(list-view {:dataSource messages-ds
:renderScrollComponent
(fn [props]
(js/React.createElement js/InvertibleScrollView
(clj->js (merge (js->clj props)
{:inverted true}))))
(invertible-scroll-view nil))
:renderRow render-row
:style {:backgroundColor "white"}})
(new-message)))))

View File

@ -9,7 +9,7 @@
[messenger.comm.intercom :as intercom :refer [set-user-phone-number]]
[messenger.utils.utils :refer [log toast http-post]]
[messenger.utils.resources :as res]
[messenger.utils.ui-utils :as ui]
[messenger.components.spinner :refer [spinner]]
[messenger.android.sign-up-confirm :refer [sign-up-confirm]]
[messenger.constants :refer [ethereum-rpc-url]]))
@ -78,6 +78,6 @@
:textAlign "center"}}
"Sign up"))))
(when loading
(ui/spinner {:visible true}))))))
(spinner {:visible true}))))))
(def login (om/factory Login))

View File

@ -0,0 +1,7 @@
(ns messenger.components.invertible-scroll-view)
(set! js/InvertibleScrollView (js/require "react-native-invertible-scroll-view"))
(defn invertible-scroll-view [props]
(js/React.createElement js/InvertibleScrollView
(clj->js (merge {:inverted true} props))))

View File

@ -0,0 +1,7 @@
(ns messenger.components.spinner)
(set! js/Spinner (.-default (js/require "react-native-loading-spinner-overlay")))
(defn spinner [props]
(js/React.createElement js/Spinner
(clj->js props)))

View File

@ -1,13 +0,0 @@
(ns messenger.utils.ui-utils
;; (:require-macros
;; [natal-shell.components :refer [view text image touchable-highlight list-view
;; toolbar-android text-input]]
;; [natal-shell.core :refer [with-error-view]])
;; (:require [om.next :as om :refer-macros [defui]])
)
(set! js/Spinner (.-default (js/require "react-native-loading-spinner-overlay")))
(defn spinner [props]
(js/React.createElement js/Spinner
(clj->js props)))