-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
15ae246
commit eff6ee7
Showing
16 changed files
with
416 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(ns quo.components.overlay.style | ||
(:require [quo.foundations.colors :as colors])) | ||
|
||
(defn overlay-background | ||
[type] | ||
(let [background-color (case type | ||
:shell colors/neutral-80-opa-80-blur | ||
:drawer colors/neutral-100-opa-70-blur | ||
nil)] | ||
{:position :absolute | ||
:top 0 | ||
:left 0 | ||
:right 0 | ||
:bottom 0 | ||
:background-color background-color})) | ||
|
||
(def container | ||
{:flex 1}) | ||
|
||
(def blur-container | ||
{:flex 1 | ||
:background-color :transparent}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(ns quo.components.overlay.view | ||
(:require | ||
[quo.components.overlay.style :as style] | ||
[react-native.blur :as blur] | ||
[react-native.core :as rn])) | ||
|
||
(defn view | ||
[{:keys [type]} & children] | ||
[rn/view {:style (style/overlay-background type)} | ||
(if (= type :shell) | ||
[blur/view | ||
{:blur-amount 20 | ||
:blur-radius 25 | ||
:blur-type :transparent | ||
:overlay-color :transparent | ||
:style style/container} | ||
[rn/view {:style style/blur-container} | ||
children]] | ||
[rn/view {:style style/container} | ||
children])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/status_im2/contexts/profile/settings/header/avatar.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
(ns status-im2.contexts.profile.settings.header.avatar | ||
(:require [quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[react-native.reanimated :as reanimated] | ||
[status-im2.contexts.profile.settings.header.style :as style])) | ||
|
||
(def scroll-animation-input-range [0 50]) | ||
(def header-extrapolation-option | ||
{:extrapolateLeft "clamp" | ||
:extrapolateRight "clamp"}) | ||
|
||
(defn f-avatar | ||
[{:keys [scroll-y full-name online? profile-picture customization-color]}] | ||
(let [image-scale-animation (reanimated/interpolate scroll-y | ||
scroll-animation-input-range | ||
[1 0.5] | ||
header-extrapolation-option) | ||
image-top-margin-animation (reanimated/interpolate scroll-y | ||
scroll-animation-input-range | ||
[0 20] | ||
header-extrapolation-option) | ||
image-side-margin-animation (reanimated/interpolate scroll-y | ||
scroll-animation-input-range | ||
[0 -20] | ||
header-extrapolation-option) | ||
theme (quo.theme/get-theme)] | ||
[reanimated/view | ||
{:style (style/avatar-container theme | ||
image-scale-animation | ||
image-top-margin-animation | ||
image-side-margin-animation)} | ||
[quo/user-avatar | ||
{:full-name full-name | ||
:online? online? | ||
:profile-picture profile-picture | ||
:status-indicator? true | ||
:ring? true | ||
:customization-color customization-color | ||
:size :big}]])) | ||
|
||
(defn view | ||
[props] | ||
[:f> f-avatar props]) |
36 changes: 36 additions & 0 deletions
36
src/status_im2/contexts/profile/settings/header/header_shape.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
(ns status-im2.contexts.profile.settings.header.header-shape | ||
(:require [quo.foundations.colors :as colors] | ||
[react-native.core :as rn] | ||
[react-native.reanimated :as reanimated] | ||
[react-native.svg :as svg] | ||
[status-im2.contexts.profile.settings.header.style :as style])) | ||
|
||
(defn left-radius | ||
[background-color] | ||
[svg/svg {:width "20" :height "20" :viewBox "0 0 20 20" :fill "none"} | ||
[svg/path | ||
{:d "M20 0C7 2 0 10 0 20V0H15Z" | ||
:fill background-color}]]) | ||
|
||
(defn right-radius | ||
[background-color] | ||
[svg/svg {:width "20" :height "21" :viewBox "0 0 20 21" :fill "none"} | ||
[svg/path | ||
{:d "M20 20V0H0C11 0 20 9 20 20Z" | ||
:fill background-color}]]) | ||
|
||
(defn f-view | ||
[{:keys [scroll-y customization-color theme]}] | ||
(let [background-color (colors/resolve-color customization-color theme 40) | ||
opacity-animation (reanimated/interpolate scroll-y | ||
[0 45 50] | ||
[1 1 0])] | ||
[:<> | ||
[rn/view {:style (style/header-middle-shape background-color)}] | ||
[reanimated/view {:style (style/radius-container opacity-animation)} | ||
[left-radius background-color] | ||
[right-radius background-color]]])) | ||
|
||
(defn view | ||
[props] | ||
[:f> f-view props]) |
48 changes: 48 additions & 0 deletions
48
src/status_im2/contexts/profile/settings/header/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
(ns status-im2.contexts.profile.settings.header.style | ||
(:require [quo.foundations.colors :as colors] | ||
[react-native.reanimated :as reanimated])) | ||
|
||
(defn header-view | ||
[customization-color theme] | ||
{:background-color (colors/resolve-color customization-color theme 40) | ||
:min-height 100 | ||
:flex 1}) | ||
|
||
(def avatar-row-wrapper | ||
{:display :flex | ||
:padding-left 16 | ||
:padding-right 12 | ||
:margin-top -60 | ||
:margin-bottom -4 | ||
:align-items :flex-end | ||
:justify-content :space-between | ||
:flex-direction :row}) | ||
|
||
(def title-container | ||
{:padding-horizontal 20 | ||
:padding-vertical 12}) | ||
|
||
(defn header-middle-shape | ||
[background-color] | ||
{:background-color background-color | ||
:height 48 | ||
:flex-grow 1}) | ||
|
||
(defn radius-container | ||
[opacity-animation] | ||
(reanimated/apply-animations-to-style | ||
{:opacity opacity-animation} | ||
{:flex-direction :row | ||
:justify-content :space-between})) | ||
|
||
(defn avatar-container | ||
[theme scale-animation top-margin-animation side-margin-animation] | ||
(reanimated/apply-animations-to-style | ||
{:transform [{:scale scale-animation}] | ||
:margin-top top-margin-animation | ||
:margin-left side-margin-animation | ||
:margin-bottom side-margin-animation} | ||
{:align-items :flex-start | ||
:border-width 4 | ||
:border-color (colors/theme-colors colors/border-avatar-light colors/neutral-80-opa-80 theme) | ||
:border-radius 100})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(ns status-im2.contexts.profile.settings.header.view | ||
(:require [clojure.string :as string] | ||
[quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[react-native.core :as rn] | ||
[status-im2.common.not-implemented :as not-implemented] | ||
[status-im2.contexts.profile.settings.header.avatar :as header.avatar] | ||
[status-im2.contexts.profile.settings.header.header-shape :as header.shape] | ||
[status-im2.contexts.profile.settings.header.style :as style] | ||
[status-im2.contexts.profile.utils :as profile.utils] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- f-view | ||
[{:keys [theme scroll-y]}] | ||
(let [{:keys [public-key emoji-hash] :as profile} (rf/sub [:profile/profile-with-image]) | ||
online? (rf/sub [:visibility-status-updates/online? | ||
public-key]) | ||
customization-color (rf/sub [:profile/customization-color]) | ||
full-name (profile.utils/displayed-name profile) | ||
profile-picture (profile.utils/photo profile) | ||
emoji-string (string/join emoji-hash)] | ||
[:<> | ||
[header.shape/view | ||
{:scroll-y scroll-y | ||
:customization-color customization-color | ||
:theme theme}] | ||
[rn/view {:style style/avatar-row-wrapper} | ||
[header.avatar/view | ||
{:scroll-y scroll-y | ||
:display-name full-name | ||
:online? online? | ||
:customization-color customization-color | ||
:profile-picture profile-picture}] | ||
[rn/view {:style {:margin-bottom 4}} | ||
[quo/dropdown | ||
{:background :blur | ||
:size :size-32 | ||
:type :outline | ||
:icon? true | ||
:icon-name :i/online | ||
:on-press not-implemented/alert} | ||
(i18n/label :t/online)]]] | ||
[quo/text-combinations | ||
{:container-style style/title-container | ||
:emoji-hash emoji-string | ||
:title full-name}]])) | ||
|
||
(def view (quo.theme/with-theme f-view)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
(ns status-im2.contexts.profile.settings.list-items | ||
(:require [status-im2.common.not-implemented :as not-implemented] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(def items | ||
[[{:title (i18n/label :t/edit-profile) | ||
:on-press not-implemented/alert | ||
:image-props :i/edit | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/password) | ||
:on-press not-implemented/alert | ||
:image-props :i/password | ||
:image :icon | ||
:action :arrow}] | ||
[{:title (i18n/label :t/messages) | ||
:on-press not-implemented/alert | ||
:image-props :i/messages | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/wallet) | ||
:on-press not-implemented/alert | ||
:image-props :i/wallet | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/dapps) | ||
:on-press not-implemented/alert | ||
:image-props :i/placeholder | ||
:image :icon | ||
:action :arrow} | ||
{:title "Browser" | ||
:on-press not-implemented/alert | ||
:image-props :i/browser | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/keycard) | ||
:on-press not-implemented/alert | ||
:image-props :i/keycard | ||
:image :icon | ||
:action :arrow}] | ||
[{:title (i18n/label :t/syncing) | ||
:on-press not-implemented/alert | ||
:image-props :i/syncing | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/notifications) | ||
:on-press not-implemented/alert | ||
:image-props :i/notifications | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/appearance) | ||
:on-press not-implemented/alert | ||
:image-props :i/light | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/language-and-currency) | ||
:on-press not-implemented/alert | ||
:image-props :i/globe | ||
:image :icon | ||
:action :arrow}] | ||
[{:title (i18n/label :t/data-usage) | ||
:on-press not-implemented/alert | ||
:image-props :i/mobile | ||
:image :icon | ||
:action :arrow} | ||
{:title (i18n/label :t/advanced) | ||
:on-press not-implemented/alert | ||
:image-props :i/settings | ||
:image :icon | ||
:action :arrow}] | ||
;; temporary link to legacy settings | ||
[{:title "Legacy settings" | ||
:on-press #(rf/dispatch [:navigate-to :my-profile]) | ||
:action :arrow | ||
:image :icon | ||
:image-props :i/toggle}] | ||
[{:title (i18n/label :t/about) | ||
:on-press not-implemented/alert | ||
:action :arrow} | ||
{:title (i18n/label :t/status-help) | ||
:on-press not-implemented/alert | ||
:action :arrow}]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns status-im2.contexts.profile.settings.style | ||
(:require [quo.foundations.colors :as colors])) | ||
|
||
(defn navigation-wrapper | ||
[{:keys [customization-color inset theme]}] | ||
{:padding-top inset | ||
:background-color (colors/resolve-color customization-color theme 40)}) | ||
|
||
(def footer-container | ||
{:padding-horizontal 20 | ||
:padding-vertical 12}) |
Oops, something went wrong.