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

fix: fix routing issues with send flow #5146

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented Mar 29, 2024

Try out Leather build cc1aa60Extension build, Test report, Storybook, Chromatic

This PR fixes issues with the send flow not moving past Continue. I guess these problems were introduced in the containers PR although I thought that area was well tested manually and covered by automated tests.

I will investigate improving the tests but opening this PR right away as otherwise sending any tokens is not working.

@@ -82,8 +84,7 @@ export function useSendFormNavigate() {
name,
tx,
}: ConfirmationRouteStacksSip10Args) {
return navigate('confirm', {
replace: true,
return navigate(`${location.pathname}/confirm`, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previously working relative paths now fail so I am using the location.pathname to prepend this route.

I think this may have stopped working as to move the Continue button to the footer, we had to change the form to use props.handleSubmit()

e.g. in BtcSendForm:

  return (
            <Form>
              <Card
                footer={
                  <Footer variant="card">
                    <Button
                      data-testid={SendCryptoAssetSelectors.PreviewSendTxBtn}
                      onClick={() => props.handleSubmit()}
                      type="submit"
                    >
                      Continue
                    </Button>
                    <AvailableBalance balance={formatMoney(btcBalance.balance)} />
                  </Footer>
                }
              >
                <CardContent dataTestId={SendCryptoAssetSelectors.SendForm}>
                  <AmountField
    

Before we had a lot of nested components doing this that drilled down a lot to a preview-button component

@pete-watters pete-watters linked an issue Mar 29, 2024 that may be closed by this pull request
@pete-watters pete-watters added this pull request to the merge queue Mar 29, 2024
Merged via the queue into dev with commit f32151d Mar 29, 2024
29 of 30 checks passed
@pete-watters pete-watters deleted the fix/5145/send-stx-form branch March 29, 2024 14:01
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.

Send STX form is crashing
2 participants