-
Notifications
You must be signed in to change notification settings - Fork 146
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: edit network wrong urls #5871
Conversation
df33bd4
to
59f59b0
Compare
> | ||
Stacks Blockchain API | ||
</Link>{' '} | ||
<Box display="inline-block"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a weird issue. I spent a few minutes trying different ways but didn't come up with anything quickly.
I think it's related to us using <Link
inside of the <span
. We could probably refactor this into it's own component and spot the issue faster as it's a bit weird anyway now.
Removing the Box
and the first <Link
seems to take up loads of space:
It would be good to add a better solution but what you have done is working already so it could be fine
@@ -37,6 +38,7 @@ export function NetworkItemMenu({ onClickDeleteNetwork, onEditNetwork }: Props) | |||
</HStack> | |||
</DropdownMenu.Item> | |||
<DropdownMenu.Item | |||
data-testid={NetworkSelectors.DeleteNetworkMenuBtn} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, yeah, icon should be red
return ( | ||
<> | ||
<PageHeader title="Add network" /> | ||
<PageHeader title={title} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can create a different .layout
file for add-network
and edit-network
?
Or else pass a callback to set title
to <AddNetworkForm
?
I'm not sure why we are using location state for isEditNetworkMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can create a different .layout file for add-network and edit-network?
hm, is it ok to create .layout
components which contains forms? as I understand we use them for layout only, they shouldn't contain any specific logic inside?
Or else pass a callback to set title to <AddNetworkForm?
we use title not in AddNetworkForm
, but in AddNetwork
which is separate page
I'm not sure why we are using location state for isEditNetworkMode
we pass network data (which we edit) in state already, I thought there is no problem to pass isEditNetworkMode as well, just to be explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use a wrapper layout for the different pages and pass the form as children
.
We could also use a different Route URL if we wanted for edit-network
We could set the title in AddNetwork
by passing a callback to <AddNetworkForm
then we don't need to use route state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could set the title in AddNetwork by passing a callback to <AddNetworkForm then we don't need to use route state
don't understand tbh how passing callback to AddNetworkForm can help in setting title in AddNetwork
we actually need to pass route state mainly to get network data that we want to edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created sep pages for add/edit network and common layout component for them, removed isEditNetworkMode from route state
59f59b0
to
2eff833
Compare
2eff833
to
e10bdd3
Compare
e10bdd3
to
8be00ee
Compare
This pr fixes bug with wrong network urls in edit network form