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

feat(wire): add wire bank modal to withdraw #6210

Merged
merged 7 commits into from
Jan 2, 2024

Conversation

mperdomo-bc
Copy link
Collaborator

@mperdomo-bc mperdomo-bc commented Dec 22, 2023

GROWUX-2401
This adds an "Add Wire Bank" flow to both withdraw/deposit from FIAT section.

Form won't allow moving forward if any field is empty and if Account Number is not 9 digits long where required.
Confirm screen only allows moving forward if checkbox is checked

User Bank Info
image

Intermediary Bank (if yes selected)
image

Information Screen (without Intermediary)
image

Information Screen (with Intermediary)
image

Success screen
image

Failure screen (default error)
image

Failure screen (already linked)
image

Copy link
Collaborator

@mrodriguez-bc mrodriguez-bc left a comment

Choose a reason for hiding this comment

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

Looks good to me. Were you able to test this in staging and confirm it properly implements the BE calls etc?

@mperdomo-bc mperdomo-bc marked this pull request as ready for review December 26, 2023 22:59
@@ -191,7 +191,7 @@ class Deposit extends PureComponent<Props, State> {
)}
{this.props.step === BankDWStepType.WIRE_INSTRUCTIONS && (
<FlyoutChild>
<WireInstructions {...this.props} handleClose={this.handleClose} />
<AddBankWireForm />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like this since we had a lot of such spread properties thing

</Entries>
</div>

{formValues.hasIntermediaryBank === 'YES' && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe move 'YES' to const

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I typed the hasIntermediaryBank property so autocompletion/error handling alerts you of any error so I didn't deem it necessary


> div {
flex: 7;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we need this it should be a wrapper itself

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the latest version this is a component in the same file that is right below it so it's more explicit what it does, but if it's not clear I can create two new (Text) wrappers

Comment on lines 40 to 51
const formValues = useSelector((state) =>
formValueSelector('addWireBank')(
state,
'accountNumber',
'bankName',
'hasIntermediaryBank',
'intermediaryAccountNumber',
'intermediaryBankName',
'intermediaryRoutingNumber',
'routingNumber'
)
) as WireBankFormType
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const formValues = useSelector((state) =>
formValueSelector('addWireBank')(
state,
'accountNumber',
'bankName',
'hasIntermediaryBank',
'intermediaryAccountNumber',
'intermediaryBankName',
'intermediaryRoutingNumber',
'routingNumber'
)
) as WireBankFormType
const formValues = useSelector(
useMemo(
() =>
formValueSelector('addWireBank')(
state,
'accountNumber',
'bankName',
'hasIntermediaryBank',
'intermediaryAccountNumber',
'intermediaryBankName',
'intermediaryRoutingNumber',
'routingNumber'
) as WireBankFormType,
[state] // Add dependencies as needed
)
);

Consider using the useMemo hook to memoize the result of the formValueSelector to avoid unnecessary re-computations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice! It sent me digging in the docs and found out that redux offers a shallowEqual function that helps with this - see https://react-redux.js.org/api/hooks#equality-comparisons-and-updates

Copy link
Collaborator

@milan-bc milan-bc left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, give it a try on staging if all works as expected, we can merge it 🙏

@mperdomo-bc mperdomo-bc merged commit b85cb3f into development Jan 2, 2024
1 check passed
@mperdomo-bc mperdomo-bc deleted the wirebankwithdraw branch January 2, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants