-
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 mobile home background SVG opacity #21745
Fix mobile home background SVG opacity #21745
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@Julesssss looks like this was your issue, added you as a reviewer. Let me know if you need me to review instead and I'll reassign! |
@waterim Can you please add screenshots for ALL the platforms? Also, can you please update the test section to mention that the user should open the login screen? |
@allroundexperts Comment updated. |
According to our guidelines, the screenshots for all the platforms are required. |
@allroundexperts After verifying mobile Safari I found that opacity is not applying from updated SVG. With a new commit I added Platform specific check to display updated SVG only on Android. All platforms are accepting opacity in the same way except Android. |
@@ -57,6 +58,8 @@ function SignInPageLayout(props) { | |||
scrollViewRef.current.scrollTo({y: 0, animated}); | |||
}; | |||
|
|||
const MobileBackgroundImage = Platform.OS === 'android' ? SignInHeroBackgroundImageMobileAndroid : SignInHeroBackgroundImageMobile; |
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.
@waterim We never add platform specific code inline like this. We always create a separate file which gets loaded during the build process. You can easily find examples of such files if you search the code.
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.
@allroundexperts Okay, will change it, thank you
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.
@allroundexperts Do you mean to create a separate component with 2 files, one is default and one with .android extension and move there this backgroundImage?
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.
Instead of creating an android specific file for this whole component, I think we can create a file that just re-exports the svg and use that in this component. This way, we will avoid the component code duplication.
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.
Agree with the above. Also, is there a reason we can't use the new SVG for all platforms?
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.
@Julesssss on web mobile safari new SVG is working wrong, same as Android before changes, unfortunately
ios/Podfile.lock
Outdated
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.
Not required.
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.
Accidentally added only podfile.lock. Reverted that commit.
@allroundexperts Everything is ready for a review. |
@@ -12,7 +12,7 @@ import * as StyleUtils from '../../../styles/StyleUtils'; | |||
import scrollViewContentContainerStyles from './signInPageStyles'; | |||
import themeColors from '../../../styles/themes/default'; | |||
import SignInHeroBackgroundImage from '../../../../assets/images/home-background--desktop.svg'; | |||
import SignInHeroBackgroundImageMobile from '../../../../assets/images/home-background--mobile.svg'; | |||
import MobileBackgroundImage from './MobileBackgroundImage'; |
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.
I think we can improve this further. In the src/pages/signin/SignInPageLayout/MobileBackgroundImage/index.js
we can return the correct image based on the screen width. This way, we'll have to import a single file in this component that will work on all screen sizes and platforms.
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.
Okay, added
@@ -78,7 +77,8 @@ function SignInPageLayout(props) { | |||
> | |||
<View style={[styles.flex1]}> | |||
<View style={styles.signInPageHeroCenter}> | |||
<SignInHeroBackgroundImage | |||
<BackgroundImage | |||
isSmallScreen={props.isSmallScreenWidth} |
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.
I think we're already checking for small screen above. As such, we can just add the following:
<BackgroundImage
isSmallScreen
.
.
/>
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.
updated
@@ -112,7 +112,8 @@ function SignInPageLayout(props) { | |||
ref={scrollViewRef} | |||
> | |||
<View style={[styles.flex1, styles.flexColumn, StyleUtils.getMinimumHeight(Math.max(variables.signInContentMinHeight, containerHeight))]}> | |||
<SignInHeroBackgroundImageMobile | |||
<BackgroundImage | |||
isSmallScreen={props.isSmallScreenWidth} |
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 add isSmallScreen={false}
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.
updated
Solid work @waterim 🙌 🙌 |
Reviewer Checklist
Screenshots/VideosDesktopScreen.Recording.2023-06-30.at.12.31.19.AM.mov |
@allroundexperts Updated prop, thank you |
@waterim Can you please make sure that you have put in your proposal link correctly in the PR description? That is important for our automation to work. Normally, if they are entered correctly, the related reviewers are automatically assigned. Here's how a correct link should look like: Please update your description such that it matches our standard way. |
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.
Looks good and tests well!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.36-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.36-5 🚀
|
<DesktopBackgroundImage | ||
pointerEvents={props.pointerEvents} | ||
width={props.width} | ||
/> |
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.
Hi, this PR caused a bug - #23137 (comment)
We should have passed styles as a prop for desktop too
Details
Fixed Issues
$ #20829
PROPOSAL: #20829 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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 - Chrome
Web - Safari
Mobile Web - Chrome
Mobile Web - Safari
iOS
Android
Desktop