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: edit network wrong urls #5871

Merged
merged 1 commit into from
Sep 26, 2024
Merged

fix: edit network wrong urls #5871

merged 1 commit into from
Sep 26, 2024

Conversation

alter-eggo
Copy link
Collaborator

@alter-eggo alter-eggo commented Sep 24, 2024

Try out Leather build 8be00eeExtension build, Test report, Storybook, Chromatic

This pr fixes bug with wrong network urls in edit network form

>
Stacks Blockchain API
</Link>{' '}
<Box display="inline-block">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is fix for weird ui error, same elements, but one without underline
wonder if there is some better way to fix it
Screenshot 2024-09-24 at 16 01 27

Copy link
Contributor

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:
Screenshot 2024-09-25 at 09 48 10

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}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this UI right? Red text and black icon?

Screenshot 2024-09-25 at 09 32 46

Copy link
Collaborator Author

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} />
Copy link
Contributor

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

Copy link
Collaborator Author

@alter-eggo alter-eggo Sep 25, 2024

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

Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

@alter-eggo alter-eggo Sep 26, 2024

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

@markmhendrickson markmhendrickson requested review from pete-watters and camerow and removed request for kyranjamie and fbwoolf September 25, 2024 08:41
@alter-eggo alter-eggo force-pushed the fix/edit-network-page branch from 59f59b0 to 2eff833 Compare September 25, 2024 12:37
@alter-eggo alter-eggo force-pushed the fix/edit-network-page branch from 2eff833 to e10bdd3 Compare September 26, 2024 11:46
@alter-eggo alter-eggo force-pushed the fix/edit-network-page branch from e10bdd3 to 8be00ee Compare September 26, 2024 11:52
@alter-eggo alter-eggo added this pull request to the merge queue Sep 26, 2024
Merged via the queue into dev with commit 7256379 Sep 26, 2024
30 checks passed
@alter-eggo alter-eggo deleted the fix/edit-network-page branch September 26, 2024 16:22
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.

When I edit network settings I expect to see the current data not default data
2 participants