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

Update Lounge Access page #30473

Merged
merged 9 commits into from
Oct 31, 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
7 changes: 2 additions & 5 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,8 @@ export default {
},
loungeAccessPage: {
loungeAccess: 'Lounge access',
headline: 'You qualify for access to our exclusive lounges.',
description: 'The Expensify Lounge is where a "high-end airport lounge" meets a vibrant "co-working space" optimized for like-minded individuals.',
coffeePromo: 'Great coffee and cocktails',
networkingPromo: 'Network with other members',
viewsPromo: 'Incredible views of San Francisco',
headline: 'The Expensify Lounge is closed.',
description: "The Expensify Lounge in San Francisco is closed for the time being, but we'll update this page when it reopens!",
},
pronounsPage: {
pronouns: 'Pronouns',
Expand Down
8 changes: 2 additions & 6 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,8 @@ export default {
},
loungeAccessPage: {
loungeAccess: 'Acceso a la sala vip',
headline: 'Podrás acceder a nuestras salas vip exclusivas.',
description:
'La sala vip Expensify es el punto de encuentro entre una "sala vip de aeropuerto de alta gama" y un vibrante "espacio de co-working" optimizado para personas con ideas afines.',
coffeePromo: 'Buen café y buenos cócteles',
networkingPromo: 'Conecta con otros miembros',
viewsPromo: 'Increíbles vistas de San Francisco',
headline: 'La sala vip de Expensify está cerrada.',
description: 'La sala vip de Expensify está actualmente cerrada, pero actualizaremos esta página cuando vuelva a abrir.',
},
pronounsPage: {
pronouns: 'Pronombres',
Expand Down
76 changes: 7 additions & 69 deletions src/pages/settings/Profile/LoungeAccessPage.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,50 @@
import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import Avatar from '@components/Avatar';
import FeatureList from '@components/FeatureList';
import * as Illustrations from '@components/Icon/Illustrations';
import IllustratedHeaderPageLayout from '@components/IllustratedHeaderPageLayout';
import LinearGradient from '@components/LinearGradient';
import * as LottieAnimations from '@components/LottieAnimations';
import Text from '@components/Text';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import compose from '@libs/compose';
import * as LocalePhoneNumber from '@libs/LocalePhoneNumber';
import Navigation from '@libs/Navigation/Navigation';
import * as UserUtils from '@libs/UserUtils';
import NotFoundPage from '@pages/ErrorPage/NotFoundPage';
import userPropTypes from '@pages/settings/userPropTypes';
import styles from '@styles/styles';
import themeColors from '@styles/themes/default';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';

const propTypes = {
/** The session of the logged in person */
session: PropTypes.shape({
/** Email of the logged in person */
email: PropTypes.string,
}),

/** Current user details, which will hold whether or not they have Lounge Access */
user: userPropTypes,

...withCurrentUserPersonalDetailsPropTypes,
};

const defaultProps = {
session: {},
user: {},
...withCurrentUserPersonalDetailsDefaultProps,
};

const menuItems = [
{
translationKey: 'loungeAccessPage.coffeePromo',
icon: Illustrations.CoffeeMug,
},
{
translationKey: 'loungeAccessPage.networkingPromo',
icon: Illustrations.ChatBubbles,
},
{
translationKey: 'loungeAccessPage.viewsPromo',
icon: Illustrations.SanFrancisco,
},
];

function LoungeAccessPage(props) {
const {translate} = useLocalize();

if (!props.user.hasLoungeAccess) {
return <NotFoundPage />;
}

const overlayContent = () => (
<LinearGradient
colors={[`${themeColors.loungeAccessOverlay}00`, themeColors.loungeAccessOverlay]}
style={[styles.pAbsolute, styles.w100, styles.h100]}
>
<View style={[styles.flex1, styles.justifyContentCenter, styles.alignItemsCenter, styles.pt5, styles.ph5]}>
<Avatar
imageStyles={[styles.avatarLarge]}
source={UserUtils.getAvatar(props.currentUserPersonalDetails.avatar, props.session.accountID)}
size={CONST.AVATAR_SIZE.LARGE}
fallbackIcon={props.currentUserPersonalDetails.fallbackIcon}
/>
<Text
style={[styles.textHeadline, styles.pre, styles.mt2]}
numberOfLines={1}
>
{props.currentUserPersonalDetails.displayName ? props.currentUserPersonalDetails.displayName : LocalePhoneNumber.formatPhoneNumber(props.session.email)}
</Text>
<Text
style={[styles.textLabelSupporting, styles.mt1]}
numberOfLines={1}
>
{LocalePhoneNumber.formatPhoneNumber(props.session.email)}
</Text>
</View>
</LinearGradient>
);

return (
<IllustratedHeaderPageLayout
title={translate('loungeAccessPage.loungeAccess')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS)}
illustration={LottieAnimations.ExpensifyLounge}
overlayContent={overlayContent}
>
<FeatureList
headline="loungeAccessPage.headline"
description="loungeAccessPage.description"
menuItems={menuItems}
/>
<Text
style={[styles.flex1, styles.ph5, styles.textHeadline, styles.preWrap, styles.mb2]}
numberOfLines={1}
>
{translate('loungeAccessPage.headline')}
</Text>
<Text style={[styles.flex1, styles.ph5, styles.baseFontStyle]}>{translate('loungeAccessPage.description')}</Text>
</IllustratedHeaderPageLayout>
);
}
Expand All @@ -115,9 +56,6 @@ LoungeAccessPage.displayName = 'LoungeAccessPage';
export default compose(
withCurrentUserPersonalDetails,
withOnyx({
session: {
key: ONYXKEYS.SESSION,
},
user: {
key: ONYXKEYS.USER,
},
Expand Down
Loading