-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #6856 from mananjadhav/feat/error-page
- Loading branch information
Showing
10 changed files
with
168 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => null; |
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,23 @@ | ||
import React from 'react'; | ||
import Text from '../../../components/Text'; | ||
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; | ||
import TextLink from '../../../components/TextLink'; | ||
import CONST from '../../../CONST'; | ||
import styles from '../../../styles/styles'; | ||
|
||
const propTypes = { | ||
...withLocalizePropTypes, | ||
}; | ||
|
||
const ErrorBodyText = props => ( | ||
<Text> | ||
{`${props.translate('genericErrorPage.body.helpTextMobile')} `} | ||
<TextLink href={CONST.NEW_EXPENSIFY_URL} style={[styles.link]}> | ||
{props.translate('genericErrorPage.body.helpTextWeb')} | ||
</TextLink> | ||
</Text> | ||
); | ||
|
||
ErrorBodyText.displayName = 'ErrorBodyText'; | ||
ErrorBodyText.propTypes = propTypes; | ||
export default withLocalize(ErrorBodyText); |
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,83 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {View} from 'react-native'; | ||
import Icon from '../../components/Icon'; | ||
import defaultTheme from '../../styles/themes/default'; | ||
import * as Expensicons from '../../components/Icon/Expensicons'; | ||
import Text from '../../components/Text'; | ||
import Button from '../../components/Button'; | ||
import LogoWordmark from '../../../assets/images/expensify-wordmark.svg'; | ||
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; | ||
import * as Session from '../../libs/actions/Session'; | ||
import variables from '../../styles/variables'; | ||
import styles from '../../styles/styles'; | ||
import ErrorBodyText from './ErrorBodyText'; | ||
import TextLink from '../../components/TextLink'; | ||
import CONST from '../../CONST'; | ||
|
||
const propTypes = { | ||
...withLocalizePropTypes, | ||
|
||
/** Callback to call on refresh button click */ | ||
onRefresh: PropTypes.func.isRequired, | ||
}; | ||
|
||
const GenericErrorPage = props => ( | ||
<View style={[styles.flex1, styles.pv10, styles.ph5, styles.errorPageContainer]}> | ||
<View style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]}> | ||
<View style={styles.alignItemsStart}> | ||
<View style={styles.mb5}> | ||
<Icon | ||
src={Expensicons.Bug} | ||
height={variables.componentSizeNormal} | ||
width={variables.componentSizeNormal} | ||
fill={defaultTheme.iconSuccessFill} | ||
/> | ||
</View> | ||
<View style={styles.mb5}> | ||
<Text style={[styles.headerText, styles.textXXLarge]}> | ||
{props.translate('genericErrorPage.title')} | ||
</Text> | ||
</View> | ||
<View style={styles.mb5}> | ||
<ErrorBodyText /> | ||
<Text> | ||
{`${props.translate('genericErrorPage.body.helpTextConcierge')} `} | ||
<TextLink href={`mailto:${CONST.EMAIL.CONCIERGE}`} style={[styles.link]}> | ||
{CONST.EMAIL.CONCIERGE} | ||
</TextLink> | ||
</Text> | ||
</View> | ||
<View style={[styles.dFlex, styles.flexRow, styles.w100]}> | ||
<View style={[styles.flex1, styles.flexRow]}> | ||
<Button | ||
success | ||
medium | ||
onPress={props.onRefresh} | ||
text={props.translate('genericErrorPage.refresh')} | ||
style={styles.mr3} | ||
/> | ||
<Button | ||
medium | ||
onPress={() => { | ||
Session.signOut(); | ||
props.onRefresh(); | ||
}} | ||
text={props.translate('initialSettingsPage.signOut')} | ||
/> | ||
</View> | ||
</View> | ||
</View> | ||
</View> | ||
<View styles={styles.alignSelfEnd}> | ||
<View style={[styles.flex1, styles.flexRow, styles.justifyContentCenter]}> | ||
<LogoWordmark height={30} width={80} /> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
|
||
GenericErrorPage.propTypes = propTypes; | ||
GenericErrorPage.displayName = 'GenericErrorPage'; | ||
|
||
export default withLocalize(GenericErrorPage); |
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