diff --git a/.changeset/smart-carrots-exist.md b/.changeset/smart-carrots-exist.md new file mode 100644 index 00000000000..839897728d5 --- /dev/null +++ b/.changeset/smart-carrots-exist.md @@ -0,0 +1,5 @@ +--- +'polaris.shopify.com': minor +--- + +Major refactor of site search diff --git a/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.module.scss b/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.module.scss index 71a10cf0a0c..a22c5234fba 100644 --- a/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.module.scss +++ b/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.module.scss @@ -31,7 +31,7 @@ } @media (hover: hover) { - &.isHighlighted a { + &[data-is-current-result="true"] a { background: var(--search-highlight-color); } } diff --git a/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.tsx b/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.tsx index 4d1cc512cf5..b5bd9bc16b2 100644 --- a/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.tsx +++ b/polaris.shopify.com/src/components/ComponentGrid/ComponentGrid.tsx @@ -1,14 +1,10 @@ import Image from "../Image"; import Link from "next/link"; -import { SearchResultItem } from "../../types"; -import { - className, - getReadableStatusValue, - slugify, -} from "../../utils/various"; +import { getReadableStatusValue, slugify } from "../../utils/various"; import { Status } from "../../types"; import styles from "./ComponentGrid.module.scss"; import StatusBadge from "../StatusBadge"; +import { useGlobalSearchResult } from "../GlobalSearch/GlobalSearch"; interface ComponentGridProps { children: React.ReactNode; @@ -18,7 +14,7 @@ function ComponentGrid({ children }: ComponentGridProps) { return
{stripMarkdownLinks(excerpt)}
+ + +{child.excerpt}
- - -