forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#9165 from Expensify/luke-full-page-offli…
…ne-view
- Loading branch information
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {View} from 'react-native'; | ||
import Icon from './Icon'; | ||
import networkPropTypes from './networkPropTypes'; | ||
import {withNetwork} from './OnyxProvider'; | ||
import Text from './Text'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import themeColors from '../styles/themes/default'; | ||
import styles from '../styles/styles'; | ||
import compose from '../libs/compose'; | ||
|
||
const propTypes = { | ||
/** Child elements */ | ||
children: PropTypes.node.isRequired, | ||
|
||
/** Props to fetch translation features */ | ||
...withLocalizePropTypes, | ||
|
||
/** Props to detect online status */ | ||
network: networkPropTypes.isRequired, | ||
}; | ||
|
||
const FullPageOfflineBlockingView = (props) => { | ||
if (props.network.isOffline) { | ||
return ( | ||
<View | ||
style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]} | ||
> | ||
<Icon | ||
src={Expensicons.OfflineCloud} | ||
fill={themeColors.offline} | ||
width={50} | ||
height={50} | ||
/> | ||
<Text style={[styles.h1]}>{props.translate('common.youAppearToBeOffline')}</Text> | ||
<Text style={[styles.w70, styles.textAlignCenter]}>{props.translate('common.thisFeatureRequiresInternet')}</Text> | ||
</View> | ||
); | ||
} | ||
|
||
return props.children; | ||
}; | ||
|
||
FullPageOfflineBlockingView.propTypes = propTypes; | ||
FullPageOfflineBlockingView.displayName = 'FullPageOfflineBlockingView'; | ||
|
||
export default compose( | ||
withLocalize, | ||
withNetwork(), | ||
)(FullPageOfflineBlockingView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters