mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
chore: replace search embeds with actual links
This commit is contained in:
@@ -5,6 +5,7 @@ import { Chip } from "components/index";
|
||||
import date from "src/icons/date.svg?raw";
|
||||
import authors from "src/icons/authors.svg?raw";
|
||||
import { getHrefContainerProps } from "utils/href-container-script";
|
||||
import { buildSearchQuery } from "utils/search";
|
||||
|
||||
interface PostCardProps {
|
||||
post: PostInfo;
|
||||
@@ -59,7 +60,9 @@ function PostCardMeta({ post, unicornProfilePicMap }: PostCardProps) {
|
||||
<ul className={style.cardList}>
|
||||
{post.tags.map((tag) => (
|
||||
<li>
|
||||
<Chip href={`/search?q=${tag}`}>{tag}</Chip>
|
||||
<Chip href={`/search?${buildSearchQuery({ filterTags: [tag] })}`}>
|
||||
{tag}
|
||||
</Chip>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as data from "../../utils/data";
|
||||
import { SearchInput } from "../input/input";
|
||||
import { IconOnlyButton } from "../button/button";
|
||||
import { Icon } from "astro-icon";
|
||||
import { buildSearchQuery } from "../../utils/search";
|
||||
|
||||
const tagsToDisplay = [...data.tags]
|
||||
.sort(() => 0.5 - Math.random())
|
||||
@@ -31,7 +32,9 @@ const tagsToDisplay = [...data.tags]
|
||||
{
|
||||
tagsToDisplay.map((tag) => (
|
||||
<li>
|
||||
<Chip href={`/search?q=${tag}`}>{tag}</Chip>
|
||||
<Chip href={`/search?${buildSearchQuery({ filterTags: [tag] })}`}>
|
||||
{tag}
|
||||
</Chip>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { translate } from "../../utils";
|
||||
import { Button } from "../../components";
|
||||
import styles from "./unicorn-page.module.scss";
|
||||
import Achievements from "./components/achievements.astro";
|
||||
import { buildSearchQuery } from "../../utils/search";
|
||||
|
||||
interface UnicornPageProps {
|
||||
unicorn: UnicornInfo;
|
||||
@@ -73,7 +74,12 @@ const showPostsToggle = posts.length > postsToDisplay.length;
|
||||
<!-- TODO: Replace href with util to build search URL -->
|
||||
{
|
||||
showPostsToggle && (
|
||||
<Button tag="a" href={"/search"}>
|
||||
<Button
|
||||
tag="a"
|
||||
href={`/search?${buildSearchQuery({
|
||||
filterAuthors: [unicorn.id],
|
||||
})}`}
|
||||
>
|
||||
View all
|
||||
</Button>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user