-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Feat/placeholder web #29092
Feat/placeholder web #29092
Conversation
@hayata-suenaga @ArekChr please review. |
@b4s36t4 please fix the lint error 🙇 |
@hayata-suenaga done. |
src/components/Temp/Temp.js
Outdated
onLinkPress: () => Navigation.dismissModal(), | ||
}; | ||
|
||
function Temp({titleKey, subtitleKey, linkKey, onLinkPress, children, shouldShow}) { |
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.
This could be called WideScreenContent, LargeDisplayWrapper or similar
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.
LargeDisplayWrapper This seems promising for me. @hayata-suenaga What's your thought?
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.
is this a test component for testing the display of the blocking view or is this The blocking view?
src/components/Temp/Temp.js
Outdated
onLinkPress: PropTypes.func, | ||
}; | ||
|
||
const defaultProps = { |
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.
prop for setting min width could be useful, @hayata-suenaga wdyt?
children: PropTypes.node, | ||
|
||
/** If true, child components are replaced with a blocking "not found" view */ | ||
shouldShow: PropTypes.bool, |
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.
Maybe shouldBlockContent
will be more intuitive, WDYT?
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.
Yes, I think considering component name and the way we handle it sounds good. @hayata-suenaga your view?
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.
yes that name sounds good 👍 but why do we need a prop for it? This component already subscribes to the screen size. So the information whether to display the blocking view (this component) is already inside the component?
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.
or is this just a test component?
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 agree, as for now, this is not needed. Until such a use case is needed, I believe we should remove all unnecessary props. IMO, this component should be as simple as possible. In the future, if there is a need to block content in a different scenario than the display size condition, it should then be implemented for specific requirements.
src/SCREENS.ts
Outdated
@@ -24,6 +24,7 @@ export default { | |||
SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop', | |||
SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop', | |||
DESKTOP_SIGN_IN_REDIRECT: 'DesktopSignInRedirect', | |||
MOBILE_TEMP_SCREEN: 'MobilePlaceHolder', |
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.
@b4s36t4 I'm not familiar with the navigation system but why do we need this blocking component as a new screen?
isn't the new component just displayed when the screen size is small in another component?
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.
This component shouldn't be registered as a new screen
@hayata-suenaga @ArekChr Updated everything. can you guys please check?!!
|
@hayata-suenaga @ArekChr What are we going to do about screen. If we follow |
I believe this component will primarily serve as a part of another screen to prevent content display when necessary. Consequently: In desktop browsers, the default 'go back' functionality should suffice for navigation when content is blocked. NotFound screen is also used in side bar which handles more complex scenarios. Will we use this component in modals? Are there some requirements? @hayata-suenaga |
@b4s36t4 yes this is true. I don't think we need to register the component as a screen |
@hayata-suenaga @ArekChr Please check now, removed screen related changes also made Let me know if there's anything 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.
Overall, the code looks good to me, giving approval.
Also I propose making this component as simple as possible, WDYT @hayata-suenaga?
|
||
/** If true, child components are replaced with a blocking view */ | ||
shouldBlockContent: PropTypes.bool, |
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 don't need that for now, cc: @hayata-suenaga
/** If true, child components are replaced with a blocking view */ | |
shouldBlockContent: PropTypes.bool, |
const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth; | ||
|
||
if (shouldShowBlockingView) { |
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.
const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth; | |
if (shouldShowBlockingView) { | |
if (isSmallScreenWidth) { |
const {isSmallScreenWidth} = useWindowDimensions(); | ||
|
||
const {translate} = useLocalize(); |
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.
nit style
const {isSmallScreenWidth} = useWindowDimensions(); | |
const {translate} = useLocalize(); | |
const {translate} = useLocalize(); | |
const {isSmallScreenWidth} = useWindowDimensions(); |
|
||
/** Action to run when clicked on a the link text */ | ||
onLinkPress: PropTypes.func, |
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.
Let's keep is simple as possible. Cc: @hayata-suenaga
/** Action to run when clicked on a the link text */ | |
onLinkPress: PropTypes.func, |
shouldBlockContent: undefined, | ||
onLinkPress: () => Navigation.goBack(), |
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.
shouldBlockContent: undefined, | |
onLinkPress: () => Navigation.goBack(), |
subtitle={translate('mobilePlacerHolder.subTitle')} | ||
linkKey={translate('mobilePlacerHolder.goBackHome')} | ||
shouldShowLink | ||
onLinkPress={onLinkPress} |
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.
onLinkPress={onLinkPress} | |
onLinkPress={Navigation.goBack} |
The author of this PR used the code in their PR. So we don't have to merge or deploy this PR. Thank you everyone for work. You gonna receive a normal payment. We just don't use this PR. |
Details
Added a new placeholder component for using with small-screen devices to show when opened particular screen on mobile devices.
Fixed Issues
$ #28982
PROPOSAL: #28982 (comment)
Tests
NA
Offline tests
NA
QA Steps
NA
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
web.mp4
Mobile Web - Chrome
chrome-web.mp4
Mobile Web - Safari
safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4