Skip to content

Commit

Permalink
chore: remove use of override-background-color prop in button
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 committed Jul 24, 2023
1 parent eb3de97 commit ab0fc11
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 86 deletions.
23 changes: 11 additions & 12 deletions src/quo2/components/buttons/button/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
(let [pressed? (reagent/atom false)]
(fn
[{:keys [on-press on-long-press disabled type background size before after above
width customization-color theme override-background-color
width customization-color theme
accessibility-label icon style inner-style]
:or {type :primary
size 40
Expand Down Expand Up @@ -71,17 +71,16 @@
container-style)}
[rn/view
{:style (merge
(style/style-container {:size size
:disabled disabled
:border-radius border-radius
:background-color
(or override-background-color background-color)
:border-color border-color
:icon-only? icon-only?
:icon-above icon-above
:width width
:icon-left icon-left
:icon-right icon-right})
(style/style-container {:size size
:disabled disabled
:border-radius border-radius
:background-color background-color
:border-color border-color
:icon-only? icon-only?
:icon-above icon-above
:width width
:icon-left icon-left
:icon-right icon-right})
inner-style)}
(when customization-color
[customization-colors/overlay
Expand Down
10 changes: 5 additions & 5 deletions src/quo2/components/code/snippet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
:line-number-width line-number-width}]]
[rn/view {:style style/copy-button}
[button/button
{:icon true
:type :grey
:size 24
:on-press on-copy-press
:override-background-color (style/button-background-color)}
{:icon true
:type :grey
:background :blur
:size 24
:on-press on-copy-press}
:main-icons/copy]]]))

(defn snippet
Expand Down
28 changes: 14 additions & 14 deletions src/quo2/components/navigation/page_nav.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
{:no-color true})))

(defn left-section-view
[{:keys [on-press icon accessibility-label type icon-background-color]
[{:keys [on-press icon accessibility-label type icon-background]
:or {type :grey}}
put-middle-section-on-left?]
[rn/view {:style (when put-middle-section-on-left? {:margin-right 5})}
[button/button
{:on-press on-press
:icon true
:type type
:size 32
:accessibility-label accessibility-label
:override-background-color icon-background-color}
{:on-press on-press
:icon true
:type type
:size 32
:accessibility-label accessibility-label
:background icon-background}
icon]])

(defn- mid-section-comp
Expand Down Expand Up @@ -152,7 +152,7 @@
:justify-content :flex-end)}
(let [last-icon-index (-> right-section-buttons count dec)]
(map-indexed (fn [index
{:keys [icon on-press type style icon-background-color
{:keys [icon on-press type style icon-background
accessibility-label label]
:or {type :grey}}]
^{:key index}
Expand All @@ -163,12 +163,12 @@
accessibility-label (assoc :accessibility-label accessibility-label
:accessible true))
[button/button
{:on-press on-press
:icon (not label)
:type type
:before (when label icon)
:size 32
:override-background-color icon-background-color}
{:on-press on-press
:icon (not label)
:type type
:before (when label icon)
:size 32
:background icon-background}
(if label label icon)]])
right-section-buttons))])

Expand Down
15 changes: 7 additions & 8 deletions src/status_im2/common/home/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
[type]
(let [default? (= type :default)
dark? (colors/dark?)]
{:icon true
:size 32
:style {:margin-left 12}
:type (if default?
(if dark? :grey :dark-grey)
type)
:override-background-color (when (and dark? default?)
colors/neutral-90)}))
{:icon true
:size 32
:style {:margin-left 12}
:type (if default?
(if dark? :grey :dark-grey)
type)
}))

