[#10233] Web-page splits in 2 frames when contains errors

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2020-06-16 10:34:41 +02:00
parent 886ccc765e
commit 29508c015a
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 17 additions and 8 deletions

View File

@ -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

View File

@ -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)]]))