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

Refactor IOUModal to MoneyRequestModal #16679

Merged
merged 27 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2dda81f
Migrate the new modal props / HOC
thienlnam Mar 29, 2023
6408554
add the class functions
thienlnam Mar 29, 2023
4cf8420
migrate this.step
thienlnam Mar 29, 2023
3b228b3
add refs for previous values
thienlnam Mar 30, 2023
6f1af21
refactor the useEffect
thienlnam Mar 30, 2023
1d5d5bc
add seperate component for header
thienlnam Mar 31, 2023
a447ee3
update all instances of this
thienlnam Mar 31, 2023
c2aa299
remove seperate header for now
thienlnam Mar 31, 2023
d8dd2d8
fix function declarations
thienlnam Apr 1, 2023
60cf4f8
Comment updates
thienlnam Apr 1, 2023
9f1a746
Update method for openMoneyRequestModalPage
thienlnam Apr 1, 2023
e0aaee7
Update usages of IOUModal Component
thienlnam Apr 1, 2023
3cce255
update the api command that is called
thienlnam Apr 2, 2023
e810c37
Merge branch 'main' into jack-refactorIOUModal
thienlnam Apr 3, 2023
81380cc
review comments / kill currency update
thienlnam Apr 3, 2023
6424dd2
update routes / useEffect cleanup
thienlnam Apr 3, 2023
07b1fd8
clean up comments
thienlnam Apr 3, 2023
592f083
add new header component
thienlnam Apr 3, 2023
1d916df
clean up method to use new component
thienlnam Apr 3, 2023
d4dd9d8
remove IOU Modal
thienlnam Apr 3, 2023
78c23ad
comment update
thienlnam Apr 4, 2023
d82d777
Merge branch 'main' into jack-refactorIOUModal
thienlnam Apr 4, 2023
edd210c
Add initial mount details
thienlnam Apr 4, 2023
faf4cb0
review comments
thienlnam Apr 4, 2023
c9af57d
remove lint
thienlnam Apr 4, 2023
1a8df6f
review. comments / update functions to useCallback
thienlnam Apr 4, 2023
0ac8c49
update some functions to memo
thienlnam Apr 4, 2023
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: 1 addition & 1 deletion src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
// Credentials to authenticate the user
CREDENTIALS: 'credentials',

// Contains loading data for the IOU feature (IOUModal, IOUDetail, & IOUPreview Components)
// Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & IOUPreview Components)
IOU: 'iou',

// Keeps track if there is modal currently visible or not
Expand Down
6 changes: 3 additions & 3 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import * as Url from './libs/Url';
*/

const REPORT = 'r';
const IOU_REQUEST = 'iou/request';
const IOU_BILL = 'iou/split';
const IOU_SEND = 'iou/send';
const IOU_REQUEST = 'request/new';
const IOU_BILL = 'split/new';
const IOU_SEND = 'send/new';
Comment on lines -9 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

const IOU_DETAILS = 'iou/details';
const IOU_REQUEST_CURRENCY = `${IOU_REQUEST}/currency`;
const IOU_BILL_CURRENCY = `${IOU_BILL}/currency`;
Expand Down
6 changes: 3 additions & 3 deletions src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const propTypes = {
/** Callback to parent modal to send money */
onSendMoney: PropTypes.func.isRequired,

/** Callback to update comment from IOUModal */
/** Callback to update comment from MoneyRequestModal */
onUpdateComment: PropTypes.func,

/** Comment value from IOUModal */
/** Comment value from MoneyRequestModal */
comment: PropTypes.string,

/** Should we request a single or multiple participant selection from user */
Expand All @@ -40,7 +40,7 @@ const propTypes = {
/** IOU type */
iouType: PropTypes.string,

/** Selected participants from IOUModal with login */
/** Selected participants from MoneyRequestModal with login */
participants: PropTypes.arrayOf(PropTypes.shape({
login: PropTypes.string.isRequired,
alternateText: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/PersonalDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function updateSelectedTimezone(selectedTimezone) {
/**
* Fetches the local currency based on location and sets currency code/symbol to Onyx
*/
function openIOUModalPage() {
function openMoneyRequestModalPage() {
API.read('OpenIOUModalPage');
}

Expand Down Expand Up @@ -368,7 +368,7 @@ export {
getDisplayName,
updateAvatar,
deleteAvatar,
openIOUModalPage,
openMoneyRequestModalPage,
openPersonalDetailsPage,
extractFirstAndLastNameFromAvailableDetails,
updateDisplayName,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/IOUBillPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import IOUModal from './IOUModal';
import MoneyRequestModal from './MoneyRequestModal';

// eslint-disable-next-line react/jsx-props-no-spreading
const IOUBillPage = props => <IOUModal {...props} hasMultipleParticipants />;
const IOUBillPage = props => <MoneyRequestModal {...props} hasMultipleParticipants />;
IOUBillPage.displayName = 'IOUBillPage';
export default IOUBillPage;
Loading