Bugfixes for the style of "New to Status" screen (#15353)

* Bugfixes for the style of "New to Status" screen

* Updates
This commit is contained in:
Alexander 2023-03-15 20:02:26 +01:00 committed by GitHub
parent f981021a1f
commit dabe8285be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 46 deletions

View File

@ -1,6 +1,9 @@
(ns quo2.components.onboarding.small-option-card.style (ns quo2.components.onboarding.small-option-card.style
(:require [quo2.foundations.colors :as colors])) (:require [quo2.foundations.colors :as colors]))
(def main-variant-height 335)
(def icon-variant-height 56)
(def text-container {:flex 1}) (def text-container {:flex 1})
(def title (def title
@ -42,9 +45,9 @@
(def touchable-overlay {:border-radius 16}) (def touchable-overlay {:border-radius 16})
(defn card (defn card
[main-variant?] [height]
{:background-color colors/white-opa-5 {:background-color colors/white-opa-5
:border-radius 16 :border-radius 16
:height (if main-variant? 335 56)}) :height height})
(def main-variant-extra-space {:height 8}) (def main-variant-extra-space {:height 8})

View File

@ -35,7 +35,7 @@
:subtitle subtitle}]]) :subtitle subtitle}]])
(defn- main-variant (defn- main-variant
[{:keys [title subtitle image]}] [{:keys [title subtitle image max-height]}]
[rn/view {:style style/main-variant} [rn/view {:style style/main-variant}
[rn/view {:style style/main-variant-text-container} [rn/view {:style style/main-variant-text-container}
[texts [texts
@ -43,16 +43,20 @@
:subtitle subtitle}]] :subtitle subtitle}]]
[fast-image/fast-image [fast-image/fast-image
{:accessibility-label :small-option-card-main-image {:accessibility-label :small-option-card-main-image
:style {:flex 1} :style {:flex 1 :max-height max-height}
:resize-mode :contain :resize-mode :contain
:source image}]]) :source image}]])
(defn small-option-card (defn small-option-card
"Variants: `:main` or `:icon`" "Variants: `:main` or `:icon`"
[{:keys [variant title subtitle image on-press] [{:keys [variant title subtitle image max-height on-press]
:or {variant :main}}] :or {variant :main}}]
(let [main-variant? (= variant :main) (let [main-variant? (= variant :main)
card-component (if main-variant? main-variant icon-variant)] card-component (if main-variant? main-variant icon-variant)
card-height (cond
(not main-variant?) style/icon-variant-height
max-height (min max-height style/main-variant-height)
:else style/main-variant-height)]
[rn/view [rn/view
[rn/touchable-highlight [rn/touchable-highlight
{:accessibility-label :small-option-card {:accessibility-label :small-option-card
@ -60,10 +64,11 @@
:active-opacity 1 :active-opacity 1
:underlay-color colors/white-opa-5 :underlay-color colors/white-opa-5
:on-press on-press} :on-press on-press}
[rn/view {:style (style/card main-variant?)} [rn/view {:style (style/card card-height)}
[card-component [card-component
{:title title {:title title
:subtitle subtitle :subtitle subtitle
:image image}]]] :image image
:max-height max-height}]]]
(when main-variant? (when main-variant?
[rn/view {:style style/main-variant-extra-space}])])) [rn/view {:style style/main-variant-extra-space}])]))

View File

@ -71,7 +71,7 @@
:bottom-card {:on-press (fn [] :bottom-card {:on-press (fn []
(rf/dispatch [:navigate-to :new-to-status]) (rf/dispatch [:navigate-to :new-to-status])
(rf/dispatch [:hide-terms-of-services-opt-in-screen])) (rf/dispatch [:hide-terms-of-services-opt-in-screen]))
:heading (i18n/label :t/im-new-to-status) :heading (i18n/label :t/new-to-status)
:accessibility-label :new-to-status-button}} :accessibility-label :new-to-status-button}}
(i18n/label :t/you-already-use-status) (i18n/label :t/you-already-use-status)
[quo/text [quo/text

View File

@ -32,6 +32,7 @@
(defn sign-in-options (defn sign-in-options
[] []
(let [window (rf/sub [:dimensions/window])]
[rn/view {:style style/options-container} [rn/view {:style style/options-container}
[quo/text [quo/text
{:style style/title {:style style/title
@ -44,6 +45,10 @@
:title (i18n/label :t/generate-keys) :title (i18n/label :t/generate-keys)
:subtitle (i18n/label :t/generate-keys-subtitle) :subtitle (i18n/label :t/generate-keys-subtitle)
:image (resources/get-image :generate-keys) :image (resources/get-image :generate-keys)
:max-height (- (:height window)
(* 2 56) ;; two other list items
(* 2 16) ;; spacing between items
220) ;; extra spacing (top bar)
:on-press #(rf/dispatch [:generate-and-derive-addresses])}] :on-press #(rf/dispatch [:generate-and-derive-addresses])}]
[rn/view {:style style/subtitle-container} [rn/view {:style style/subtitle-container}
@ -66,7 +71,7 @@
:title (i18n/label :t/use-keycard) :title (i18n/label :t/use-keycard)
:subtitle (i18n/label :t/use-keycard-subtitle) :subtitle (i18n/label :t/use-keycard-subtitle)
:image (resources/get-image :use-keycard) :image (resources/get-image :use-keycard)
:on-press #(rf/dispatch [::keycard/recover-with-keycard-pressed])}]]]) :on-press #(rf/dispatch [::keycard/recover-with-keycard-pressed])}]]]))
(defn new-to-status (defn new-to-status
[] []

View File

@ -53,7 +53,7 @@
[] []
(let [state (reagent/atom {:top-heading "Sign in " (let [state (reagent/atom {:top-heading "Sign in "
:top-sub-heading "You already use Status" :top-sub-heading "You already use Status"
:bottom-heading "I'm new to status"})] :bottom-heading "Im new to Status"})]
(fn [] (fn []
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!} [rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!}
[rn/view {:padding-bottom 400} [rn/view {:padding-bottom 400}

View File

@ -205,7 +205,6 @@
"invite": "Invite", "invite": "Invite",
"invite-contacts": "Invite people from contacts list", "invite-contacts": "Invite people from contacts list",
"create-channel": "Create a channel", "create-channel": "Create a channel",
"im-new-to-status": "I'm new to status",
"import-community": "Import a community", "import-community": "Import a community",
"import-community-title": "Import a community", "import-community-title": "Import a community",
"name-your-community": "Name your community", "name-your-community": "Name your community",
@ -941,7 +940,7 @@
"name": "Name", "name": "Name",
"name-of-token": "The name of your token", "name-of-token": "The name of your token",
"need-help": "Need help?", "need-help": "Need help?",
"new-to-status": "I'm new to Status", "new-to-status": "Im new to Status",
"generate-keys": "Generate keys", "generate-keys": "Generate keys",
"generate-keys-subtitle": "Your new self-sovereign identity in Status", "generate-keys-subtitle": "Your new self-sovereign identity in Status",
"experienced-web3": "Experienced in Web3?", "experienced-web3": "Experienced in Web3?",