Skip to content

Commit

Permalink
Merge pull request #4970 from Expensify/OSBotify-cherry-pick-staging-…
Browse files Browse the repository at this point in the history
…4967
  • Loading branch information
OSBotify authored Sep 1, 2021
2 parents b27879d + 1d2315f commit 7feb0d0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 44 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001009001
versionName "1.0.90-1"
versionCode 1001009002
versionName "1.0.90-2"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.90.1</string>
<string>1.0.90.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.90.1</string>
<string>1.0.90.2</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.0.90-1",
"version": "1.0.90-2",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
1 change: 0 additions & 1 deletion src/CONST.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 14 additions & 28 deletions src/components/LocalePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {setLocale} from '../libs/actions/App';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import ONYXKEYS from '../ONYXKEYS';
import CONST from '../CONST';
import Permissions from '../libs/Permissions';
import {translate} from '../libs/translate';
import ExpensiPicker from './ExpensiPicker';

Expand All @@ -17,16 +16,12 @@ const propTypes = {
/** Indicates size of a picker component and whether to render the label or not */
size: PropTypes.oneOf(['normal', 'small']),

/** Beta features list */
betas: PropTypes.arrayOf(PropTypes.string),

...withLocalizePropTypes,
};

const defaultProps = {
preferredLocale: CONST.DEFAULT_LOCALE,
size: 'normal',
betas: [],
};

const localesToLanguages = {
Expand All @@ -42,26 +37,20 @@ const localesToLanguages = {

const LocalePicker = ({
// eslint-disable-next-line no-shadow
preferredLocale, translate, betas, size,
}) => {
if (!Permissions.canUseInternationalization(betas)) {
return null;
}

return (
<ExpensiPicker
label={size === 'normal' ? translate('preferencesPage.language') : null}
onChange={(locale) => {
if (locale !== preferredLocale) {
setLocale(locale);
}
}}
items={Object.values(localesToLanguages)}
size={size}
value={preferredLocale}
/>
);
};
preferredLocale, translate, size,
}) => (
<ExpensiPicker
label={size === 'normal' ? translate('preferencesPage.language') : null}
onChange={(locale) => {
if (locale !== preferredLocale) {
setLocale(locale);
}
}}
items={Object.values(localesToLanguages)}
size={size}
value={preferredLocale}
/>
);

LocalePicker.defaultProps = defaultProps;
LocalePicker.propTypes = propTypes;
Expand All @@ -73,8 +62,5 @@ export default compose(
preferredLocale: {
key: ONYXKEYS.NVP_PREFERRED_LOCALE,
},
betas: {
key: ONYXKEYS.BETAS,
},
}),
)(LocalePicker);
9 changes: 0 additions & 9 deletions src/libs/Permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,10 @@ function canUseDefaultRooms(betas) {
return _.contains(betas, CONST.BETAS.DEFAULT_ROOMS) || canUseAllBetas(betas);
}

/**
* @param {Array<String>} betas
* @returns {Boolean}
*/
function canUseInternationalization(betas) {
return _.contains(betas, CONST.BETAS.INTERNATIONALIZATION) || canUseAllBetas(betas);
}

export default {
canUseChronos,
canUseIOU,
canUsePayWithExpensify,
canUseFreePlan,
canUseDefaultRooms,
canUseInternationalization,
};

0 comments on commit 7feb0d0

Please sign in to comment.