save
This commit is contained in:
parent
0a762f8ace
commit
43f52b64e2
|
@ -0,0 +1,32 @@
|
|||
import { getLinkList, getLinkListAll } from "@/app/_lib/data/link";
|
||||
import { LinkBlock } from "@/app/_ui/LinkListBox";
|
||||
import Search from "@/app/_ui/Search";
|
||||
import { use } from "react";
|
||||
|
||||
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
|
||||
|
||||
const id = (await params).id
|
||||
const { list: linkList } = await getLinkList({ typeId: id })
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <HeaderNav></HeaderNav> */}
|
||||
<main className="w-full p-5">
|
||||
<Search></Search >
|
||||
<div className=" grid grid-cols-3 lg:grid-cols-6 gap-4 ">
|
||||
{
|
||||
linkList.map(val => (
|
||||
<LinkBlock val={val} key={val._id} />
|
||||
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{/* <PosterBox posterList={[]} /> */}
|
||||
</>
|
||||
|
||||
|
||||
|
||||
);
|
||||
}
|
|
@ -9,7 +9,7 @@ import { useAtom } from "jotai";
|
|||
import { linkTypeAtom } from "../_lib/atom";
|
||||
import Image from "next/image";
|
||||
const PICTURE_PREFIX = 'https://newuitab.oss-cn-hangzhou.aliyuncs.com/ai_upload/downloads/'
|
||||
const LinkBlock = ({ val }: { val: _Link }) => {
|
||||
export const LinkBlock = ({ val }: { val: _Link }) => {
|
||||
return <Link className="flex gap-x-2 bg-white rounded-lg py-4 pl-2 cursor-pointer duration-150 hover:-translate-y-1 shadow-sm"
|
||||
href={val.articleId ? `/article/${val.articleId}` : val.link || ''} target="_blank">
|
||||
<img src={val.logoLink.startsWith('http') ? val.logoLink : (PICTURE_PREFIX + val.logoLink)} className="w-[40px] h-[40px]"></img>
|
||||
|
@ -78,10 +78,12 @@ export default function LinkListBox({ linkTypeList, linkList, showHot, showRecen
|
|||
{
|
||||
linkList.filter(val => val.type === item._id).length >= 42 &&
|
||||
|
||||
<span className="absolute cursor-pointer hover:text-[#333] right-1 text-[#666] flex gap-x-1 items-center text-[14px] ">
|
||||
<Link
|
||||
href={"/detail/" + item._id}
|
||||
className="absolute cursor-pointer hover:text-[#333] right-1 text-[#666] flex gap-x-1 items-center text-[14px] ">
|
||||
查看该分类下所有
|
||||
<FontAwesomeIcon icon={faArrowRight}></FontAwesomeIcon>
|
||||
</span>
|
||||
</Link>
|
||||
}
|
||||
</div>
|
||||
<div className=" grid grid-cols-3 lg:grid-cols-6 gap-4 ">
|
||||
|
|
Loading…
Reference in New Issue