Skip to content
Closed
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ const CONST = {

AVATAR_MAX_ATTACHMENT_SIZE: 6291456,

EMPTY_STATE_DESKTOP_IMAGE_DIMENSIONS: {
HEIGHT: 400,
WIDTH: '100%',
},

AVATAR_ALLOWED_EXTENSIONS: ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg'],

// Minimum width and height size in px for a selected image
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import MoneyBadge from '../../../assets/images/simple-illustrations/simple-illus
import TreasureChest from '../../../assets/images/simple-illustrations/simple-illustration__treasurechest.svg';
import ThumbsUpStars from '../../../assets/images/simple-illustrations/simple-illustration__thumbsupstars.svg';
import Hands from '../../../assets/images/product-illustrations/home-illustration-hands.svg';
import EmptyStateBiggerScreen from '../../../assets/images/product-illustrations/empty-state__biggerscreen.svg';
import HandEarth from '../../../assets/images/simple-illustrations/simple-illustration__handearth.svg';

export {
Expand Down Expand Up @@ -95,5 +96,6 @@ export {
TreasureChest,
ThumbsUpStars,
Hands,
EmptyStateBiggerScreen,
HandEarth,
};
60 changes: 60 additions & 0 deletions src/components/LargeDisplayWrapper/LargeDisplayWrapper.js
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,
Comment on lines +16 to +18
Copy link
Copy Markdown
Contributor

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

Suggested change
/** 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep is simple as possible. Cc: @hayata-suenaga

Suggested change
/** Action to run when clicked on a the link text */
onLinkPress: PropTypes.func,

};

const defaultProps = {
children: null,
shouldBlockContent: undefined,
onLinkPress: () => Navigation.goBack(),
Comment on lines +26 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shouldBlockContent: undefined,
onLinkPress: () => Navigation.goBack(),

};

function LargeDisplayWrapper({onLinkPress, children, shouldBlockContent}) {
const {isSmallScreenWidth} = useWindowDimensions();

const {translate} = useLocalize();
Comment on lines +31 to +33
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit style

Suggested change
const {isSmallScreenWidth} = useWindowDimensions();
const {translate} = useLocalize();
const {translate} = useLocalize();
const {isSmallScreenWidth} = useWindowDimensions();


const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth;

if (shouldShowBlockingView) {
Comment on lines +35 to +37
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const shouldShowBlockingView = _.isBoolean(shouldBlockContent) ? shouldBlockContent : isSmallScreenWidth;
if (shouldShowBlockingView) {
if (isSmallScreenWidth) {

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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onLinkPress={onLinkPress}
onLinkPress={Navigation.goBack}

/>
</View>
);
}
return children;
}

LargeDisplayWrapper.displayName = 'LargeDisplayWrapper';
LargeDisplayWrapper.propTypes = propTypes;
LargeDisplayWrapper.defaultProps = defaultProps;

export default LargeDisplayWrapper;
5 changes: 5 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,11 @@ export default {
noAccess: "You don't have access to this chat",
goBackHome: 'Go back to home page',
},
mobilePlacerHolder: {
goBackHome: 'Go back home',
title: "You're gonna need a bigger screen",
subTitle: 'This page is only available on wider browsers, like your laptop or desktop computer. Please try again over there.',
},
setPasswordPage: {
enterPassword: 'Enter a password',
setPassword: 'Set password',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,11 @@ export default {
noAccess: 'No tienes acceso a este chat',
goBackHome: 'Volver a la página principal',
},
mobilePlacerHolder: {
goBackHome: 'Volver a la página principal',
title: 'Vas a necesitar una pantalla más grande',
subTitle: 'Esta página sólo está disponible en navegadores más amplios, como su ordenador portátil o de sobremesa. Inténtalo de nuevo desde allí.',
},
setPasswordPage: {
enterPassword: 'Escribe una contraseña',
setPassword: 'Configura tu contraseña',
Expand Down