From 248875ae1252544ed538883ccb666d84d1ffdfaf Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Sun, 24 Mar 2024 23:01:43 +0800 Subject: [PATCH] update: journal components --- src/components/{ => Journal}/JournalCard.tsx | 2 - src/components/{ => Journal}/JournalList.tsx | 0 .../MiniJournalCard.tsx} | 0 src/components/Journal/RecommondJournal.tsx | 46 +++++++++++++++++++ src/components/index.ts | 6 ++- 5 files changed, 51 insertions(+), 3 deletions(-) rename src/components/{ => Journal}/JournalCard.tsx (96%) rename src/components/{ => Journal}/JournalList.tsx (100%) rename src/components/{RecommendCard.tsx => Journal/MiniJournalCard.tsx} (100%) create mode 100644 src/components/Journal/RecommondJournal.tsx diff --git a/src/components/JournalCard.tsx b/src/components/Journal/JournalCard.tsx similarity index 96% rename from src/components/JournalCard.tsx rename to src/components/Journal/JournalCard.tsx index 007f62d..640dd33 100644 --- a/src/components/JournalCard.tsx +++ b/src/components/Journal/JournalCard.tsx @@ -11,8 +11,6 @@ export default function JournalCard({ totalCommentReply, commentList, }: JournalInfo) { - console.log({ commentList }); - return (
{/* banner container */} diff --git a/src/components/JournalList.tsx b/src/components/Journal/JournalList.tsx similarity index 100% rename from src/components/JournalList.tsx rename to src/components/Journal/JournalList.tsx diff --git a/src/components/RecommendCard.tsx b/src/components/Journal/MiniJournalCard.tsx similarity index 100% rename from src/components/RecommendCard.tsx rename to src/components/Journal/MiniJournalCard.tsx diff --git a/src/components/Journal/RecommondJournal.tsx b/src/components/Journal/RecommondJournal.tsx new file mode 100644 index 0000000..da39270 --- /dev/null +++ b/src/components/Journal/RecommondJournal.tsx @@ -0,0 +1,46 @@ +import Image from 'next/image'; + +import JournalCard from './JournalCard'; + +import { apiJournalList } from '@/services/server/journal'; + +const RecommondJournal = async ({ + categoryId, + journalNoRange, + pageNum, + pageSize, +}: { + categoryId?: string; + journalNoRange?: string; + pageNum?: number; + pageSize?: number; +}) => { + const journalList: JournalList = await apiJournalList({ + categoryId, + journalNoRange, + pageNum, + pageSize, + }); + + return ( +
+ {/* 分类 & 电台 */} +
+
{'摇滚'}
+
+ FM +

电台

+
+
+ + {/* 期刊 list */} +
+ {journalList.rows.map((item: JournalInfo) => ( + + ))} +
+
+ ); +}; + +export default RecommondJournal; diff --git a/src/components/index.ts b/src/components/index.ts index e1ba5f6..5068918 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -4,12 +4,16 @@ export { default as Footer } from './Footer'; // Home export { default as TagCategory } from './TagCategory'; -export { default as JournalList } from './JournalList'; export { default as ContributorCard } from './ContributorCard'; +// Login export { default as LoginModal } from './Login/LoginModal'; export { default as LoginForm } from './Login/LoginForm'; +// Journal +export { default as JournalCard } from './Journal/JournalCard'; +export { default as JournalList } from './Journal/JournalList'; + // Common export { default as Input } from './common/Input'; export { default as Button } from './common/Button';