diff --git a/frontend/src/components/Nav/Search.tsx b/frontend/src/components/Nav/Search.tsx index 8090e8c4..8638e021 100644 --- a/frontend/src/components/Nav/Search.tsx +++ b/frontend/src/components/Nav/Search.tsx @@ -16,6 +16,8 @@ import PlatformLink from "../PlatformLink"; import AnonymousFrogAvatar from "../user/AnonymousFrog"; import verticalMenuStyles from "../VerticalMenu.module.scss"; // eslint-disable-line css-modules/no-unused-class +import { getMatchPercentString } from "../ScratchList"; + import styles from "./Search.module.scss"; function MountedSearch({ className }: { className?: string }) { @@ -165,6 +167,9 @@ function MountedSearch({ className }: { className?: string }) { {scratch.name} + + {getMatchPercentString(scratch)} + {scratch.owner && (!api.isAnonUser(scratch.owner) ? ( userAvatarUrl(scratch.owner) && ( diff --git a/frontend/src/components/ScratchList.tsx b/frontend/src/components/ScratchList.tsx index 2f1f82aa..6d6dc07b 100644 --- a/frontend/src/components/ScratchList.tsx +++ b/frontend/src/components/ScratchList.tsx @@ -90,6 +90,9 @@ export default function ScratchList({ } export function getMatchPercentString(scratch: api.TerseScratch) { + if (scratch.score === -1) { + return "0%"; + } if (scratch.match_override) { return "100%"; }