Link coaches to their chesscom/lichess page.

main
Joshua Potter 2023-12-05 16:14:35 -07:00
parent 54c7d14669
commit 2a4d969030
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@ type SearchResultProps = {
title?: string title?: string
subtitle?: string subtitle?: string
src?: string src?: string
} & React.ComponentPropsWithoutRef<"div"> } & React.ComponentPropsWithoutRef<"a">
export function SearchResult({ export function SearchResult({
title, title,
@ -15,7 +15,7 @@ export function SearchResult({
...props ...props
}: SearchResultProps) { }: SearchResultProps) {
return ( return (
<div <a
className={clsx( className={clsx(
"group relative h-96 overflow-hidden rounded-3xl bg-neutral-100", "group relative h-96 overflow-hidden rounded-3xl bg-neutral-100",
className className
@ -36,6 +36,6 @@ export function SearchResult({
<p className="mt-2 text-sm text-white">{subtitle}</p> <p className="mt-2 text-sm text-white">{subtitle}</p>
) : null} ) : null}
</div> </div>
</div> </a>
) )
} }

View File

@ -38,6 +38,14 @@ function SearchResults() {
src={coach.image_url ?? ""} src={coach.image_url ?? ""}
title={coach.name ?? ""} title={coach.name ?? ""}
subtitle={coach.name ?? ""} subtitle={coach.name ?? ""}
target="_blank"
href={
coach.site === "lichess"
? `https://lichess.org/coach/${coach.username}`
: coach.site === "chesscom"
? `https://www.chess.com/member/${coach.username}`
: undefined
}
/> />
</FadeIn> </FadeIn>
))} ))}