mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-30 13:17:13 +01:00
refactor to pages
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export default async function Layout({ children }) {
|
||||
export default async function AdminArticleEditorLayout({ children }) {
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import Markdown from "../../../../../components/Markdown";
|
||||
|
||||
type ArticleWithCategory = Prisma.ArticleGetPayload<{ include: { category: true } }>;
|
||||
|
||||
export default function ArticleEditor({ params }: { params: { articleId: string } }) {
|
||||
export default function AdminArticlesEditorPage({ params }: { params: { articleId: string } }) {
|
||||
const router = useRouter();
|
||||
const [title, setTitle] = useState<string>("");
|
||||
const [selectCategoriesOptions, setSelectCategoriesOptions] = useState<any>([]);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import React from "react";
|
||||
|
||||
function AdminArticlesPage() {
|
||||
export default function AdminArticlesPage() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Page to manage articles</h1>
|
||||
@@ -11,5 +11,3 @@ function AdminArticlesPage() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default AdminArticlesPage;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default async function Layout({ children }) {
|
||||
export default async function AdminCategoriesEditorLayout({ children }) {
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { apiUrl } from "../../../../../global";
|
||||
|
||||
type CategoryWithSvg = Prisma.CategoryGetPayload<{ include: { svg: true } }>;
|
||||
|
||||
export default function CategoryEditor({ params }: { params: { categoryId: string } }) {
|
||||
export default function AdminCategoriesEditor({ params }: { params: { categoryId: string } }) {
|
||||
const router = useRouter();
|
||||
const [title, setTitle] = useState<string>("");
|
||||
const [color, setColor] = useState<string>("");
|
||||
|
||||
@@ -19,6 +19,6 @@ async function getImages(): Promise<GalleryImage[]> {
|
||||
}));
|
||||
}
|
||||
|
||||
export default async function page() {
|
||||
export default async function AdminImagesPage() {
|
||||
return <Gallery images={await getImages()} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user