Skip to content
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

Render app behind alert #16383

Merged
merged 3 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 9 additions & 61 deletions src/components/DeeplinkWrapper/index.website.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import _ from 'underscore';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import React, {PureComponent} from 'react';
import {withOnyx} from 'react-native-onyx';
import deeplinkRoutes from './deeplinkRoutes';
import FullScreenLoadingIndicator from '../FullscreenLoadingIndicator';
import TextLink from '../TextLink';
import * as Illustrations from '../Icon/Illustrations';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import Text from '../Text';
import styles from '../../styles/styles';
import compose from '../../libs/compose';
import CONST from '../../CONST';
import CONFIG from '../../CONFIG';
import Icon from '../Icon';
import * as Expensicons from '../Icon/Expensicons';
import colors from '../../styles/colors';
import * as Browser from '../../libs/Browser';
import ONYXKEYS from '../../ONYXKEYS';

const propTypes = {
/** Children to render. */
children: PropTypes.node.isRequired,

...withLocalizePropTypes,
/** Beta features list */
betas: PropTypes.arrayOf(PropTypes.string),
};
const defaultProps = {
betas: [],
};

class DeeplinkWrapper extends PureComponent {
Expand Down Expand Up @@ -65,10 +60,7 @@ class DeeplinkWrapper extends PureComponent {
});

if (matchedRoute) {
this.setState({deeplinkMatch: true});
this.openRouteInDesktopApp();
} else {
this.setState({deeplinkMatch: false});
}
}

Expand Down Expand Up @@ -115,56 +107,12 @@ class DeeplinkWrapper extends PureComponent {
return <FullScreenLoadingIndicator style={styles.flex1} />;
}

if (
this.state.deeplinkMatch
&& this.state.appInstallationCheckStatus === CONST.DESKTOP_DEEPLINK_APP_STATE.INSTALLED
) {
return (
<View style={styles.deeplinkWrapperContainer}>
<View style={styles.deeplinkWrapperMessage}>
<View style={styles.mb2}>
<Icon
width={200}
height={164}
src={Illustrations.RocketBlue}
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge]}>
{this.props.translate('deeplinkWrapper.launching')}
</Text>
<View style={styles.mt2}>
<Text style={[styles.fontSizeNormal, styles.textAlignCenter]}>
{this.props.translate('deeplinkWrapper.redirectedToDesktopApp')}
{'\n'}
{this.props.translate('deeplinkWrapper.youCanAlso')}
{' '}
<TextLink onPress={() => this.setState({deeplinkMatch: false})}>
{this.props.translate('deeplinkWrapper.openLinkInBrowser')}
</TextLink>
.
</Text>
</View>
</View>
<View style={styles.deeplinkWrapperFooter}>
<Icon
width={154}
height={34}
fill={colors.green}
src={Expensicons.ExpensifyWordmark}
/>
</View>
</View>
);
}

return this.props.children;
}
}

DeeplinkWrapper.propTypes = propTypes;
export default compose(
withLocalize,
withOnyx({
betas: {key: ONYXKEYS.BETAS},
}),
)(DeeplinkWrapper);
DeeplinkWrapper.defaultProps = defaultProps;
export default withOnyx({
betas: {key: ONYXKEYS.BETAS},
})(DeeplinkWrapper);
6 changes: 0 additions & 6 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ export default {
updateApp: 'Update app',
updatePrompt: 'A new version of this app is available.\nUpdate now or restart the app at a later time to download the latest changes.',
},
deeplinkWrapper: {
launching: 'Launching Expensify',
redirectedToDesktopApp: 'We\'ve redirected you to the desktop app.',
youCanAlso: 'You can also',
openLinkInBrowser: 'open this link in your browser',
},
validateCodeModal: {
successfulSignInTitle: 'Abracadabra,\nyou are signed in!',
successfulSignInDescription: 'Head back to your original tab to continue.',
Expand Down
6 changes: 0 additions & 6 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ export default {
updateApp: 'Actualizar app',
updatePrompt: 'Existe una nueva versión de esta aplicación.\nActualiza ahora or reinicia la aplicación más tarde para recibir la última versión.',
},
deeplinkWrapper: {
launching: 'Cargando Expensify',
redirectedToDesktopApp: 'Te hemos redirigido a la aplicación de escritorio.',
youCanAlso: 'También puedes',
openLinkInBrowser: 'abrir este enlace en tu navegador',
},
validateCodeModal: {
successfulSignInTitle: 'Abracadabra,\n¡sesión iniciada!',
successfulSignInDescription: 'Vuelve a la pestaña original para continuar.',
Expand Down