-
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
[16845] Wrong buttons background color on community home screen's page nav #17003
Changes from 2 commits
93dd0e5
0531adb
e31e5ab
2a1d7fc
44d9dac
4d80851
008c634
598ca48
75ae50b
52578c3
dee0dc2
d5ac41c
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
:blur :grey}) | ||
|
||
(defn- page-nav-base | ||
[{:keys [margin-top background on-press accessibility-label icon-name] | ||
[{:keys [margin-top background on-press accessibility-label icon-name overlay-shown?] | ||
:or {background :white}} | ||
& children] | ||
(into [rn/view {:style (style/container margin-top)} | ||
|
@@ -30,15 +30,17 @@ | |
:icon-only? true | ||
:size 32 | ||
:on-press on-press | ||
:background (when (button-properties/backgrounds background) background) | ||
:background (if overlay-shown? | ||
ibrkhalil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:blur | ||
(when (button-properties/backgrounds background) background)) | ||
:accessibility-label accessibility-label} | ||
icon-name])] | ||
children)) | ||
|
||
(defn- right-section-spacing [] [rn/view {:style style/right-actions-spacing}]) | ||
|
||
(defn- add-right-buttons-xf | ||
[max-actions background] | ||
[max-actions background overlay-shown?] | ||
(comp (filter map?) | ||
(take max-actions) | ||
(map (fn [{:keys [icon-name label] :as button-props}] | ||
|
@@ -48,7 +50,9 @@ | |
:icon-only? icon-name | ||
:size 32 | ||
:accessible true | ||
:background (when (button-properties/backgrounds background) background)) | ||
:background (if overlay-shown? | ||
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. perhaps put this logic into a simple helper function and leave a comment by that function explaining it's purpose there? 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. We just check if the background is within a set of button types, Here's the definition of backgrounds. 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. I more so meant this because of the overlay part. It's somewhat of a design hack and so isolating to its own function and leaving the comment there hopefully makes the reason for this more apparent/easy to see 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. I think it's better to have a comment explaining it than having a function for it. |
||
:blur | ||
(when (button-properties/backgrounds background) background))) | ||
(or label icon-name)])) | ||
(interpose [right-section-spacing]))) | ||
|
||
|
@@ -64,7 +68,8 @@ | |
emoji]) | ||
|
||
(defn- right-content | ||
[{:keys [background content max-actions min-size? support-account-switcher? account-switcher] | ||
[{:keys [background content max-actions min-size? support-account-switcher? account-switcher | ||
overlay-shown?] | ||
:or {support-account-switcher? true}}] | ||
[rn/view (when min-size? {:style style/right-content-min-size}) | ||
(cond | ||
|
@@ -73,7 +78,7 @@ | |
|
||
(coll? content) | ||
(into [rn/view {:style style/right-actions-container}] | ||
(add-right-buttons-xf max-actions background) | ||
(add-right-buttons-xf max-actions background overlay-shown?) | ||
content) | ||
|
||
:else | ||
|
@@ -170,7 +175,7 @@ | |
shown-name]])) | ||
|
||
(defn- view-internal | ||
[{:keys [type right-side background text-align account-switcher] | ||
[{:keys [type right-side background text-align account-switcher overlay-shown?] | ||
:or {type :no-title | ||
text-align :center | ||
right-side :none | ||
|
@@ -179,7 +184,8 @@ | |
(case type | ||
:no-title | ||
[page-nav-base props | ||
[right-content {:background background :content right-side :max-actions 3}]] | ||
[right-content | ||
{:background background :content right-side :max-actions 3 :overlay-shown? overlay-shown?}]] | ||
|
||
:title | ||
(let [centered? (= text-align :center)] | ||
|
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.
seems like a good solution, perhaps it needs a commit to explain why it is needed? 🤔
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.
You mean in the commit message or a comment?
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.
Just in case it's a comment, I'll do it now
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.
also a nit: perhaps
behind-overlay?
is a clearer name for this prop? 🤨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.
Renamed
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.
Yep I meant in a comment