sidebar
This commit is contained in:
@@ -38,7 +38,7 @@ export default function RootLayout({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Providers themeProps={{ attribute: "class", defaultTheme: "dark" }}>
|
<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 />
|
<Navbar />
|
||||||
<main className="container mx-auto max-w-7xl pt-16 px-6 flex-grow">
|
<main className="container mx-auto max-w-7xl pt-16 px-6 flex-grow">
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
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 { useEffect, useState } from "react";
|
||||||
import Config from "@/config/config";
|
import Config from "@/config/config";
|
||||||
const apiServer = Config.apiServer;
|
const apiServer = Config.apiServer;
|
||||||
|
import Main from "./main";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch folder records
|
* fetch folder records
|
||||||
@@ -48,8 +49,8 @@ export default function Page({ params }: { params: { id: string } }) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<div>Project: {params.id}</div>
|
{/* <div>Project: {params.id}</div>
|
||||||
<div className="flex flex-wrap gap-4 mt-5">
|
<div className="flex flex-wrap gap-4 mt-5">
|
||||||
{folders.map((folder, index) => (
|
{folders.map((folder, index) => (
|
||||||
<div key={index}>
|
<div key={index}>
|
||||||
@@ -58,7 +59,8 @@ export default function Page({ params }: { params: { id: string } }) {
|
|||||||
<div>{folder.projectId}</div>
|
<div>{folder.projectId}</div>
|
||||||
</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;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate projectDetail
|
|
||||||
if (!projectDetail.text) {
|
|
||||||
setProjectDetail({
|
|
||||||
text: "",
|
|
||||||
isValid: true,
|
|
||||||
errorMessage: "Please enter project detail",
|
|
||||||
});
|
|
||||||
isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
const newProject = await createProject(
|
const newProject = await createProject(
|
||||||
projectName.text,
|
projectName.text,
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import NextLink from "next/link";
|
|||||||
export function ProjectCard({ projectName, projectDetail }) {
|
export function ProjectCard({ projectName, projectDetail }) {
|
||||||
return (
|
return (
|
||||||
<NextLink href={`/projects/${1}`}>
|
<NextLink href={`/projects/${1}`}>
|
||||||
<Card className="w-[250px] hover:bg-slate-200">
|
<Card className="w-[250px] h-36 hover:bg-slate-200">
|
||||||
<CardHeader className="flex gap-3">
|
<CardHeader className="flex gap-3 h-16">
|
||||||
<Image
|
<Image
|
||||||
alt="nextui logo"
|
alt="nextui logo"
|
||||||
height={40}
|
height={40}
|
||||||
|
|||||||
Reference in New Issue
Block a user