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.
This could be called WideScreenContent, LargeDisplayWrapper or similar
There was a problem hiding this comment.
LargeDisplayWrapper This seems promising for me. @hayata-suenaga What's your thought?
There was a problem hiding this comment.
is this a test component for testing the display of the blocking view or is this The blocking view?
| onLinkPress: PropTypes.func, | ||
| }; | ||
|
|
||
| const defaultProps = { |
There was a problem hiding this comment.
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.
Maybe shouldBlockContent will be more intuitive, WDYT?
There was a problem hiding this comment.
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.
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.
or is this just a test component?
There was a problem hiding this comment.
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
| 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.
@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.
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. |
ArekChr
left a comment
There was a problem hiding this comment.
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.
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.
| const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth; | |
| if (shouldShowBlockingView) { | |
| if (isSmallScreenWidth) { |
| const {isSmallScreenWidth} = useWindowDimensions(); | ||
|
|
||
| const {translate} = useLocalize(); |
There was a problem hiding this comment.
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.
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.
| shouldBlockContent: undefined, | |
| onLinkPress: () => Navigation.goBack(), |
| subtitle={translate('mobilePlacerHolder.subTitle')} | ||
| linkKey={translate('mobilePlacerHolder.goBackHome')} | ||
| shouldShowLink | ||
| onLinkPress={onLinkPress} |
There was a problem hiding this comment.
| 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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