sidebar
This commit is contained in:
14
frontend/app/projects/[id]/main.tsx
Normal file
14
frontend/app/projects/[id]/main.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
@@ -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 />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
16
frontend/app/projects/[id]/sidebar.tsx
Normal file
16
frontend/app/projects/[id]/sidebar.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user