[#7764] Image on Welcome to Status screen is not center aligned on small device screens
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
cf21763a97
commit
d698ffe09e
|
@ -102,6 +102,9 @@
|
||||||
(assoc :accessibility-label accessibility-label))
|
(assoc :accessibility-label accessibility-label))
|
||||||
(if more-than-9 (i18n/label :t/counter-9-plus) value)]])))
|
(if more-than-9 (i18n/label :t/counter-9-plus) value)]])))
|
||||||
|
|
||||||
|
(def small-screen-image-k 0.8)
|
||||||
|
(def small-screen-height 600)
|
||||||
|
|
||||||
(defview image-contain [{:keys [container-style style]} {:keys [image width height]}]
|
(defview image-contain [{:keys [container-style style]} {:keys [image width height]}]
|
||||||
(letsubs [content-width (reagent/atom 0)
|
(letsubs [content-width (reagent/atom 0)
|
||||||
{window-width :width window-height :height} [:dimensions/window]]
|
{window-width :width window-height :height} [:dimensions/window]]
|
||||||
|
@ -112,13 +115,13 @@
|
||||||
:style (merge style
|
:style (merge style
|
||||||
(if (> window-height window-width)
|
(if (> window-height window-width)
|
||||||
{:width (* @content-width
|
{:width (* @content-width
|
||||||
(if (< window-height 600)
|
(if (< window-height small-screen-height)
|
||||||
0.6
|
small-screen-image-k
|
||||||
1))
|
1))
|
||||||
:height (/ (* @content-width height
|
:height (/ (* @content-width height
|
||||||
(if (< window-height 600)
|
(if (< window-height small-screen-height)
|
||||||
0.6
|
small-screen-image-k
|
||||||
1))
|
1))
|
||||||
width)}
|
width)}
|
||||||
{:width @content-width
|
{:width @content-width
|
||||||
:height (* window-height 0.6)}))}]]))
|
:height (* window-height small-screen-image-k)}))}]]))
|
||||||
|
|
|
@ -140,4 +140,6 @@
|
||||||
:text-align :center})
|
:text-align :center})
|
||||||
|
|
||||||
(def image-contain
|
(def image-contain
|
||||||
{:align-self :stretch})
|
{:align-self :stretch
|
||||||
|
:align-items :center
|
||||||
|
:justify-content :center})
|
||||||
|
|
Loading…
Reference in New Issue