This commit is contained in:
Takeshi Kimata
2024-02-16 22:11:59 +09:00
parent 291bad6d56
commit d889655324
6 changed files with 39 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ export default function RootLayout({
)}
>
<Providers themeProps={{ attribute: "class", defaultTheme: "dark" }}>
<div className="relative flex flex-col h-screen">
<div className="relative flex flex-col h-screen bg-slate-100">
<Navbar />
<main className="container mx-auto max-w-7xl pt-16 px-6 flex-grow">
{children}

View File

@@ -0,0 +1,14 @@
import React from "react";
import Sidebar from "./sidebar";
export default function Main() {
return (
<Sidebar>
{/* ここにページの内容を配置 */}
<div className="p-4">
<h1 className="text-2xl font-bold">Main Content</h1>
<p>This is the main content of the page.</p>
</div>
</Sidebar>
);
}

View File

@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import Config from "@/config/config";
const apiServer = Config.apiServer;
import Main from "./main";
/**
* fetch folder records
@@ -48,8 +49,8 @@ export default function Page({ params }: { params: { id: string } }) {
}, []);
return (
<div>
<div>Project: {params.id}</div>
<>
{/* <div>Project: {params.id}</div>
<div className="flex flex-wrap gap-4 mt-5">
{folders.map((folder, index) => (
<div key={index}>
@@ -58,7 +59,8 @@ export default function Page({ params }: { params: { id: string } }) {
<div>{folder.projectId}</div>
</div>
))}
</div>
</div>
</div> */}
<Main />
</>
);
}

View File

@@ -0,0 +1,16 @@
import { Menu, MenuItem } from "@nextui-org/react";
export default function Sidebar({ children }) {
return (
<div className="flex">
<div className="w-64 bg-white rounded-lg m-2">
<Menu openMode="multiple" aria-label="Main Menu">
<MenuItem>Menu Item 1</MenuItem>
<MenuItem>Menu Item 2</MenuItem>
<MenuItem>Menu Item 3</MenuItem>
</Menu>
</div>
<div className="flex-grow bg-white rounded-lg m-2">{children}</div>
</div>
);
}

View File

@@ -134,16 +134,6 @@ export default function ProjectsPage() {
isValid = false;
}
// validate projectDetail
if (!projectDetail.text) {
setProjectDetail({
text: "",
isValid: true,
errorMessage: "Please enter project detail",
});
isValid = false;
}
if (isValid) {
const newProject = await createProject(
projectName.text,

View File

@@ -11,8 +11,8 @@ import NextLink from "next/link";
export function ProjectCard({ projectName, projectDetail }) {
return (
<NextLink href={`/projects/${1}`}>
<Card className="w-[250px] hover:bg-slate-200">
<CardHeader className="flex gap-3">
<Card className="w-[250px] h-36 hover:bg-slate-200">
<CardHeader className="flex gap-3 h-16">
<Image
alt="nextui logo"
height={40}