From 29508c015a48408cfe26500e4426e6b40c3a9e77 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Tue, 16 Jun 2020 10:34:41 +0200 Subject: [PATCH] [#10233] Web-page splits in 2 frames when contains errors Signed-off-by: Andrey Shovkoplyas --- src/status_im/ui/screens/browser/styles.cljs | 15 +++++++++++---- src/status_im/ui/screens/browser/views.cljs | 10 ++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/status_im/ui/screens/browser/styles.cljs b/src/status_im/ui/screens/browser/styles.cljs index 3215d6b0d2..8a7bbbc428 100644 --- a/src/status_im/ui/screens/browser/styles.cljs +++ b/src/status_im/ui/screens/browser/styles.cljs @@ -17,13 +17,20 @@ {:opacity 0.4}) (def web-view-error - {:flex 1 - :justify-content :center + {:justify-content :center :align-items :center - :background-color colors/gray-lighter}) + :position :absolute + :padding 20 + :top 0 + :left 0 + :bottom 0 + :right 0 + :background-color colors/white}) (def web-view-error-text - {:color colors/gray}) + {:color colors/gray + :line-height 22 + :text-align :center}) (defn toolbar-content [] {:flex-direction :row diff --git a/src/status_im/ui/screens/browser/views.cljs b/src/status_im/ui/screens/browser/views.cljs index 199167e3fe..a6f93c607e 100644 --- a/src/status_im/ui/screens/browser/views.cljs +++ b/src/status_im/ui/screens/browser/views.cljs @@ -20,7 +20,8 @@ [status-im.ui.screens.browser.styles :as styles] [status-im.utils.debounce :as debounce] [status-im.utils.http :as http] - [status-im.utils.js-resources :as js-res]) + [status-im.utils.js-resources :as js-res] + [status-im.utils.contenthash :as contenthash]) (:require-macros [status-im.utils.views :as views])) (defn toolbar-content [url url-original {:keys [secure?]} url-editing?] @@ -59,12 +60,13 @@ (re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))] [toolbar-content url url-original browser url-editing?]]) -(defn- web-view-error [_ code desc] +(defn- web-view-error [_ _ desc] (reagent/as-element [react/view styles/web-view-error + [react/image {:style {:width 140 :height 140 :margin-bottom 16} + :source {:uri (contenthash/url + "e3010170122001bbe2f5bfba0305a3bdc2047fddc47ee595a591bdee61de6040ffc2456624e1")}}] [react/i18n-text {:style styles/web-view-error-text :key :web-view-error}] - [react/text {:style styles/web-view-error-text} - (str code)] [react/text {:style styles/web-view-error-text} (str desc)]]))