Skip to content

Commit

Permalink
legacy-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Oct 13, 2023
1 parent 3586aea commit c88acb8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
29 changes: 29 additions & 0 deletions src/status_im/ui/components/colors.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,35 @@
[]
(= :dark @theme-type))

(defn set-legacy-theme-type
[type]
(when-not (= type @theme-type)
(let [old-colors-mapping-colors (get old-colors-mapping-themes type)]
(set! white (:ui-background @theme))
(set! black (:text-01 @theme))
(set! gray-lighter (:ui-01 @theme))
(set! blue (:interactive-01 @theme))
(set! gray (:text-02 @theme))
(set! blue-light (:interactive-02 @theme))
(set! red (:negative-01 @theme))
(set! text black)
(set! mentioned-background (:mentioned-background old-colors-mapping-colors))
(set! mentioned-border (:mentioned-border old-colors-mapping-colors))
(set! white-transparent-10 (alpha white 0.1))
(set! white-transparent (alpha white 0.4))
(set! white-transparent-70 (alpha white 0.7))
(set! black-transparent (alpha black 0.1))
(set! black-transparent-20 (alpha black 0.2))
(set! black-transparent-40 (alpha black 0.4))
(set! black-transparent-50 (alpha black 0.5))
(set! gray-transparent-10 (alpha gray 0.1))
(set! gray-transparent-40 (alpha gray 0.4))
(set! green-transparent-10 (alpha green 0.1))
(set! red-transparent-10 (alpha red 0.1))
(set! blue-transparent-10 (alpha blue 0.1))
(set! pin-background (:pin-background old-colors-mapping-colors)))
(reset! theme-type type)))

;; Colors related to Visibility Status
(def color-online "#7CDA00")
(def color-dnd "#FA6565")
Expand Down
9 changes: 7 additions & 2 deletions src/status_im2/common/theme/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[utils.re-frame :as rf]
[oops.core :refer [oget]]
[react-native.core :as rn]
[react-native.platform :as platform]))
[react-native.platform :as platform]
[status-im.ui.components.colors :as legacy-colors]))

(def device-theme (atom (rn/get-color-scheme)))

Expand All @@ -30,4 +31,8 @@

(defn set-theme
[value]
(quo2/set-theme value))
(quo2/set-theme value)
(reset! legacy-colors/theme (case value
:dark legacy-colors/dark-theme
legacy-colors/light-theme))
(legacy-colors/set-legacy-theme-type value))

0 comments on commit c88acb8

Please sign in to comment.