Link coaches to their chesscom/lichess page.
parent
54c7d14669
commit
2a4d969030
|
@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in New Issue