(defn- unread-indicator
[]
Expand Down
35 changes: 18 additions & 17 deletions src/status_im2/common/scroll_page/view.cljs
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
(ns status-im2.common.scroll-page.view
(:require [oops.core :as oops]
[quo2.core :as quo]
[quo2.foundations.colors :as colors]
[react-native.core :as rn]
[react-native.platform :as platform]
[reagent.core :as reagent]
[status-im2.common.scroll-page.style :as style]
[utils.re-frame :as rf]
[react-native.reanimated :as reanimated]))

(defn icon-color
[]
(colors/theme-colors colors/white-opa-40 colors/neutral-80-opa-40))

(def negative-scroll-position-0 (if platform/ios? -44 0))
(def scroll-position-0 (if platform/ios? 44 0))

Expand Down Expand Up @@ -71,18 +66,24 @@
top-nav]
[rn/view {:style {:margin-top 44}}
[quo/page-nav
(merge {:horizontal-description? true
:one-icon-align-left? true
:align-mid? false
:page-nav-color :transparent
:mid-section {:type :text-with-description
:main-text nil
:description-img nil}
:right-section-buttons page-nav}
(when navigate-back?
{:left-section {:icon :i/close
:icon-background-color (icon-color)
:on-press #(rf/dispatch [:navigate-back])}}))]])
(merge
{:horizontal-description? true
:one-icon-align-left? true
:align-mid? false
:page-nav-color :transparent
:mid-section {:type :text-with-description
:main-text nil
:description-img nil}
:right-section-buttons (if (= 1 reanimated/get-shared-value opacity-animation)
(assoc page-nav :icon-background :blur)
page-nav)}
(when navigate-back?
{:left-section {:icon :i/close
:type :grey
:icon-background (if (= 1 reanimated/get-shared-value opacity-animation)
:blur
:photo)
:on-press #(rf/dispatch [:navigate-back])}}))]])
(when title-colum
title-colum)
sticky-header]]))
Expand Down
10 changes: 0 additions & 10 deletions src/status_im2/contexts/add_new_contact/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@
:size 24
:style {:margin-top 6}})

(defn button-close
[]
{:type :grey
:icon true
:accessibility-label :new-contact-close-button
:size 32
:override-background-color (colors/theme-colors
colors/neutral-10
colors/neutral-90)})

(def button-qr
{:type :outline
:icon true
Expand Down
31 changes: 18 additions & 13 deletions src/status_im2/contexts/add_new_contact/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@
[rn/view (style/container-outer)
[rn/view style/container-inner
[quo/button
(merge (style/button-close)
{:on-press
(fn []
(reset! clipboard nil)
(reset! default-value nil)
(rf/dispatch [:contacts/clear-new-identity])
(rf/dispatch [:navigate-back]))}) :i/close]
{:type :grey
:icon true
:accessibility-label :new-contact-close-button
:size 32
:on-press
(fn []
(reset! clipboard nil)
(reset! default-value nil)
(rf/dispatch [:contacts/clear-new-identity])
(rf/dispatch [:navigate-back]))} :i/close]
[quo/text (style/text-title)
(i18n/label :t/add-a-contact)]
[quo/text (style/text-subtitle)
Expand All @@ -87,12 +90,14 @@
:return-key-type :done})]
(when show-paste-button?
[quo/button
(merge style/button-paste
{:on-press
(fn []
(reset! default-value @clipboard)
(rf/dispatch
[:contacts/set-new-identity @clipboard nil]))})
{:type :outline
:size 24
:style {:margin-top 6}
:on-press
(fn []
(reset! default-value @clipboard)
(rf/dispatch
[:contacts/set-new-identity @clipboard nil]))}
(i18n/label :t/paste)])]
[quo/button
(merge style/button-qr
Expand Down
15 changes: 8 additions & 7 deletions src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,14 @@

(defn page-nav-right-section-buttons
[id]
[{:icon :i/options
:icon-background-color (scroll-page/icon-color)
:accessibility-label :community-options-for-community
:on-press #(rf/dispatch
[:show-bottom-sheet
{:content (fn []
[options/community-options-bottom-sheet id])}])}])
[{:icon :i/options
:type :grey
:icon-background :photo
:accessibility-label :community-options-for-community
:on-press #(rf/dispatch
[:show-bottom-sheet
{:content (fn []
[options/community-options-bottom-sheet id])}])}])

(defn pick-first-category-by-height
[scroll-height first-channel-height categories-heights]
Expand Down

0 comments on commit ab0fc11

Please sign in to comment.