Skip to content
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
2 changes: 2 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ const CONST = {
PLATFORM: {
IOS: 'ios',
ANDROID: 'android',
WEB: 'web',
DESKTOP: 'desktop',
},
KEYBOARD_SHORTCUT_MODIFIERS: {
CTRL: {
Expand Down
4 changes: 3 additions & 1 deletion src/libs/getPlatform/index.desktop.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import CONST from '../../CONST';

export default function getPlatform() {
return 'desktop';
return CONST.PLATFORM.DESKTOP;
}
4 changes: 3 additions & 1 deletion src/libs/getPlatform/index.website.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import CONST from '../../CONST';

export default function getPlatform() {
return 'web';
return CONST.PLATFORM.WEB;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as KeyboardShortcuts from '../../../../libs/actions/KeyboardShortcuts';
import * as Expensicons from '../../../../components/Icon/Expensicons';

export default (isSmallScreenWidth) => {
if (isSmallScreenWidth) {
return [];
}
return [
{
translationKey: 'initialSettingsPage.aboutPage.viewKeyboardShortcuts',
icon: Expensicons.Keyboard,
action: KeyboardShortcuts.showKeyboardShortcutModal,
},
];
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => [];
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import _ from 'underscore';
import React from 'react';
import {View, ScrollView} from 'react-native';
import HeaderWithCloseButton from '../../components/HeaderWithCloseButton';
import Navigation from '../../libs/Navigation/Navigation';
import * as KeyboardShortcuts from '../../libs/actions/KeyboardShortcuts';
import ROUTES from '../../ROUTES';
import styles from '../../styles/styles';
import ExpensifyText from '../../components/ExpensifyText';
import CONST from '../../CONST';
import * as Expensicons from '../../components/Icon/Expensicons';
import ScreenWrapper from '../../components/ScreenWrapper';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import MenuItem from '../../components/MenuItem';
import Logo from '../../../assets/images/new-expensify.svg';
import {version} from '../../../package.json';
import * as Report from '../../libs/actions/Report';
import * as Link from '../../libs/actions/Link';
import HeaderWithCloseButton from '../../../components/HeaderWithCloseButton';
import Navigation from '../../../libs/Navigation/Navigation';
import ROUTES from '../../../ROUTES';
import styles from '../../../styles/styles';
import ExpensifyText from '../../../components/ExpensifyText';
import CONST from '../../../CONST';
import * as Expensicons from '../../../components/Icon/Expensicons';
import ScreenWrapper from '../../../components/ScreenWrapper';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import MenuItem from '../../../components/MenuItem';
import Logo from '../../../../assets/images/new-expensify.svg';
import {version} from '../../../../package.json';
import * as Report from '../../../libs/actions/Report';
import * as Link from '../../../libs/actions/Link';
import getPlatformSpecificMenuItems from './getPlatformSpecificMenuItems';
import compose from '../../../libs/compose';

const propTypes = {
...withLocalizePropTypes,
...windowDimensionsPropTypes,
};

const AboutPage = (props) => {
const platformSpecificMenuItems = getPlatformSpecificMenuItems(props.isSmallScreenWidth);

const menuItems = [
{
translationKey: 'initialSettingsPage.aboutPage.appDownloadLinks',
Expand All @@ -30,11 +35,7 @@ const AboutPage = (props) => {
Navigation.navigate(ROUTES.SETTINGS_APP_DOWNLOAD_LINKS);
},
},
{
translationKey: 'initialSettingsPage.aboutPage.viewKeyboardShortcuts',
icon: Expensicons.Keyboard,
action: KeyboardShortcuts.showKeyboardShortcutModal,
},
...platformSpecificMenuItems,
{
translationKey: 'initialSettingsPage.aboutPage.viewTheCode',
icon: Expensicons.Eye,
Expand Down Expand Up @@ -146,4 +147,7 @@ const AboutPage = (props) => {
AboutPage.propTypes = propTypes;
AboutPage.displayName = 'AboutPage';

export default withLocalize(AboutPage);
export default compose(
withLocalize,
withWindowDimensions,
)(AboutPage);