-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: maintain consistent topbar colour on login #25908
Conversation
@Santhosh-Sellavel Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Navigation.isNavigationReady().then(() => { | ||
const currentRoute = navigationRef.getCurrentRoute(); | ||
let currentScreenBackgroundColor = themeColors.appBG; | ||
if (currentRoute && 'name' in currentRoute && currentRoute.name in themeColors.PAGE_BACKGROUND_COLORS) { | ||
currentScreenBackgroundColor = themeColors.PAGE_BACKGROUND_COLORS[currentRoute.name]; | ||
} | ||
StatusBar.setBarStyle('light-content', true); | ||
StatusBar.setBackgroundColor(currentScreenBackgroundColor); | ||
}); |
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 add a comment here
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.
Added.
Bump @Santhosh-Sellavel! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-04.at.5.20.53.AM.movMobile Web - Chrome & Mobile Web - SafariScreen.Recording.2023-09-04.at.5.15.17.AM.moviOS & AndroidNative.mov |
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.
LGTM, Tests well!
Thanks guys! Looks good to me too but marking it as hold freeze to focus on conference related PRs. |
Merged with main! |
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.
Thanks!
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.68-6 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.68-17 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.70-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.70-8 🚀
|
Details
This PR fixes the issue where the top bar was not of correct colour when opening the initial login page.
While implementing the fix, I found a few more issues. The animation for changing the top bar colour was running even when:
As such, I added a condition in the
useAnimatedReaction
function that prevented the top bar colour from changing if any of the above conditions were satisfied.Also, I found out that it was much cleaner to replace the static value of the top bar colour being set in the
CustomStatusBar
component to a dynamic colour based on the current active route. This was contrary to what I proposed initially where we were essentially running the above logic inside a newuseEffect
hook inside theNavigationRoot
component.Fixed Issues
$ #23345
PROPOSAL: #23345 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-08-25.at.2.01.54.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-08-25.at.4.02.14.AM.mov
Mobile Web - Safari
Screen.Recording.2023-08-25.at.4.00.04.AM.mov
Desktop
iOS
Screen.Recording.2023-08-25.at.4.05.15.AM.mov
Android
Screen.Recording.2023-08-25.at.4.06.07.AM.mov