This repository was archived by the owner on Feb 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-15
lines changed
assets/js/editor-components
product-attribute-term-control Expand file tree Collapse file tree 4 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const ProductAttributeTermControl = ( {
6565 } ,
6666 ] ;
6767
68- if ( ! item ? .breadcrumbs ? .length ) {
68+ if ( ! item . breadcrumbs . length ) {
6969 return (
7070 < ExpandableSearchListItem
7171 { ...args }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export const ProductTagItem = ( {
1616 depth = 0 ,
1717 ...rest
1818} : renderItemArgs ) : JSX . Element => {
19- const accessibleName = ! item ? .breadcrumbs ? .length
19+ const accessibleName = ! item . breadcrumbs . length
2020 ? item . name
2121 : `${ item . breadcrumbs . join ( ', ' ) } , ${ item . name } ` ;
2222
Original file line number Diff line number Diff line change @@ -22,22 +22,12 @@ const Count = ( { label }: { label: string | React.ReactNode | number } ) => {
2222 ) ;
2323} ;
2424
25- type SearchListItemPropsWithBreadcrumb = SearchListItemProps & {
26- breadcrumbs : string [ ] ;
27- } ;
28-
29- const checkHasBreadCrumbs = (
30- item : SearchListItemProps
31- ) : item is SearchListItemPropsWithBreadcrumb => {
32- return ! ! ( item . breadcrumbs && item . breadcrumbs . length ) ;
33- } ;
34-
3525const ItemLabel = ( props : { item : SearchListItemProps ; search : string } ) => {
3626 const { item, search } = props ;
3727
3828 return (
3929 < span className = "woocommerce-search-list__item-label" >
40- { checkHasBreadCrumbs ( item ) ? (
30+ { item . breadcrumbs . length ? (
4131 < span className = "woocommerce-search-list__item-prefix" >
4232 { getBreadcrumbsForDisplay ( item . breadcrumbs ) }
4333 </ span >
@@ -69,7 +59,7 @@ export const SearchListItem = ( {
6959 countLabel !== null &&
7060 item . count !== undefined &&
7161 item . count !== null ;
72- const hasBreadcrumbs = ! ! item . breadcrumbs ? .length ;
62+ const hasBreadcrumbs = ! ! item . breadcrumbs . length ;
7363 const hasChildren = ! ! item . children ?. length ;
7464 const isExpanded = expandedPanelId === item . id ;
7565 const classes = classNames (
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export interface ListItemsProps
3535}
3636
3737export type SearchListItem = {
38- breadcrumbs ? : string [ ] ;
38+ breadcrumbs : string [ ] ;
3939 children ?: SearchListItem [ ] ;
4040 count : number ;
4141 id : string | number ;
You can’t perform that action at this time.
0 commit comments