From 2c0a4631bcfdd82b227a1c63ecac7076b2680352 Mon Sep 17 00:00:00 2001 From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com> Date: Sat, 17 Feb 2024 12:56:13 +0900 Subject: [PATCH] sidebar --- frontend/app/layout.tsx | 4 +- frontend/app/projects/[id]/layout.tsx | 7 ++ frontend/app/projects/[id]/main.tsx | 11 ++-- frontend/app/projects/[id]/page.tsx | 6 +- frontend/app/projects/[id]/sidebar.tsx | 24 ++++--- frontend/app/projects/layout.tsx | 8 +-- frontend/app/projects/page.tsx | 22 +++---- frontend/app/projects/project-card.tsx | 4 +- frontend/components/icons.tsx | 89 ++++++++++++++++++++------ frontend/components/navbar.tsx | 1 - 10 files changed, 117 insertions(+), 59 deletions(-) create mode 100644 frontend/app/projects/[id]/layout.tsx diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index d2ef180..fbc2af9 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -40,9 +40,7 @@ export default function RootLayout({
-
- {children} -
+
{children}
{/*
{children}; +} diff --git a/frontend/app/projects/[id]/main.tsx b/frontend/app/projects/[id]/main.tsx index 1bea9bb..31053cf 100644 --- a/frontend/app/projects/[id]/main.tsx +++ b/frontend/app/projects/[id]/main.tsx @@ -1,14 +1,11 @@ import React from "react"; -import Sidebar from "./sidebar"; export default function Main() { return ( - - {/* ここにページの内容を配置 */} -
-

Main Content

-

This is the main content of the page.

+
+
+ aaa
- +
); } diff --git a/frontend/app/projects/[id]/page.tsx b/frontend/app/projects/[id]/page.tsx index 0ce80ea..f0490a0 100644 --- a/frontend/app/projects/[id]/page.tsx +++ b/frontend/app/projects/[id]/page.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import Config from "@/config/config"; const apiServer = Config.apiServer; import Main from "./main"; +import Sidebar from "./sidebar"; /** * fetch folder records @@ -60,7 +61,10 @@ export default function Page({ params }: { params: { id: string } }) {
))}
*/} -
+
+ +
+
); } diff --git a/frontend/app/projects/[id]/sidebar.tsx b/frontend/app/projects/[id]/sidebar.tsx index f95a4af..cfb5811 100644 --- a/frontend/app/projects/[id]/sidebar.tsx +++ b/frontend/app/projects/[id]/sidebar.tsx @@ -1,16 +1,20 @@ import { Menu, MenuItem } from "@nextui-org/react"; +import { HomeIcon, PagesIcon, PlayIcon } from "@/components/icons"; -export default function Sidebar({ children }) { +export default function Sidebar() { return ( -
-
- - Menu Item 1 - Menu Item 2 - Menu Item 3 - -
-
{children}
+
+ + } className="p-3"> + Home + + } className="p-3"> + Test Cases + + } className="p-3"> + Test Runs + +
); } diff --git a/frontend/app/projects/layout.tsx b/frontend/app/projects/layout.tsx index d956917..7259ddf 100644 --- a/frontend/app/projects/layout.tsx +++ b/frontend/app/projects/layout.tsx @@ -3,9 +3,5 @@ export default function ProjectsLayout({ }: { children: React.ReactNode; }) { - return ( - <> - {children} - - ); -} \ No newline at end of file + return <>{children}; +} diff --git a/frontend/app/projects/page.tsx b/frontend/app/projects/page.tsx index b094408..8a4417b 100644 --- a/frontend/app/projects/page.tsx +++ b/frontend/app/projects/page.tsx @@ -145,7 +145,7 @@ export default function ProjectsPage() { }; return ( -
+

Projects

+
+ {projects.map((project, index) => ( + + ))} +
+ Modal Title @@ -193,16 +203,6 @@ export default function ProjectsPage() { - -
- {projects.map((project, index) => ( - - ))} -
); } diff --git a/frontend/app/projects/project-card.tsx b/frontend/app/projects/project-card.tsx index ca6800f..e4b2ae9 100644 --- a/frontend/app/projects/project-card.tsx +++ b/frontend/app/projects/project-card.tsx @@ -11,8 +11,8 @@ import NextLink from "next/link"; export function ProjectCard({ projectName, projectDetail }) { return ( - - + + nextui logo ( ); -export const NextUILogo: React.FC = (props) => { - const { width, height = 40 } = props; - +export const HomeIcon: React.FC = ({ + size = 24, + width, + height, + ...props +}) => { return ( + + + + + + ); +}; + +export const PagesIcon: React.FC = ({ + size = 24, + width, + height, + ...props +}) => { + return ( + + + + + + + ); +}; + +export const PlayIcon: React.FC = ({ + size = 24, + width, + height, + ...props +}) => { + return ( + - - ); diff --git a/frontend/components/navbar.tsx b/frontend/components/navbar.tsx index 7dab529..358d203 100644 --- a/frontend/components/navbar.tsx +++ b/frontend/components/navbar.tsx @@ -14,7 +14,6 @@ import { import { siteConfig } from "@/config/site"; import NextLink from "next/link"; -import clsx from "clsx"; import { ThemeSwitch } from "@/components/theme-switch"; import { GithubIcon, SearchIcon } from "@/components/icons";