update
This commit is contained in:
19
app/(articles)/branch-life-sketch/[articleId]/layout.tsx
Normal file
19
app/(articles)/branch-life-sketch/[articleId]/layout.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { ReactNode } from "react";
|
||||
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||
|
||||
const Layout = ({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
params: {
|
||||
articleId: string;
|
||||
};
|
||||
}) => {
|
||||
return (
|
||||
<ArticleLayout leftNavTitle={"分院生活剪影"} navigations={[]}>
|
||||
{children}
|
||||
</ArticleLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
24
app/(articles)/branch-life-sketch/[articleId]/page.tsx
Normal file
24
app/(articles)/branch-life-sketch/[articleId]/page.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { articleDetail } from "@/app/api/articles";
|
||||
import ArticleRender from "@/app/components/ArticleRender";
|
||||
import ArticleWithBreadcrumb from "@/app/components/ArticleWithBreadcrumb";
|
||||
|
||||
export default async function Article({
|
||||
params,
|
||||
}: {
|
||||
params: {
|
||||
articleId: string;
|
||||
};
|
||||
}) {
|
||||
const data = await articleDetail({ id: params.articleId });
|
||||
return (
|
||||
<ArticleWithBreadcrumb
|
||||
breadcrumb={[
|
||||
{ title: "首页", href: "/" },
|
||||
{ title: "分院生活剪影", href: "/branch-life-sketch/pages/1" },
|
||||
{ title: data.title, href: `/branch-life-sketch/${data.id}` },
|
||||
]}
|
||||
>
|
||||
<ArticleRender article={data} />
|
||||
</ArticleWithBreadcrumb>
|
||||
);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import { ReactNode } from "react";
|
||||
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||
import { BreadcrumbItem } from "@/app/components/Breadcrumb";
|
||||
import ArticleWithBreadcrumb from "@/app/components/ArticleWithBreadcrumb";
|
||||
|
||||
const breadcrumb: BreadcrumbItem[] = [
|
||||
{ title: "首页", href: "/" },
|
||||
{ title: "分院生活剪影", href: "/branch-life-sketch/pages/1" },
|
||||
];
|
||||
|
||||
const Layout = ({ children }: { children: ReactNode }) => {
|
||||
return (
|
||||
<ArticleLayout navigations={[]} leftNavTitle={"综合新闻"}>
|
||||
<ArticleWithBreadcrumb breadcrumb={breadcrumb}>
|
||||
{children}
|
||||
</ArticleWithBreadcrumb>
|
||||
</ArticleLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
23
app/(articles)/branch-life-sketch/pages/[pageIndex]/page.tsx
Normal file
23
app/(articles)/branch-life-sketch/pages/[pageIndex]/page.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import React from "react";
|
||||
import ArticleList from "@/app/components/ArticleList";
|
||||
|
||||
const Page = ({
|
||||
params,
|
||||
}: {
|
||||
params: {
|
||||
pageIndex: string;
|
||||
};
|
||||
}) => {
|
||||
const { pageIndex } = params;
|
||||
return (
|
||||
<>
|
||||
<ArticleList
|
||||
title={"分院生活剪影"}
|
||||
cid={"13"}
|
||||
pageNo={parseInt(pageIndex)}
|
||||
></ArticleList>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
Reference in New Issue
Block a user