diff --git a/packages/paste-website/src/components/search-modal/SearchResultDocs.tsx b/packages/paste-website/src/components/search-modal/SearchResultDocs.tsx index 9cdb5ad776..da5a999e58 100644 --- a/packages/paste-website/src/components/search-modal/SearchResultDocs.tsx +++ b/packages/paste-website/src/components/search-modal/SearchResultDocs.tsx @@ -9,7 +9,7 @@ import { type SearchItem } from "./types"; export const FakeHeading: React.FC = ({ children }) => { return ( - + {children} ); @@ -51,7 +51,6 @@ export const SearchResultDocs: React.FC<{ searchItem: SearchItem }> = ({ searchI href={`${searchItem.meta.slug}#${searchItem.slug}`} paddingY="space30" paddingX="space60" - marginX="space40" backgroundColor="colorBackgroundNeutralWeakest" outline="none" _focus={{ diff --git a/packages/paste-website/src/components/search-modal/index.tsx b/packages/paste-website/src/components/search-modal/index.tsx index 9d9e835402..15d87f171c 100644 --- a/packages/paste-website/src/components/search-modal/index.tsx +++ b/packages/paste-website/src/components/search-modal/index.tsx @@ -10,9 +10,9 @@ import { SearchIcon } from "@twilio-paste/icons/esm/SearchIcon"; import { Input } from "@twilio-paste/input"; import { Modal, ModalBody, ModalHeader, ModalHeading, type ModalProps } from "@twilio-paste/modal"; import { Paragraph } from "@twilio-paste/paragraph"; -import { Stack } from "@twilio-paste/stack"; import { useUID } from "@twilio-paste/uid-library"; import groupBy from "lodash/groupBy"; +import Link from "next/link"; import * as React from "react"; import GithubIcon from "../icons/GithubIcon"; @@ -63,7 +63,7 @@ const SearchModal: React.FC> = ({ isOp }; return ( - + @@ -111,32 +111,54 @@ const SearchModal: React.FC> = ({ isOp {loading && } {Object.keys(results)?.map((path) => { - console.log(results[path][0].type); + const resultSections = results[path]; + const resultParent = { + path: resultSections[0].path, + title: resultSections[0].meta.title, + description: resultSections[0].meta.description, + slug: resultSections[0].meta.slug, + }; + const resultType = resultSections[0].type; return ( - + - - - {results[path][0].type === "github-discussions" ? ( - - - - ) : ( - - )} - {results[path][0].meta.title} - - + + {/* @ts-expect-error href missing as Next Link is passing down the href for us so we can still do client side routing */} + + + {resultType === "github-discussions" ? ( + + + + ) : ( + + )} + {resultParent.title} + + + - {results[path][0].meta.description && {results[path][0].meta.description}} - - {results[path].map((result) => { - if (result.type === "markdown") { - return ; - } - return null; - })} - + {resultParent.description && {resultParent.description}} + {resultType === "markdown" && ( + + + Matching page sections: + + + {resultSections.map((result) => { + return ( + + + + ); + })} + + + )} ); })} diff --git a/packages/paste-website/src/components/site-wrapper/site-header/SiteHeaderSearch.tsx b/packages/paste-website/src/components/site-wrapper/site-header/SiteHeaderSearch.tsx index 40e05b8df3..b58085e29b 100644 --- a/packages/paste-website/src/components/site-wrapper/site-header/SiteHeaderSearch.tsx +++ b/packages/paste-website/src/components/site-wrapper/site-header/SiteHeaderSearch.tsx @@ -27,11 +27,11 @@ const SiteHeaderSearch: React.FC = () => { backgroundColor="colorBackgroundBody" fontSize="fontSize30" fontWeight="fontWeightMedium" - lineHeight="lineHeight20" - paddingBottom="space30" + lineHeight="lineHeight50" + paddingBottom="space20" paddingLeft="space30" paddingRight="space50" - paddingTop="space30" + paddingTop="space20" borderStyle="solid" boxShadow="shadowBorder" minWidth="200px"