diff --git a/apps/web/src/app/main/home/components/CoursesSection.tsx b/apps/web/src/app/main/home/components/CoursesSection.tsx index 3280945..40814f4 100755 --- a/apps/web/src/app/main/home/components/CoursesSection.tsx +++ b/apps/web/src/app/main/home/components/CoursesSection.tsx @@ -1,12 +1,10 @@ -import React, { useState, useMemo } from "react"; +import React, { useState, useMemo, ReactNode } from "react"; import { Typography, Skeleton } from "antd"; import { TaxonomySlug, TermDto } from "@nice/common"; import { api } from "@nice/client"; import { CoursesSectionTag } from "./CoursesSectionTag"; import LookForMore from "./LookForMore"; import PostList from "@web/src/components/models/course/list/PostList"; -import PostCard from "@web/src/components/models/post/PostCard"; -import CourseCard from "@web/src/components/models/post/SubPost/CourseCard"; interface GetTaxonomyProps { categories: string[]; isLoading: boolean; @@ -35,11 +33,15 @@ interface CoursesSectionProps { title: string; description: string; initialVisibleCoursesCount?: number; + postType:string; + render?:(post)=>ReactNode } const CoursesSection: React.FC = ({ title, description, initialVisibleCoursesCount = 8, + postType, + render }) => { const [selectedCategory, setSelectedCategory] = useState("全部"); const gateGory: GetTaxonomyProps = useGetTaxonomy({ @@ -83,7 +85,7 @@ const CoursesSection: React.FC = ({ )} } + renderItem={(post) => render(post)} params={{ page: 1, pageSize: initialVisibleCoursesCount, @@ -95,6 +97,7 @@ const CoursesSection: React.FC = ({ }, } : {}, + type: postType }, }} showPagination={false} diff --git a/apps/web/src/app/main/home/page.tsx b/apps/web/src/app/main/home/page.tsx index 0cf5123..c7db111 100755 --- a/apps/web/src/app/main/home/page.tsx +++ b/apps/web/src/app/main/home/page.tsx @@ -1,6 +1,9 @@ import HeroSection from "./components/HeroSection"; import CategorySection from "./components/CategorySection"; import CoursesSection from "./components/CoursesSection"; +import { PostType } from "@nice/common"; +import PathCard from "@web/src/components/models/post/SubPost/PathCard"; +import CourseCard from "@web/src/components/models/post/SubPost/CourseCard"; const HomePage = () => { @@ -8,10 +11,19 @@ const HomePage = () => { return (
+ } + /> } /> +
); diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index c000d38..38fd4d7 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -170,9 +170,13 @@ export default function MindEditor({ id }: { id?: string }) { }, []); return ( -
- {taxonomies && ( -
+ +
+ + {canEdit && taxonomies && ( +
{taxonomies.map((tax, index) => ( diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx index e04740b..b12f419 100755 --- a/apps/web/src/routes/index.tsx +++ b/apps/web/src/routes/index.tsx @@ -71,8 +71,8 @@ export const routes: CustomRouteObject[] = [ { path: "editor/:id?", element: - - , + + , }, ], },