Skip to content

Commit

Permalink
Merge pull request #6090 from Expensify/OSBotify-cherry-pick-staging-…
Browse files Browse the repository at this point in the history
…6086
  • Loading branch information
OSBotify authored Oct 27, 2021
2 parents b785d6d + b1cf4ef commit 30a8ad6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 29 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 1001011000
versionName "1.1.10-0"
versionCode 1001011001
versionName "1.1.10-1"
}
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 @@ -31,7 +31,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.10.0</string>
<string>1.1.10.1</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.1.10.0</string>
<string>1.1.10.1</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.1.10-0",
"version": "1.1.10-1",
"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
23 changes: 2 additions & 21 deletions src/components/ButtonWithMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import _ from 'underscore';
import {withOnyx} from 'react-native-onyx';
import styles from '../styles/styles';
import Button from './Button';
import ButtonWithDropdown from './ButtonWithDropdown';
import PopoverMenu from './PopoverMenu';
import ONYXKEYS from '../ONYXKEYS';
import CONST from '../CONST';
import userWalletPropTypes from '../pages/EnablePayments/userWalletPropTypes';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';

const propTypes = {
/** Text to display for the menu header */
Expand All @@ -30,17 +24,14 @@ const propTypes = {
isDisabled: PropTypes.bool,

/** Menu options to display */
/** [{text: 'Pay with Expensify', icon: Wallet}, {text: 'PayPal', icon: PayPal}, {text: 'Venmo', icon: Venmo}] */
/** e.g. [{text: 'Pay with Expensify', icon: Wallet}, {text: 'PayPal', icon: PayPal}, {text: 'Venmo', icon: Venmo}] */
options: PropTypes.arrayOf(PropTypes.shape({
text: PropTypes.string.isRequired,
icon: PropTypes.elementType,
iconWidth: PropTypes.number,
iconHeight: PropTypes.number,
iconDescription: PropTypes.string,
})).isRequired,

/** The user's current wallet status and step */
userWallet: userWalletPropTypes.isRequired,
};

const defaultProps = {
Expand All @@ -60,12 +51,6 @@ class ButtonWithMenu extends PureComponent {
};
}

componentDidMount() {
if (!this.props.userWallet.tierName || this.props.userWallet.tierName === CONST.WALLET.TIER_NAME.SILVER) {
Navigation.navigate(ROUTES.IOU_ENABLE_PAYMENTS);
}
}

setMenuVisibility(isMenuVisible) {
this.setState({isMenuVisible});
}
Expand Down Expand Up @@ -120,8 +105,4 @@ class ButtonWithMenu extends PureComponent {
ButtonWithMenu.propTypes = propTypes;
ButtonWithMenu.defaultProps = defaultProps;

export default withOnyx({
userWallet: {
key: ONYXKEYS.USER_WALLET,
},
})(ButtonWithMenu);
export default ButtonWithMenu;
21 changes: 19 additions & 2 deletions src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import Tooltip from '../../components/Tooltip';
import CONST from '../../CONST';
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView';
import * as PersonalDetails from '../../libs/actions/PersonalDetails';
import userWalletPropTypes from '../EnablePayments/userWalletPropTypes';
import ROUTES from '../../ROUTES';

/**
* IOU modal for requesting money and splitting bills.
Expand Down Expand Up @@ -77,6 +79,9 @@ const propTypes = {
avatar: PropTypes.string,
}).isRequired,

/** The user's current wallet status and step */
userWallet: userWalletPropTypes.userWallet,

...withLocalizePropTypes,
};

Expand All @@ -89,6 +94,7 @@ const defaultProps = {
localCurrencyCode: CONST.CURRENCY.USD,
},
iouType: CONST.IOU.IOU_TYPE.REQUEST,
userWallet: {},
};

// Determines type of step to display within Modal, value provides the title for that page.
Expand Down Expand Up @@ -116,6 +122,8 @@ class IOUModal extends Component {
payPalMeAddress: lodashGet(personalDetails, 'payPalMeAddress', ''),
phoneNumber: lodashGet(personalDetails, 'phoneNumber', ''),
}));
this.isSendRequest = props.iouType === CONST.IOU.IOU_TYPE.SEND;
this.hasGoldWallet = props.userWallet.tierName && props.userWallet.tiername === CONST.WALLET.TIER_NAME.GOLD;

this.state = {
currentStepIndex: 0,
Expand Down Expand Up @@ -173,7 +181,7 @@ class IOUModal extends Component {
currency: this.props.iou.selectedCurrencyCode,
},
);
if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) {
if (this.isSendRequest) {
return this.props.translate('iou.send', {
amount: formattedAmount,
});
Expand All @@ -185,7 +193,7 @@ class IOUModal extends Component {
);
}
if (currentStepIndex === 0) {
if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) {
if (this.isSendRequest) {
return this.props.translate('iou.sendMoney');
}
return this.props.translate(this.props.hasMultipleParticipants ? 'iou.splitBill' : 'iou.requestMoney');
Expand Down Expand Up @@ -241,6 +249,12 @@ class IOUModal extends Component {
createTransaction(splits) {
const reportID = lodashGet(this.props, 'route.params.reportID', '');

// If the user is trying to send money, then they need to upgrade to a GOLD wallet
if (this.isSendRequest && !this.hasGoldWallet) {
Navigation.navigate(ROUTES.IOU_ENABLE_PAYMENTS);
return;
}

// Only splits from a group DM has a reportID
// Check if reportID is a number
if (splits && CONST.REGEX.NUMBER.test(reportID)) {
Expand Down Expand Up @@ -390,5 +404,8 @@ export default compose(
myPersonalDetails: {
key: ONYXKEYS.MY_PERSONAL_DETAILS,
},
userWallet: {
key: ONYXKEYS.USER_WALLET,
},
}),
)(IOUModal);

0 comments on commit 30a8ad6

Please sign in to comment.