Compare commits

...

2 Commits

Author SHA1 Message Date
expdsn 43f52b64e2 save 2025-02-24 23:21:15 +08:00
expdsn 0a762f8ace save 2025-02-24 23:04:00 +08:00
2 changed files with 44 additions and 5 deletions

View File

@ -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={[]} /> */}
</>
);
}

View File

@ -4,12 +4,12 @@ import { LinkType } from "../_lib/data/linkType";
import { Link as _Link } from "../_lib/data/link";
import { useEffect, useMemo } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faClock, faFire, faTimeline, faTimesCircle, faTimesRectangle, faVolumeTimes } from "@fortawesome/free-solid-svg-icons";
import { faArrowRight, faClock, faFire, faRightFromBracket, faRightLong, faTimeline, faTimesCircle, faTimesRectangle, faVolumeTimes } from "@fortawesome/free-solid-svg-icons";
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>
@ -71,13 +71,20 @@ export default function LinkListBox({ linkTypeList, linkList, showHot, showRecen
{
linkTypeList.map(item => (
<div className="flex flex-col gap-y-2" key={item._id} id={item._id}>
<div className="flex items-center text-[#555555] gap-x-2 text-xl relative">
<div className="flex items-center text-[#555555] gap-x-2 w-full text-xl relative">
<img src={item.icon as string} className="w-[30px] h-[30px] object-cover"></img>
<span>{item.label}</span>
<span className="aboslute right-1 top-1/2 -transform-y-1/2">
{
linkList.filter(val => val.type === item._id).length >= 42 &&
</span>
<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>
</Link>
}
</div>
<div className=" grid grid-cols-3 lg:grid-cols-6 gap-4 ">
{