-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New profile UI #17521
New profile UI #17521
Changes from 5 commits
468c05e
3b5397d
7e50f4f
62751cb
d66bd94
da460d0
0da41c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,13 @@ | |
[size] | ||
(case size | ||
:small 36 | ||
40)) | ||
(min size 40))) | ||
|
||
(defn size->container-size | ||
[size] | ||
(case size | ||
:small 52 | ||
64)) | ||
(min size 64))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems like it's wrong to me, why did you make these changes? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed. Needed to changed to smaller size to match the design. |
||
|
||
(defn size->single-title-size | ||
[size] | ||
|
@@ -70,29 +70,31 @@ | |
children)) | ||
|
||
(defn icon-column | ||
[{:keys [icon icon-bg-color icon-color size icon-container-style]}] | ||
[{:keys [icon icon-bg-color icon-color icon-size icon-container-style]}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, imo this prop name doesn't need to be changed or is there a particular reason for it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed. |
||
(when icon | ||
(let [icon-size (size->icon-size size)] | ||
(let [_icon-size (size->icon-size icon-size)] | ||
[rn/view {:style (or icon-container-style (:tiny spacing/padding-horizontal))} | ||
(cond | ||
(vector? icon) | ||
icon | ||
(keyword? icon) | ||
[rn/view | ||
{:style {:width icon-size | ||
:height icon-size | ||
{:style {:width _icon-size | ||
:height _icon-size | ||
:align-items :center | ||
:justify-content :center | ||
:border-radius (/ icon-size 2) | ||
:border-radius (/ _icon-size 2) | ||
:background-color icon-bg-color}} | ||
[icons/icon icon {:color icon-color}]])]))) | ||
|
||
(defn title-column | ||
[{:keys [title text-color subtitle subtitle-max-lines subtitle-secondary | ||
title-accessibility-label size text-size title-text-weight | ||
title-style | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please rollback this file |
||
right-side-present?]}] | ||
[rn/view | ||
{:style (merge (:tiny spacing/padding-horizontal) | ||
title-style | ||
;; make left-side title grow if nothing is present on right-side | ||
(when-not right-side-present? | ||
{:flex 1 | ||
|
@@ -215,8 +217,10 @@ | |
|
||
(defn list-item | ||
[{:keys [theme accessory disabled subtitle-max-lines icon icon-container-style | ||
icon-size | ||
left-side-alignment icon-color icon-bg-color | ||
title subtitle subtitle-secondary active on-press on-long-press chevron size text-size | ||
title-style | ||
accessory-text accessibility-label title-accessibility-label accessory-style | ||
haptic-feedback haptic-type error animated animated-accessory? title-text-weight | ||
container-style | ||
|
@@ -267,10 +271,12 @@ | |
[container {:size size :container-style container-style} | ||
[left-side | ||
{:icon-color icon-color | ||
:icon-size icon-size | ||
:text-color (if on-press | ||
text-color | ||
(:text-color (themes :main))) | ||
:left-side-alignment left-side-alignment | ||
:title-style title-style | ||
:icon-bg-color icon-bg-color | ||
:title-accessibility-label title-accessibility-label | ||
:icon icon | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
(def text text/text) | ||
(def header header/header) | ||
(def header-action header/header-action) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see other comments about using quo2 components only. Also we generally try to avoid exporting multiple components from the one file, so in general I would prefer they were separated to their own view file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed it. |
||
(def animated-header animated-header/header) | ||
(def text-input text-input/text-input) | ||
(def tooltip tooltip/tooltip) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,11 @@ | |
(def white-opa-90 (alpha white 0.9)) | ||
(def white-opa-95 (alpha white 0.95)) | ||
|
||
(def magenta "#EC266C") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can remove these colors, we already have them defined. They are also a more dynamic set of colors based on the users customization-color (set in the onboarding phase) instead when you go to use this
that's what it will be for the use case you are using it for anyway where 40 is 40% opacity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you search in the codebase you'll see many other examples of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @J-Son89 it's changed. |
||
;; with transparency | ||
(def magenta-opa-40 (alpha "#EC266C" 0.4)) | ||
|
||
|
||
;;;;Blur | ||
(def white-70-blur (alpha white 0.7)) | ||
(def white-70-blur-opaque (alpha-opaque white 0.7)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,80 @@ | ||
(ns status-im.ui.screens.profile.user.styles) | ||
(ns status-im.ui.screens.profile.user.styles | ||
(:require [quo2.foundations.colors :as colors] | ||
[react-native.safe-area :as safe-area])) | ||
|
||
(def share-link-button | ||
{:margin-top 12 | ||
:margin-horizontal 16 | ||
:margin-bottom 16}) | ||
|
||
(def radius 16) | ||
|
||
(def top-background-view | ||
{:background-color colors/magenta-opa-40 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is where you should be using the custom-color approach
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Changed all its appearance. |
||
:position :absolute | ||
:top 0 | ||
:left 0 | ||
:height 400 | ||
:width 400 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any particular reason for 400? would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just want to keep the view as the solid background (magenta) on the top when pull down. |
||
:z-index -1}) | ||
|
||
(def toolbar | ||
{:padding-bottom 16 | ||
:padding-top (safe-area/get-top) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @smohamedjavid this is alright to do, or we normally get this value at the rendering of the component view in a let var? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. We usually get the safe area value from the component's let var. 👍 ;; view.cljs
(let [top (safe-area/get-top)]
[rn/view {:style (style/toolbar top)}])
;; style.cljs
(defn toolbar
[top]
{:padding-bottom 16
:padding-top top
:flex-direction :row
:align-items :center
:justify-content :space-between}) |
||
:flex-direction :row | ||
:align-items :center | ||
:justify-content :space-between}) | ||
|
||
(def header-icon-style | ||
{:border-radius 10 | ||
:margin-left 16 | ||
:width 32 | ||
:height 32 | ||
:background-color colors/white-opa-10}) | ||
|
||
(def right-accessories | ||
{:flex-direction :row | ||
:align-items :center | ||
:justify-content :space-between | ||
:margin-right 20}) | ||
|
||
(def avatar | ||
{:margin-top 8 | ||
:margin-horizontal 24 | ||
:z-index 100}) | ||
|
||
(def user-info | ||
{:background-color colors/neutral-95 | ||
:padding-horizontal 16 | ||
:border-top-left-radius 20 | ||
:border-top-right-radius 20 | ||
:margin-top -38 | ||
:padding-top 38 | ||
:padding-bottom 16}) | ||
|
||
(def container-style {:background-color colors/neutral-95}) | ||
|
||
(def rounded-view | ||
{:margin-top 16 | ||
:margin-horizontal 20 | ||
:overflow "hidden" | ||
:border-radius radius}) | ||
|
||
(def list-item-container | ||
{:background-color "#242D3F" | ||
:padding-left -12 | ||
:padding-right 6 | ||
:height 50}) | ||
|
||
(def logout-container | ||
{:align-items :center | ||
:justify-content :center | ||
:flex-direction :row | ||
:height 48 | ||
:margin-horizontal 20 | ||
:margin-top 16 | ||
:margin-bottom 64 | ||
:overflow "hidden" | ||
:border-radius radius | ||
:background-color colors/danger-50-opa-20}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo for danger it's better to also use the colors mechanism-> i.e in this case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Changed. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
[status-im.ui.screens.profile.contact.views :as contact] | ||
[status-im.ui.screens.profile.group-chat.views :as profile.group-chat] | ||
[status-im.ui.screens.profile.seed.views :as profile.seed] | ||
[status-im.ui.screens.profile.user.views :as profile.user] | ||
[status-im2.contexts.profile.profiles.views-v2 :as profile.user] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it would be preferable if you register the new screen in |
||
[status-im.ui.screens.progress.views :as progress] | ||
[status-im.ui.screens.qr-scanner.views :as qr-scanner] | ||
[status-im.ui.screens.reset-password.views :as reset-password] | ||
|
@@ -74,7 +74,12 @@ | |
[status-im.ui.screens.wallet.settings.views :as wallet-settings] | ||
[status-im.ui.screens.wallet.swap.views :as wallet.swap] | ||
[status-im.ui.screens.wallet.transactions.views :as wallet-transactions] | ||
[status-im2.contexts.chat.group-details.view :as group-details])) | ||
[status-im2.contexts.chat.group-details.view :as group-details] | ||
[status-im2.contexts.chat.home.view :as chat-home] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's unclear why you have added all of these screens here? we already have them registered in the app? any particular reason? 🤨 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Want to navigate to the chat home screen. Just removed. |
||
[status-im2.contexts.communities.home.view :as communities-home] | ||
[status-im2.contexts.shell.share.view :as share-view] | ||
[status-im.ui.screens.browser.stack :as browser] | ||
[status-im2.navigation.options :as options])) | ||
|
||
(defn right-button-options | ||
[id icon] | ||
|
@@ -110,7 +115,11 @@ | |
:component stickers/pack} | ||
|
||
;; Community (legacy only for e2e needed) | ||
|
||
{:name :community-home | ||
:options {:topBar {:title {:text (i18n/label :t/import-community-title)}} | ||
:insets {:top? true | ||
:bottom? true}} | ||
:component communities-home/view} | ||
{:name :community-members | ||
;;TODO custom subtitle | ||
:options {:insets {:top? true}} | ||
|
@@ -425,6 +434,11 @@ | |
:top? true}} | ||
:component contact/nickname-view} | ||
|
||
{:name :chat-home | ||
:options {:topBar {:title {:text (i18n/label :t/chat)}} | ||
:insets {:top? true}} | ||
:component chat-home/view} | ||
|
||
;[Group chat] Add participants | ||
{:name :add-participants-toggle-list | ||
:on-focus [:group/add-participants-toggle-list] | ||
|
@@ -530,6 +544,11 @@ | |
:options {:insets {:bottom? true | ||
:top? true}} | ||
:component bookmarks/new-bookmark} | ||
{:name :browser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please rollback this file |
||
;;TODO dynamic title | ||
:options {:insets {:bottom? false | ||
:top? false}} | ||
:component browser/browser-stack} | ||
|
||
;Profile | ||
{:name :profile | ||
|
@@ -661,13 +680,14 @@ | |
{:name :change-pairing-code | ||
:insets {:bottom? true} | ||
:component keycard.pairing/change-pairing-code} | ||
|
||
{:name :show-all-connections | ||
:options {:topBar {:title {:text (i18n/label :all-connections)}} | ||
:insets {:bottom? true | ||
:top? true}} | ||
:component manage-all-connections/views} | ||
|
||
{:name :share-view | ||
:options options/transparent-screen-options | ||
:component share-view/view} | ||
;; BUG REPORT | ||
{:name :bug-report | ||
:options {:insets {:top? true}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
(ns status-im2.contexts.profile.profiles.components | ||
(:require [status-im.ui.components.react :as react] | ||
[quo.core :as quo] | ||
[status-im2.contexts.profile.profiles.style :as styles] | ||
[status-im2.contexts.chat.messages.avatar.view :as avatar] | ||
[status-im.multiaccounts.core :as multiaccounts])) | ||
|
||
(def top-background-view | ||
[react/view | ||
{:style styles/top-background-view}]) | ||
|
||
(defn button | ||
[{:keys [icon accessibility-label on-press style]}] | ||
[quo/header-action | ||
{:icon icon | ||
:on-press on-press | ||
:accessibility-label accessibility-label | ||
:style (merge styles/header-icon-style style)}]) | ||
|
||
(defn fixed-toolbar | ||
[{:keys [on-close on-switch-profile on-show-qr on-share]}] | ||
[react/view | ||
{:style styles/toolbar} | ||
[button | ||
{:icon :main-icons/close | ||
:accessibility-label :close-header-button | ||
:on-press on-close | ||
:style {:margin-left 20}}] | ||
[react/view | ||
{:style styles/right-accessories} | ||
[button | ||
{:icon :main-icons/multi-profile | ||
:accessibility-label :multi-profile-header-button | ||
:on-press on-switch-profile}] | ||
[button | ||
{:icon :main-icons/qr2 | ||
:accessibility-label :qr-header-button | ||
:on-press on-show-qr | ||
:style {:margin-left 14}}] | ||
[button | ||
{:icon :main-icons/share | ||
:accessibility-label :share-header-button | ||
:on-press on-share}]]]) | ||
|
||
(defn user-info | ||
[{:keys [emoji-hash account public-key about]}] | ||
[react/view | ||
[react/view | ||
{:style styles/avatar} | ||
[avatar/avatar public-key :big]] | ||
|
||
[react/view | ||
{:style styles/user-info} | ||
[quo/text | ||
{:weight :semi-bold | ||
:size :xx-large | ||
:style {:margin-top 16}} | ||
(multiaccounts/displayed-name account)] | ||
[quo/text | ||
{:size :large | ||
:style {:margin-top 8}} | ||
about] | ||
[quo/text | ||
{:size :large | ||
:style {:margin-top 8}} | ||
emoji-hash]]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rollback this file