From e333c12d357ef97eaa17f26a2e6819a4796775ef Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 5 May 2017 13:25:12 +0300 Subject: [PATCH] add loading indicator to webview --- src/status_im/chat/views/input/web_view.cljs | 7 ++++--- src/status_im/components/react.cljs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/status_im/chat/views/input/web_view.cljs b/src/status_im/chat/views/input/web_view.cljs index c0666412bb..0709eafec2 100644 --- a/src/status_im/chat/views/input/web_view.cljs +++ b/src/status_im/chat/views/input/web_view.cljs @@ -3,8 +3,7 @@ (:require [reagent.core :as r] [re-frame.core :refer [dispatch]] [status-im.components.webview-bridge :refer [webview-bridge]] - [status-im.components.react :refer [view - text]] + [status-im.components.react :refer [view text] :as components] [status-im.components.status :as status] [status-im.i18n :refer [label]] [status-im.utils.js-resources :as js-res] @@ -47,4 +46,6 @@ :injected-java-script (str js-res/webview-js extra-js) :bounces false :on-navigation-state-change #(on-navigation-change % result-box) - :local-storage-enabled true}])) \ No newline at end of file + :local-storage-enabled true + :start-in-loading-state true + :render-loading #(r/as-element [components/activity-indicator {:animating true}])}])) diff --git a/src/status_im/components/react.cljs b/src/status_im/components/react.cljs index 58bc65e3c5..13dabbbfb8 100644 --- a/src/status_im/components/react.cljs +++ b/src/status_im/components/react.cljs @@ -38,6 +38,7 @@ (def touchable-without-feedback (get-class "TouchableWithoutFeedback")) (def touchable-highlight-class (get-class "TouchableHighlight")) (def touchable-opacity (get-class "TouchableOpacity")) +(def activity-indicator (get-class "ActivityIndicator")) (def modal (get-class "Modal")) (def picker (get-class "Picker"))