docs: general fixes for docs workspace (#5184)
This commit is contained in:
@@ -126,7 +126,11 @@ export const SearchHits = ({
|
||||
return (
|
||||
Object.keys(item.hierarchy)
|
||||
.reverse()
|
||||
.find((key) => item.hierarchy[key as Hierarchy] !== null) || ""
|
||||
.find(
|
||||
(key) =>
|
||||
item.hierarchy[key as Hierarchy] !== null &&
|
||||
item.hierarchy[key as Hierarchy] !== item.content
|
||||
) || ""
|
||||
)
|
||||
}
|
||||
|
||||
@@ -138,7 +142,13 @@ export const SearchHits = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="overflow-auto">
|
||||
<div
|
||||
className={clsx(
|
||||
"overflow-auto",
|
||||
"[&_mark]:bg-medusa-bg-highlight dark:[&_mark]:bg-medusa-bg-highlight-dark",
|
||||
"[&_mark]:text-medusa-fg-interactive dark:[&_mark]:text-medusa-fg-interactive-dark"
|
||||
)}
|
||||
>
|
||||
{Object.keys(grouped).map((groupName, index) => (
|
||||
<Fragment key={index}>
|
||||
<SearchHitGroupName name={groupName} />
|
||||
@@ -172,11 +182,12 @@ export const SearchHits = ({
|
||||
"hierarchy",
|
||||
item.type && item.type !== "content"
|
||||
? item.type
|
||||
: item.hierarchy.lvl1
|
||||
? "lvl1"
|
||||
: getLastAvailableHeirarchy(item),
|
||||
: getLastAvailableHeirarchy(item) ||
|
||||
item.hierarchy.lvl1 ||
|
||||
"",
|
||||
]}
|
||||
hit={item}
|
||||
separator="."
|
||||
/>
|
||||
</span>
|
||||
{item.type !== "lvl1" && (
|
||||
|
||||
@@ -257,11 +257,13 @@ export const SearchModal = ({
|
||||
"content",
|
||||
"hierarchy.lvl1",
|
||||
"hierarchy.lvl2",
|
||||
"hierarchy.lvl3",
|
||||
],
|
||||
attributesToHighlight: [
|
||||
"content",
|
||||
"hierarchy.lvl1",
|
||||
"hierarchy.lvl2",
|
||||
"hierarchy.lvl3",
|
||||
],
|
||||
}}
|
||||
indices={algolia.indices}
|
||||
|
||||
Reference in New Issue
Block a user