-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Feat/placeholder web #29092
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
Changes from all commits
69eb597
674c80c
f6b3941
e1ba6df
0629827
4ff72cb
f280551
d350544
bf51ab2
64981ad
736d176
7e08ad6
fe65554
eb11fe0
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||||||||
| import PropTypes from 'prop-types'; | ||||||||||||
| import React from 'react'; | ||||||||||||
| import {View} from 'react-native'; | ||||||||||||
| import _ from 'lodash'; | ||||||||||||
| import useLocalize from '../../hooks/useLocalize'; | ||||||||||||
| import useWindowDimensions from '../../hooks/useWindowDimensions'; | ||||||||||||
| import Navigation from '../../libs/Navigation/Navigation'; | ||||||||||||
| import styles from '../../styles/styles'; | ||||||||||||
| import variables from '../../styles/variables'; | ||||||||||||
| import BlockingView from '../BlockingViews/BlockingView'; | ||||||||||||
| import * as Illustrations from '../Icon/Illustrations'; | ||||||||||||
|
|
||||||||||||
| const propTypes = { | ||||||||||||
| /** Child elements */ | ||||||||||||
| children: PropTypes.node, | ||||||||||||
|
|
||||||||||||
| /** If true, child components are replaced with a blocking view */ | ||||||||||||
| shouldBlockContent: PropTypes.bool, | ||||||||||||
|
|
||||||||||||
| /** Action to run when clicked on a the link text */ | ||||||||||||
| onLinkPress: PropTypes.func, | ||||||||||||
|
Comment on lines
+19
to
+21
Contributor
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. Let's keep is simple as possible. Cc: @hayata-suenaga
Suggested change
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| const defaultProps = { | ||||||||||||
| children: null, | ||||||||||||
| shouldBlockContent: undefined, | ||||||||||||
| onLinkPress: () => Navigation.goBack(), | ||||||||||||
|
Comment on lines
+26
to
+27
Contributor
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.
Suggested change
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| function LargeDisplayWrapper({onLinkPress, children, shouldBlockContent}) { | ||||||||||||
| const {isSmallScreenWidth} = useWindowDimensions(); | ||||||||||||
|
|
||||||||||||
| const {translate} = useLocalize(); | ||||||||||||
|
Comment on lines
+31
to
+33
Contributor
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. nit style
Suggested change
|
||||||||||||
|
|
||||||||||||
| const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth; | ||||||||||||
|
|
||||||||||||
| if (shouldShowBlockingView) { | ||||||||||||
|
Comment on lines
+35
to
+37
Contributor
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.
Suggested change
|
||||||||||||
| return ( | ||||||||||||
| <View style={[styles.blockingViewContainer, styles.flex1]}> | ||||||||||||
| <BlockingView | ||||||||||||
| icon={Illustrations.EmptyStateBiggerScreen} | ||||||||||||
| iconWidth={variables.modalTopIconWidth} | ||||||||||||
| iconHeight={variables.modalTopIconHeight} | ||||||||||||
| title={translate('mobilePlacerHolder.title')} | ||||||||||||
| subtitle={translate('mobilePlacerHolder.subTitle')} | ||||||||||||
| linkKey={translate('mobilePlacerHolder.goBackHome')} | ||||||||||||
| shouldShowLink | ||||||||||||
| onLinkPress={onLinkPress} | ||||||||||||
|
Contributor
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.
Suggested change
|
||||||||||||
| /> | ||||||||||||
| </View> | ||||||||||||
| ); | ||||||||||||
| } | ||||||||||||
| return children; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| LargeDisplayWrapper.displayName = 'LargeDisplayWrapper'; | ||||||||||||
| LargeDisplayWrapper.propTypes = propTypes; | ||||||||||||
| LargeDisplayWrapper.defaultProps = defaultProps; | ||||||||||||
|
|
||||||||||||
| export default LargeDisplayWrapper; | ||||||||||||
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