refactor to pages

This commit is contained in:
Janis
2023-01-29 20:01:56 +01:00
parent 976a11a78f
commit 0997e8fdb8
26 changed files with 2050 additions and 1252 deletions

View File

@@ -1,3 +1,3 @@
export default async function Layout({ children }) {
export default async function AdminArticleEditorLayout({ children }) {
return <div>{children}</div>;
}

View File

@@ -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>([]);

View File

@@ -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;

View File

@@ -1,3 +1,3 @@
export default async function Layout({ children }) {
export default async function AdminCategoriesEditorLayout({ children }) {
return <div>{children}</div>;
}

View File

@@ -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>("");

View File

@@ -19,6 +19,6 @@ async function getImages(): Promise<GalleryImage[]> {
}));
}
export default async function page() {
export default async function AdminImagesPage() {
return <Gallery images={await getImages()} />;
}