Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/Expensify.cash into conte…
Browse files Browse the repository at this point in the history
…xt-menu
  • Loading branch information
parasharrajat committed Jun 17, 2021
2 parents ad85638 + fedf555 commit a393b3a
Show file tree
Hide file tree
Showing 40 changed files with 572 additions and 106 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001006900
versionName "1.0.69-0"
versionCode 1001007000
versionName "1.0.70-0"
}
splits {
abi {
Expand Down
9 changes: 7 additions & 2 deletions assets/images/bank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions assets/images/paycheck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/ExpensifyCash/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.69</string>
<string>1.0.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.69.0</string>
<string>1.0.70.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/ExpensifyCashTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.69</string>
<string>1.0.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.69.0</string>
<string>1.0.70.0</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": "expensify.cash",
"version": "1.0.69-0",
"version": "1.0.70-0",
"author": "Expensify, Inc.",
"homepage": "https://expensify.cash",
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
8 changes: 8 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ const CONST = {
SWIFT_BIC: /^[A-Za-z0-9]{8,11}$/,
},
},
INCORPORATION_TYPES: {
LLC: 'LLC',
CORPORATION: 'Corp',
PARTNERSHIP: 'Partnership',
COOPERATIVE: 'Cooperative',
SOLE_PROPRIETORSHIP: 'Sole Proprietorship',
OTHER: 'Other',
},
BETAS: {
ALL: 'all',
CHRONOS_IN_CASH: 'chronosInCash',
Expand Down
7 changes: 1 addition & 6 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {View, AppState} from 'react-native';
import Onyx, {withOnyx} from 'react-native-onyx';

import BootSplash from './libs/BootSplash';
import StatusBar from './libs/StatusBar';
import listenToStorageEvents from './libs/listenToStorageEvents';
import * as ActiveClientManager from './libs/ActiveClientManager';
import ONYXKEYS from './ONYXKEYS';
Expand Down Expand Up @@ -152,11 +151,7 @@ class Expensify extends PureComponent {
}

hideSplash() {
BootSplash.hide({fade: true}).then(() => {
// To prevent the splash from shifting positions we set status bar translucent after splash is hidden.
// on IOS it has no effect.
StatusBar.setTranslucent(true);
});
BootSplash.hide({fade: true});
}

render() {
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export default {
// Indicates which locale should be used
PREFERRED_LOCALE: 'preferredLocale',

// List of transactionIDs in process of rejection
TRANSACTIONS_BEING_REJECTED: 'transactionsBeingRejected',

// User's Expensify Wallet
USER_WALLET: 'userWallet',

Expand Down
4 changes: 2 additions & 2 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {addTrailingForwardSlash} from './libs/Url';
const REPORT = 'r';

export default {
ADD_PERSONAL_BANK_ACCOUNT: 'add-personal-bank-account',
ADD_VERIFIED_BANK_ACCOUNT: 'add-verified-bank-account',
BANK_ACCOUNT: 'bank-account/:stepToOpen?',
BANK_ACCOUNT_PERSONAL: 'bank-account/personal',
HOME: '',
SETTINGS: 'settings',
SETTINGS_PROFILE: 'settings/profile',
Expand Down
3 changes: 0 additions & 3 deletions src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import compose from '../libs/compose';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import Button from './Button';
import Picker from './Picker';
import Icon from './Icon';
import {DownArrow} from './Icon/Expensicons';
import Text from './Text';

const propTypes = {
Expand Down Expand Up @@ -149,7 +147,6 @@ class AddPlaidBankAccount extends React.Component {
label: this.props.translate('bankAccount.chooseAnAccount'),
} : {}}
value={this.state.selectedIndex}
icon={() => <Icon src={DownArrow} />}
/>
</View>
{!_.isUndefined(this.state.selectedIndex) && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/CheckboxWithLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const defaultProps = {
const CheckboxWithLabel = ({
LabelComponent, isChecked, onPress, style,
}) => {
const defaultStyles = [styles.flexRow];
const defaultStyles = [styles.flexRow, styles.alignItemsCenter];
const wrapperStyles = _.isArray(style) ? [...defaultStyles, ...style] : [...defaultStyles, style];
return (
<View style={wrapperStyles}>
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion src/components/Picker/PickerPropTypes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Icon from '../Icon';
import {DownArrow} from '../Icon/Expensicons';

const propTypes = {
/** A callback method that is called when the value changes and it received the selected value as an argument */
Expand Down Expand Up @@ -32,13 +35,14 @@ const propTypes = {
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),

/** An icon to display with the picker */
icon: PropTypes.func.isRequired,
icon: PropTypes.func,
};
const defaultProps = {
useDisabledStyles: false,
disabled: false,
placeholder: {},
value: null,
icon: () => <Icon src={DownArrow} />,
};

export {
Expand Down
53 changes: 50 additions & 3 deletions src/components/ReportTransaction.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Text, View, Pressable} from 'react-native';
import lodashGet from 'lodash/get';
import {
Text, View, Pressable, ActivityIndicator,
} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import ONYXKEYS from '../ONYXKEYS';
import styles from '../styles/styles';
import themeColors from '../styles/themes/default';
import {rejectTransaction} from '../libs/actions/IOU';
import ReportActionPropTypes from '../pages/home/report/ReportActionPropTypes';
import ReportActionItemSingle from '../pages/home/report/ReportActionItemSingle';
Expand All @@ -23,6 +30,15 @@ const propTypes = {

/** Text label for the reject transaction button */
rejectButtonLabelText: PropTypes.string.isRequired,

/* Onyx Props */

/** List of transactionIDs in process of rejection */
/* eslint-disable-next-line react/no-unused-prop-types, react/require-default-props */
transactionsBeingRejected: PropTypes.shape({
/** IOUTransactionID that's being rejected */
transactionID: PropTypes.bool,
}),
};

const defaultProps = {
Expand All @@ -45,6 +61,19 @@ class ReportTransaction extends Component {
});
}

/**
* Checks if current IOUTransactionID is being rejected.
* @returns {boolean} Returns `true` if current IOUtransactionID is being rejected, else `false`.
*/
isBeingRejected() {
const IOUTransactionID = lodashGet(this.props.action, 'originalMessage.IOUTransactionID', '');
const transactionsBeingRejected = lodashGet(this.props, 'transactionsBeingRejected', {});
if (_.isEmpty(transactionsBeingRejected)) {
return false;
}
return _.has(transactionsBeingRejected, IOUTransactionID);
}

render() {
return (
<View styles={[styles.mb5]}>
Expand All @@ -63,10 +92,24 @@ class ReportTransaction extends Component {
styles.buttonSmall,
styles.chatItemComposeSecondaryRowOffset,
styles.mb3,
styles.w20,
]}
onPress={this.rejectTransaction}
>
<Text style={[styles.buttonSmallText]}>{this.props.rejectButtonLabelText}</Text>
{
this.isBeingRejected()
? (
<ActivityIndicator
color={themeColors.text}
style={[styles.flex1]}
/>
)
: (
<Text style={[styles.buttonSmallText]}>
{this.props.rejectButtonLabelText}
</Text>
)
}
</Pressable>
</View>
)}
Expand All @@ -78,4 +121,8 @@ class ReportTransaction extends Component {
ReportTransaction.displayName = 'ReportTransaction';
ReportTransaction.defaultProps = defaultProps;
ReportTransaction.propTypes = propTypes;
export default ReportTransaction;
export default withOnyx({
transactionsBeingRejected: {
key: ONYXKEYS.TRANSACTIONS_BEING_REJECTED,
},
})(ReportTransaction);
21 changes: 21 additions & 0 deletions src/components/StatePicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import _ from 'underscore';
import React from 'react';
import PropTypes from 'prop-types';
import {CONST} from 'expensify-common/lib/CONST';
import Picker from './Picker';

const STATES = _.map(CONST.STATES, ({stateISO}) => ({
value: stateISO,
label: stateISO,
}));

const propTypes = {
onChange: PropTypes.func.isRequired,
};

const StatePicker = props => <Picker items={STATES} onChange={props.onChange} />;

StatePicker.propTypes = propTypes;
StatePicker.displayName = 'StatePicker';

export default StatePicker;
37 changes: 33 additions & 4 deletions src/components/TextInputWithLabel.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
import _ from 'underscore';
import React from 'react';
import {Text, TextInput} from 'react-native';
import {View, TextInput} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import Text from './Text';
import TextLink from './TextLink';

const propTypes = {
/** Label text */
label: PropTypes.string,

/** Text to show if there is an error */
errorText: PropTypes.string,

/** Styles for the outermost container for this component. */
containerStyles: PropTypes.arrayOf(PropTypes.object),

/** Text to use for a link shown after the label */
helpLinkText: PropTypes.string,

/** URL to use for a link shown after the label */
helpLinkURL: PropTypes.string,
};

const defaultProps = {
label: '',
errorText: '',
containerStyles: [],
helpLinkText: '',
helpLinkURL: '',
};

const TextInputWithLabel = props => (
<>
{!_.isEmpty(props.label) && <Text style={[styles.formLabel]}>{props.label}</Text>}
<View style={props.containerStyles}>
<View
style={[
styles.flexRow,
(!_.isEmpty(props.label) && !_.isEmpty(props.helpLinkURL)) ? styles.alignItemsBaseline : undefined,
]}
>
{!_.isEmpty(props.label) && <Text style={[styles.formLabel]}>{props.label}</Text>}
{!_.isEmpty(props.helpLinkURL) && (
<TextLink
href={props.helpLinkURL}
style={!_.isEmpty(props.label) ? [styles.textItalic, styles.textMicro, styles.ml2] : undefined}
>
{props.helpLinkText || props.helpLinkURL}
</TextLink>
)}
</View>
<TextInput
style={[styles.textInput, styles.mb1]}
// eslint-disable-next-line react/jsx-props-no-spreading
Expand All @@ -28,7 +57,7 @@ const TextInputWithLabel = props => (
{props.errorText !== '' && (
<Text style={[styles.formError]}>{props.errorText}</Text>
)}
</>
</View>
);

TextInputWithLabel.propTypes = propTypes;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TextLink = (props) => {
href={props.href}
>
{({hovered, pressed}) => (
<Text style={[...additionalStyles, styles.link, (hovered || pressed) ? styles.linkHovered : undefined]}>
<Text style={[styles.link, (hovered || pressed) ? styles.linkHovered : undefined, ...additionalStyles]}>
{props.children}
</Text>
)}
Expand Down
Loading

0 comments on commit a393b3a

Please sign in to comment.