refactor: create proper article links
This commit is contained in:
parent
6d6f684b47
commit
d3b9cadb54
|
@ -4,7 +4,7 @@ import { formatDate } from "@/utils";
|
||||||
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Article } from "@/lib/prisma";
|
import { Article } from "@/lib/prisma";
|
||||||
import { useFetcher } from "@remix-run/react";
|
import { Link, useFetcher } from "@remix-run/react";
|
||||||
|
|
||||||
const Feed = ({
|
const Feed = ({
|
||||||
className,
|
className,
|
||||||
|
@ -112,7 +112,7 @@ const Feed = ({
|
||||||
{formatDate(item.createdAt)}
|
{formatDate(item.createdAt)}
|
||||||
</span>
|
</span>
|
||||||
<p className="inline-block text-white w-[25ch] flex-auto">
|
<p className="inline-block text-white w-[25ch] flex-auto">
|
||||||
{item.title}
|
<Link to={`/article/${item.cid}`}>{item.title}</Link>
|
||||||
</p>
|
</p>
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
|
|
|
@ -55,7 +55,10 @@ const Page = () => {
|
||||||
<span className="text-sm text-gray-400">
|
<span className="text-sm text-gray-400">
|
||||||
{formatDate(item.timestamp)}
|
{formatDate(item.timestamp)}
|
||||||
</span>
|
</span>
|
||||||
<h3 className="text-md font-semibold text-white">{item.title}</h3>
|
<h3 className="text-md font-semibold text-white">
|
||||||
|
{" "}
|
||||||
|
<Link to={`/article/${item.cid}`}>{item.title}</Link>
|
||||||
|
</h3>
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
<Link to={`/search?q=${encodeURIComponent(query)}`}>
|
<Link to={`/search?q=${encodeURIComponent(query)}`}>
|
||||||
|
|
|
@ -4,6 +4,7 @@ export type SearchResult = {
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
|
cid: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SelectOptions = {
|
export type SelectOptions = {
|
||||||
|
|
Loading…
Reference in New Issue