-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 link creation UI to standalone component/file #46031
Refactor link creation UI to standalone component/file #46031
Conversation
This will make this easier to refactor in future
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +83 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
@@ -0,0 +1,202 @@ | |||
/** |
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.
Is it worth moving this out of navigation-link
?
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.
What is this
? Sorry the comment is on the first line of a JS comment 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.
Sorry, I mean the whole file.
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.
Everything seems to work exactly the same. Code looks good too.
#46161 addresses a minor ESLint warning that we introduced with this PR. |
What?
Refactors all the link creation components and utilities in
core/navigaiton-link
to a single component/file.Why?
This is a step towards goals set out in #45996 (comment).
The idea is that we'll need to display the same link ui interface within the Nav block offcanvas experiment as is currently used within the block in the editor canvas.
By extracting everything to a single file it will be easier to see what we have copied/pasted (reused) within the offcanvas.
This also has the additional benefit of cleaning up the code of the Nav Link block.
How?
Extracts all the Link UI specific stuff to a separate standalone file which can be fed props to configure it for a specific block and link instance.
This should mean we can feed it block data from the offcanvas experiment and it will "just work".
Testing Instructions
The goal here is to check the link creation UI within the Nav block has not be effected at all. It should remain exactly as it is on
trunk
. Whatever bugs you find here please be sure to cross check them withtrunk
.Screenshots or screencast