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 { useEffect, useState } from "react";
|
||||
import { Article } from "@/lib/prisma";
|
||||
import { useFetcher } from "@remix-run/react";
|
||||
import { Link, useFetcher } from "@remix-run/react";
|
||||
|
||||
const Feed = ({
|
||||
className,
|
||||
|
@ -112,7 +112,7 @@ const Feed = ({
|
|||
{formatDate(item.createdAt)}
|
||||
</span>
|
||||
<p className="inline-block text-white w-[25ch] flex-auto">
|
||||
{item.title}
|
||||
<Link to={`/article/${item.cid}`}>{item.title}</Link>
|
||||
</p>
|
||||
</article>
|
||||
);
|
||||
|
|
|
@ -55,7 +55,10 @@ const Page = () => {
|
|||
<span className="text-sm text-gray-400">
|
||||
{formatDate(item.timestamp)}
|
||||
</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 to={`/search?q=${encodeURIComponent(query)}`}>
|
||||
|
|
|
@ -4,6 +4,7 @@ export type SearchResult = {
|
|||
title: string;
|
||||
description: string;
|
||||
slug: string;
|
||||
cid: string;
|
||||
};
|
||||
|
||||
export type SelectOptions = {
|
||||
|
|
Loading…
Reference in New Issue