-
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
Global Styles Sidebar: Rename NavigationButton
so semantics are clearer
#40590
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -21,7 +21,7 @@ import { store as coreStore } from '@wordpress/core-data'; | |||||||||||||||
* Internal dependencies | ||||||||||||||||
*/ | ||||||||||||||||
import { IconWithCurrentColor } from './icon-with-current-color'; | ||||||||||||||||
import { NavigationButton } from './navigation-button'; | ||||||||||||||||
import { NavigationButtonAsItem } from './navigation-button'; | ||||||||||||||||
import ContextMenu from './context-menu'; | ||||||||||||||||
import StylesPreview from './preview'; | ||||||||||||||||
|
||||||||||||||||
|
@@ -44,16 +44,20 @@ function ScreenRoot() { | |||||||||||||||
</CardMedia> | ||||||||||||||||
</Card> | ||||||||||||||||
{ !! variations?.length && ( | ||||||||||||||||
<NavigationButton path="/variations"> | ||||||||||||||||
<HStack justify="space-between"> | ||||||||||||||||
<FlexItem>{ __( 'Browse styles' ) }</FlexItem> | ||||||||||||||||
<IconWithCurrentColor | ||||||||||||||||
icon={ | ||||||||||||||||
isRTL() ? chevronLeft : chevronRight | ||||||||||||||||
} | ||||||||||||||||
/> | ||||||||||||||||
</HStack> | ||||||||||||||||
</NavigationButton> | ||||||||||||||||
<ItemGroup> | ||||||||||||||||
<NavigationButtonAsItem path="/variations"> | ||||||||||||||||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This "fixes" the semantic issue, but wrapping this single item in an I think we can go with this bandaid fix, since we'll probably overhaul this view (#40478) anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about overriding the
Suggested change
Just a caveat: eslint complains about passing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'm hesitant to do that too since I agree with eslint that My preference would be to fix the focus outline inconsistency so we can just use a vanilla There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Let's improve the focus outline inconsistency, and then look at a way to rewrite |
||||||||||||||||
<HStack justify="space-between"> | ||||||||||||||||
<FlexItem> | ||||||||||||||||
{ __( 'Browse styles' ) } | ||||||||||||||||
</FlexItem> | ||||||||||||||||
<IconWithCurrentColor | ||||||||||||||||
icon={ | ||||||||||||||||
isRTL() ? chevronLeft : chevronRight | ||||||||||||||||
} | ||||||||||||||||
/> | ||||||||||||||||
</HStack> | ||||||||||||||||
</NavigationButtonAsItem> | ||||||||||||||||
</ItemGroup> | ||||||||||||||||
) } | ||||||||||||||||
<ContextMenu /> | ||||||||||||||||
</VStack> | ||||||||||||||||
|
@@ -77,14 +81,14 @@ function ScreenRoot() { | |||||||||||||||
) } | ||||||||||||||||
</Spacer> | ||||||||||||||||
<ItemGroup> | ||||||||||||||||
<NavigationButton path="/blocks"> | ||||||||||||||||
<NavigationButtonAsItem path="/blocks"> | ||||||||||||||||
<HStack justify="space-between"> | ||||||||||||||||
<FlexItem>{ __( 'Blocks' ) }</FlexItem> | ||||||||||||||||
<IconWithCurrentColor | ||||||||||||||||
icon={ isRTL() ? chevronLeft : chevronRight } | ||||||||||||||||
/> | ||||||||||||||||
</HStack> | ||||||||||||||||
</NavigationButton> | ||||||||||||||||
</NavigationButtonAsItem> | ||||||||||||||||
</ItemGroup> | ||||||||||||||||
</CardBody> | ||||||||||||||||
</Card> | ||||||||||||||||
|
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.
This bandaid fix will be ripped off in #40592.