[#5839] fix logo on welcome screen on desktop

Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2018-10-19 00:43:21 +03:00
parent 5986761210
commit 83a92aa4b0
No known key found for this signature in database
GPG Key ID: 43D1DAF5AD39C927
1 changed files with 22 additions and 19 deletions

View File

@ -180,26 +180,7 @@
(if platform/ios? :icons/dots-horizontal :icons/dots-vertical) (if platform/ios? :icons/dots-horizontal :icons/dots-vertical)
n)) n))
(defn desktop-icon (defn- match-color [color]
[name {:keys [color container-style style accessibility-label width height]
:or {accessibility-label :icon}}]
(let [default-viewbox {:width 24 :height 24}
icon-style (if width
(assoc default-viewbox :width width :height height)
default-viewbox)]
[react/view {:style container-style
:accessibility-label accessibility-label}
[react/image {:source (get icons (normalize-property-name name))
:style (merge icon-style style)}]]))
(defn mobile-icon
[name {:keys [color container-style accessibility-label width height]
:or {accessibility-label :icon}}]
^{:key name}
[react/animated-view {:style container-style
:accessibility-label accessibility-label}
(if-let [icon-fn (get icons (normalize-property-name name))]
(let [icon-vec (icon-fn
(cond (cond
(keyword? color) (keyword? color)
(case color (case color
@ -213,7 +194,29 @@
(string? color) (string? color)
color color
:else :else
colors/black))] colors/black))
(defn desktop-icon
[name {:keys [color container-style style accessibility-label width height]
:or {accessibility-label :icon}}]
(let [default-viewbox {:width 24 :height 24}
icon-style (if width
(assoc default-viewbox :width width :height height)
default-viewbox)
color-style {:tint-color (match-color color)}]
[react/view {:style container-style
:accessibility-label accessibility-label}
[react/image {:source (get icons (normalize-property-name name))
:style (merge icon-style color-style style)}]]))
(defn mobile-icon
[name {:keys [color container-style accessibility-label width height]
:or {accessibility-label :icon}}]
^{:key name}
[react/animated-view {:style container-style
:accessibility-label accessibility-label}
(if-let [icon-fn (get icons (normalize-property-name name))]
(let [icon-vec (icon-fn (match-color color))]
(if width (if width
(update icon-vec 1 assoc :width width :height height) (update icon-vec 1 assoc :width width :height height)
icon-vec)) icon-vec))