[ISSUE #3492] Fixed action text style
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
ed7176d65c
commit
05fffe1652
|
@ -1,8 +1,8 @@
|
|||
(ns status-im.ui.components.toolbar.styles
|
||||
(:require-macros [status-im.utils.styles :refer [defstyle defnstyle]])
|
||||
(:require [status-im.ui.components.styles :as styles]))
|
||||
(:require [status-im.ui.components.colors :as colors]))
|
||||
|
||||
(def toolbar-background1 styles/color-white)
|
||||
(def toolbar-background colors/white)
|
||||
|
||||
(def toolbar-height 56)
|
||||
(def toolbar-icon-width 24)
|
||||
|
@ -14,7 +14,7 @@
|
|||
:flex-direction :row
|
||||
:align-items :center
|
||||
:justify-content :space-between
|
||||
:background-color (or background-color toolbar-background1)
|
||||
:background-color (or background-color toolbar-background)
|
||||
:elevation (if flat? 0 2)
|
||||
:android {:height 55}
|
||||
:ios {:height 56}})
|
||||
|
@ -33,7 +33,7 @@
|
|||
:margin-left 6})
|
||||
|
||||
(defstyle toolbar-title-text
|
||||
{:color styles/text1-color
|
||||
{:color colors/black
|
||||
:letter-spacing -0.2
|
||||
:font-size 17
|
||||
:text-align :center})
|
||||
|
@ -49,8 +49,7 @@
|
|||
{:width (+ toolbar-icon-width toolbar-icon-spacing)})))
|
||||
|
||||
(def toolbar-action
|
||||
{:width toolbar-icon-width
|
||||
:height toolbar-icon-height
|
||||
{:flex 1
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
|
@ -63,17 +62,24 @@
|
|||
:padding-horizontal 12})
|
||||
|
||||
(defstyle item
|
||||
{:ios {:margin-horizontal 12
|
||||
:margin-vertical 16}
|
||||
:android {:margin 16}})
|
||||
{:ios {:padding-horizontal 12
|
||||
:padding-vertical 16}
|
||||
:android {:padding 16}})
|
||||
|
||||
(def item-text
|
||||
{:color styles/color-blue4
|
||||
{:color colors/blue
|
||||
:font-size 17})
|
||||
|
||||
(def toolbar-text-action-disabled {:color styles/color-gray7})
|
||||
(defstyle item-text-action
|
||||
{:color colors/blue
|
||||
:ios {:font-size 15
|
||||
:letter-spacing -0.2}
|
||||
:android {:font-size 14
|
||||
:letter-spacing 0.5}})
|
||||
|
||||
(def item-text-white-background {:color styles/color-blue4})
|
||||
(def toolbar-text-action-disabled {:color colors/gray})
|
||||
|
||||
(def item-text-white-background {:color colors/blue})
|
||||
|
||||
;;TODO(goranjovic) - Breaks the toolbar title into new line on smaller screens
|
||||
;;e.g. see Discover > Popular hashtags on iPhone 5s
|
||||
|
|
|
@ -72,11 +72,11 @@
|
|||
|
||||
;; Actions
|
||||
|
||||
(defn text-action [{:keys [style handler disabled? uppercase?]} title]
|
||||
[react/text {:style (merge styles/item styles/item-text style
|
||||
(defn text-action [{:keys [style handler disabled?]} title]
|
||||
[react/text {:style (merge styles/item styles/item-text-action style
|
||||
(when disabled? styles/toolbar-text-action-disabled))
|
||||
:on-press (when-not disabled? handler)
|
||||
:uppercase? uppercase?}
|
||||
:uppercase? components.styles/uppercase?}
|
||||
title])
|
||||
|
||||
(def blank-action [react/view {:style (merge styles/item styles/toolbar-action)}])
|
||||
|
@ -86,7 +86,7 @@
|
|||
[react/view {:style (merge styles/item styles/toolbar-action)}
|
||||
(when overlay-style
|
||||
[react/view overlay-style])
|
||||
[vector-icons/icon icon icon-opts]]])
|
||||
[vector-icons/icon icon (merge {:container-style styles/action-default} icon-opts)]]])
|
||||
|
||||
(defn- option-actions [icon icon-opts options]
|
||||
[icon-action icon icon-opts
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
[status-im.ui.components.status-bar.view :refer [status-bar]]
|
||||
[status-im.ui.components.toolbar.view :as toolbar]
|
||||
[status-im.ui.screens.group.styles :as styles]
|
||||
[status-im.ui.screens.contacts.styles :as contacts.styles]
|
||||
[status-im.ui.components.styles :as components.styles]))
|
||||
[status-im.ui.screens.contacts.styles :as contacts.styles]))
|
||||
|
||||
(defn- on-toggle [checked? whisper-identity]
|
||||
(let [action (if checked? :deselect-contact :select-contact)]
|
||||
|
@ -30,9 +29,7 @@
|
|||
toolbar/default-nav-back
|
||||
[toolbar/content-title title]
|
||||
(when (pos? count)
|
||||
[toolbar/text-action {:handler handler
|
||||
:uppercase? components.styles/uppercase?
|
||||
:style styles/toggle-list-action}
|
||||
[toolbar/text-action {:handler handler}
|
||||
label])])
|
||||
|
||||
(defn toggle-list [contacts render-function]
|
||||
|
@ -70,20 +67,6 @@
|
|||
(:name group)]
|
||||
[toggle-list contacts group-toggle-contact]]))
|
||||
|
||||
(defn toggle-participants-handler []
|
||||
(re-frame/dispatch [:add-new-group-chat-participants])
|
||||
(re-frame/dispatch [:navigate-back]))
|
||||
|
||||
(defn add-participants-toggle-list-toolbar [selected-contacts-count]
|
||||
[toolbar/toolbar {}
|
||||
toolbar/default-nav-back
|
||||
[toolbar/content-title (i18n/label :t/add-members)]
|
||||
(when (pos? selected-contacts-count)
|
||||
[toolbar/text-action {:handler toggle-participants-handler
|
||||
:uppercase? components.styles/uppercase?
|
||||
:style styles/toggle-list-action}
|
||||
(i18n/label :t/add)])])
|
||||
|
||||
(defview add-participants-toggle-list []
|
||||
(letsubs [contacts [:all-new-contacts]
|
||||
chat-name [:chat :name]
|
||||
|
|
|
@ -170,9 +170,3 @@
|
|||
(def list-view-container
|
||||
{:flex 1
|
||||
:margin-top 10})
|
||||
|
||||
(defstyle toggle-list-action
|
||||
{:font-size 14
|
||||
:android {:font-weight "500"}})
|
||||
|
||||
|
||||
|
|
|
@ -13,15 +13,6 @@
|
|||
[status-im.ui.screens.group.styles :as styles]
|
||||
[status-im.ui.screens.group.db :as v]))
|
||||
|
||||
(defn group-toolbar [group-type edit?]
|
||||
[react/view
|
||||
[status-bar/status-bar]
|
||||
[toolbar/simple-toolbar
|
||||
(i18n/label
|
||||
(if (= group-type :contact-group)
|
||||
(if edit? :t/edit-group :t/new-group)
|
||||
(if edit? :t/chat-settings :t/group-chat)))]])
|
||||
|
||||
(views/defview group-name-view []
|
||||
(views/letsubs [new-group-name [:get :new-chat-name]]
|
||||
[react/view add-new.styles/input-container
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
(views/defview home-list-deletable [[home-item-id home-item]]
|
||||
(views/letsubs [swiped? [:delete-swipe-position home-item-id]]
|
||||
(let [delete-action (if (:chat-id home-item) :remove-chat :remove-browser)
|
||||
inner-item-view (if (:chat-id home-item)
|
||||
inner-item-view (if (:chat-id home-item)
|
||||
inner-item/home-list-chat-item-inner-view
|
||||
inner-item/home-list-browser-item-inner-view)
|
||||
offset-x (animation/create-value (if swiped? styles/delete-button-width 0))
|
||||
|
|
Loading…
Reference in New Issue