[#3946] Improved webview error rendering

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Julien Eluard 2018-05-16 16:16:28 +02:00 committed by Andrey Shovkoplyas
parent 6dec4876a2
commit 11c59151f6
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
3 changed files with 16 additions and 7 deletions

View File

@ -398,7 +398,7 @@
:postponed "Postponed" :postponed "Postponed"
;;webview ;;webview
:web-view-error "oops, error" :web-view-error "Unable to load page"
;;testfairy warning ;;testfairy warning
:testfairy-title "Warning!" :testfairy-title "Warning!"

View File

@ -42,9 +42,13 @@
:justify-content :center}) :justify-content :center})
(def web-view-error (def web-view-error
{:justify-content :center {:flex 1
:align-items :center :justify-content :center
:flex-direction :row}) :align-items :center
:background-color colors/gray-lighter})
(def web-view-error-text
{:color colors/gray})
(defnstyle toolbar-content [show-actions] (defnstyle toolbar-content [show-actions]
{:flex-direction :row {:flex-direction :row

View File

@ -50,10 +50,15 @@
[react/view [react/view
[vector-icons/icon :icons/refresh]]]]])) [vector-icons/icon :icons/refresh]]]]]))
(defn web-view-error [] (defn- web-view-error [_ code desc]
(reagent/as-element (reagent/as-element
[react/view styles/web-view-error [react/view styles/web-view-error
[react/text (i18n/label :t/web-view-error)]])) [react/text {:style styles/web-view-error-text}
(i18n/label :t/web-view-error)]
[react/text {:style styles/web-view-error-text}
(str code)]
[react/text {:style styles/web-view-error-text}
(str desc)]]))
(defn web-view-loading [] (defn web-view-loading []
(reagent/as-element (reagent/as-element