Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added icons to the IOU payments mode #3852

Merged
merged 3 commits into from
Jul 1, 2021
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
27 changes: 27 additions & 0 deletions assets/images/cash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/images/paypal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions assets/images/venmo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Bank from '../../../assets/images/bank.svg';
import Bug from '../../../assets/images/bug.svg';
import Building from '../../../assets/images/building.svg';
import Camera from '../../../assets/images/camera.svg';
import Cash from '../../../assets/images/cash.svg';
import ChatBubble from '../../../assets/images/chatbubble.svg';
import Checkmark from '../../../assets/images/checkmark.svg';
import Clipboard from '../../../assets/images/clipboard.svg';
Expand All @@ -15,6 +16,7 @@ import Download from '../../../assets/images/download.svg';
import Emoji from '../../../assets/images/emoji.svg';
import Exclamation from '../../../assets/images/exclamation.svg';
import Eye from '../../../assets/images/eye.svg';
import ExpensifyCard from '../../../assets/images/expensifycard.svg';
import Gallery from '../../../assets/images/gallery.svg';
import Gear from '../../../assets/images/gear.svg';
import Info from '../../../assets/images/info.svg';
Expand All @@ -27,9 +29,11 @@ import MoneyBag from '../../../assets/images/money-bag.svg';
import MoneyCircle from '../../../assets/images/money-circle.svg';
import Monitor from '../../../assets/images/monitor.svg';
import NewWindow from '../../../assets/images/new-window.svg';
import NewWorkspace from '../../../assets/images/new-workspace.svg';
import Offline from '../../../assets/images/offline.svg';
import Paperclip from '../../../assets/images/paperclip.svg';
import Paycheck from '../../../assets/images/paycheck.svg';
import Paypal from '../../../assets/images/paypal.svg';
import Pencil from '../../../assets/images/pencil.svg';
import Phone from '../../../assets/images/phone.svg';
import Pin from '../../../assets/images/pin.svg';
Expand All @@ -43,9 +47,8 @@ import Sync from '../../../assets/images/sync.svg';
import Trashcan from '../../../assets/images/trashcan.svg';
import Users from '../../../assets/images/users.svg';
import Upload from '../../../assets/images/upload.svg';
import Venmo from '../../../assets/images/venmo.svg';
import Wallet from '../../../assets/images/wallet.svg';
import NewWorkspace from '../../../assets/images/new-workspace.svg';
import ExpensifyCard from '../../../assets/images/expensifycard.svg';

export {
Android,
Expand All @@ -56,6 +59,7 @@ export {
Building,
Bug,
Camera,
Cash,
ChatBubble,
Checkmark,
Clipboard,
Expand All @@ -78,9 +82,11 @@ export {
MoneyCircle,
Monitor,
NewWindow,
NewWorkspace,
Offline,
Paperclip,
Paycheck,
Paypal,
Pencil,
Phone,
Pin,
Expand All @@ -94,6 +100,6 @@ export {
Trashcan,
Upload,
Users,
Venmo,
Wallet,
NewWorkspace,
};
30 changes: 23 additions & 7 deletions src/pages/iou/IOUDetailsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import CreateMenu from '../../components/CreateMenu';
import isAppInstalled from '../../libs/isAppInstalled';
import Button from '../../components/Button';
import Permissions from '../../libs/Permissions';
import {
Cash, Paypal, Venmo, Wallet,
} from '../../components/Icon/Expensicons';

const propTypes = {
/** URL Route params */
Expand Down Expand Up @@ -198,13 +201,25 @@ class IOUDetailsModal extends Component {
render() {
const sessionEmail = lodashGet(this.props.session, 'email', null);
const reportIsLoading = _.isUndefined(this.props.iouReport);
const paymentTypeTextOptions = {
[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: this.props.translate('iou.settleExpensify'),
[CONST.IOU.PAYMENT_TYPE.VENMO]: this.props.translate('iou.settleVenmo'),
[CONST.IOU.PAYMENT_TYPE.PAYPAL_ME]: this.props.translate('iou.settlePaypalMe'),
[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: this.props.translate('iou.settleElsewhere'),
const paymentTypeOptions = {
[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: {
text: this.props.translate('iou.settleExpensify'),
icon: Wallet,
},
[CONST.IOU.PAYMENT_TYPE.VENMO]: {
text: this.props.translate('iou.settleVenmo'),
icon: Venmo,
},
[CONST.IOU.PAYMENT_TYPE.PAYPAL_ME]: {
text: this.props.translate('iou.settlePaypalMe'),
icon: Paypal,
},
[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: {
text: this.props.translate('iou.settleElsewhere'),
icon: Cash,
},
};
const selectedPaymentType = paymentTypeTextOptions[this.state.paymentType];
const selectedPaymentType = paymentTypeOptions[this.state.paymentType].text;
return (
<ScreenWrapper>
<HeaderWithCloseButton
Expand Down Expand Up @@ -258,7 +273,8 @@ class IOUDetailsModal extends Component {
animationOut="fadeOutDown"
headerText={this.props.translate('iou.choosePaymentMethod')}
menuItems={_.map(this.state.paymentOptions, paymentType => ({
text: paymentTypeTextOptions[paymentType],
text: paymentTypeOptions[paymentType].text,
icon: paymentTypeOptions[paymentType].icon,
onSelected: () => {
this.setState({paymentType});
},
Expand Down