From a220230d0b7a669e00611292185e3e7de279b72e Mon Sep 17 00:00:00 2001 From: Laux Dev <2201104208@student.buksu.edu.ph> Date: Tue, 17 Mar 2026 17:02:41 +0800 Subject: [PATCH] add --- frontend/src/app/agents/page.jsx | 49 +++--- frontend/src/app/agents/styles.module.css | 11 +- .../src/app/components/icons/hamburger.jsx | 5 +- frontend/src/app/components/navbar/Navbar.jsx | 84 +++++++++- .../navbar/navleft/styles.module.css | 2 +- .../components/navbar/navright/Profile.jsx | 51 +++--- .../navbar/navright/styles.module.css | 10 +- .../app/components/navbar/styles.module.css | 145 +++++++++++++++++- .../src/app/components/sidebar/Sidebar.jsx | 32 ++-- frontend/src/app/globals.css | 2 +- frontend/src/app/hooks/useIsMobile.jsx | 2 +- frontend/src/app/hooks/useNagivation.jsx | 36 +++++ frontend/src/app/organization/page.jsx | 45 +++--- .../src/app/organization/styles.module.css | 9 ++ frontend/src/app/projects/page.jsx | 51 +++--- frontend/src/app/projects/styles.module.css | 9 ++ 16 files changed, 412 insertions(+), 131 deletions(-) create mode 100644 frontend/src/app/hooks/useNagivation.jsx diff --git a/frontend/src/app/agents/page.jsx b/frontend/src/app/agents/page.jsx index cf12780..d5269ea 100644 --- a/frontend/src/app/agents/page.jsx +++ b/frontend/src/app/agents/page.jsx @@ -112,30 +112,32 @@ const AgentsPage = () => { topbarTitle="Agents" requiredButtons={["title", "add", "search"]} /> - {isMobile ? ( -
- - {sampleData.map((data, key) => { + +
+ + {isMobile && + sampleData.map((data, key) => { return ; })} -
- ) : ( -
- - - - - - - - + - - - +
+
NameEndpointTypeProxy NameDate Created
+ + + + + + + - - {sampleData.map((org, index) => { + + + + + + {!isMobile && + sampleData.map((org, index) => { return ( { ); })} - -
NameEndpointTypeProxy NameDate Created
-
- )} + + +
diff --git a/frontend/src/app/agents/styles.module.css b/frontend/src/app/agents/styles.module.css index 2c9f896..67caf4b 100644 --- a/frontend/src/app/agents/styles.module.css +++ b/frontend/src/app/agents/styles.module.css @@ -86,7 +86,15 @@ align-items: flex-start; gap: 12px; align-self: stretch; - overflow: auto; + display: none; +} +@media (max-width: 768px) { + .cardContainer { + display: flex; + } + .tableContainer { + display: none; + } } .searchBarContainer { display: flex; @@ -103,7 +111,6 @@ background-color: transparent; border: none; outline: none; - background-color: transparent; color: white; font-family: Inter; font-size: 16px; diff --git a/frontend/src/app/components/icons/hamburger.jsx b/frontend/src/app/components/icons/hamburger.jsx index 8ff361a..67d9c05 100644 --- a/frontend/src/app/components/icons/hamburger.jsx +++ b/frontend/src/app/components/icons/hamburger.jsx @@ -1,6 +1,6 @@ import React from "react"; -const hamburger = () => { +const hamburger = (props) => { return ( { height={24} viewBox="0 0 24 24" fill="none" + {...props} > diff --git a/frontend/src/app/components/navbar/Navbar.jsx b/frontend/src/app/components/navbar/Navbar.jsx index 9008eb9..1961f12 100644 --- a/frontend/src/app/components/navbar/Navbar.jsx +++ b/frontend/src/app/components/navbar/Navbar.jsx @@ -1,19 +1,99 @@ "use client"; -import React from "react"; +import React, { useState } from "react"; import styles from "./styles.module.css"; import NavLeft from "./navleft/Header"; import NavRight from "./navright/Profile"; import HamburgerIcon from "../../components/icons/hamburger"; import useIsMobile from "@/app/hooks/useIsMobile"; +import LogoIcon from "../icons/logo"; +import HomeIcon from "../icons/home"; +import OrganizationIcon from "../icons/organization"; +import ProjectIcon from "../icons/project"; +import UserIcon from "../icons/user"; +import RolesIcon from "../icons/roles"; +import CredentialsIcon from "../icons/credentials"; +import AgentIcon from "../icons/agent"; +import DownloadIcon from "../icons/download"; +import useNavigations from "@/app/hooks/useNagivation"; const Navbar = () => { + const [triggerDropDown, setTriggerDropDown] = useState(false); + const { + navToAgents, + navToCredentials, + navToProject, + navToRoles, + navToHome, + navToOrganization, + navToUsers, + } = useNavigations(); + const isMobile = useIsMobile(); return (
{/* Mobile Hamburger Button */}
- {isMobile && } +
+ setTriggerDropDown(!triggerDropDown)} + className={triggerDropDown ? styles.active : ""} + /> + {triggerDropDown && ( +
+
+
+
+ +
+
+

Internal Developer Platform

+

By Project Moonshot Inc.

+
+
+
+
+
+ +

Home

+
+
+ +

Organization

+
+
+ +

Project

+
+
+ +

Users

+
+
+ +

Roles

+
+
+ +

Credentials

+
+
+ +

Agents

+
+
+
+
+
+

Download ICTL v3

+ +
+
+
+
+ )} +
+
{/* Mobile Menu Button */} diff --git a/frontend/src/app/components/navbar/navleft/styles.module.css b/frontend/src/app/components/navbar/navleft/styles.module.css index a1570a0..09043f0 100644 --- a/frontend/src/app/components/navbar/navleft/styles.module.css +++ b/frontend/src/app/components/navbar/navleft/styles.module.css @@ -91,7 +91,7 @@ background: #2d3143; box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25); position: absolute; - z-index: 1; + z-index: 4; top: 100%; margin-top: 8px; left: 0; diff --git a/frontend/src/app/components/navbar/navright/Profile.jsx b/frontend/src/app/components/navbar/navright/Profile.jsx index 107b235..c88ffe7 100644 --- a/frontend/src/app/components/navbar/navright/Profile.jsx +++ b/frontend/src/app/components/navbar/navright/Profile.jsx @@ -19,35 +19,36 @@ const Profile = () => { {/* Profile Section */}
{/* Profile */} - {!isMobile && ( -
setOpen(!open)}> - {/* Username and Role*/} - {sampleData.map((data, index) => { - return ( -
-

{data.name}

-

{data.role}

-
- ); - })} - {/* User profile*/} -
-
- -
+
setOpen(!open)} + > + {/* Username and Role*/} + {sampleData.map((data, index) => { + return ( +
+

{data.name}

+

{data.role}

+
+ ); + })} + + {/* User profile*/} +
+
+
- )} +
{/* Mobile Ellipsis */} - {isMobile && ( -
setOpen(!open)} - > - -
- )} + +
setOpen(!open)} + > + +
{/* Dropdown */} {open && } diff --git a/frontend/src/app/components/navbar/navright/styles.module.css b/frontend/src/app/components/navbar/navright/styles.module.css index ab949f0..288f9d3 100644 --- a/frontend/src/app/components/navbar/navright/styles.module.css +++ b/frontend/src/app/components/navbar/navright/styles.module.css @@ -7,7 +7,8 @@ cursor: pointer; position: relative; } -.profileBadge { +.profileBadge, +.profileBadgeButton { display: flex; padding: 6px 0 6px 8px; justify-content: flex-end; @@ -153,6 +154,9 @@ .rotated { transform: rotate(90deg); } +.mobileEllipsis { + display: none; +} .mobileEllipsis.active { color: #959aff; } @@ -183,7 +187,9 @@ cursor: pointer; color: #85869b; } - + .profileBadgeButton { + display: none; + } .profileBadge { display: flex; padding: 12px 16px; diff --git a/frontend/src/app/components/navbar/styles.module.css b/frontend/src/app/components/navbar/styles.module.css index a834977..ad94451 100644 --- a/frontend/src/app/components/navbar/styles.module.css +++ b/frontend/src/app/components/navbar/styles.module.css @@ -9,14 +9,154 @@ } /* Mobile */ + +.hamburgerMenu { + display: none; + height: 61px; + padding-left: 16px; + align-items: center; + gap: 10px; + flex-shrink: 0; + cursor: pointer; +} +.active path { + color: #8187ff; +} +.dropDownMenu { + display: flex; + width: 100vw; + flex-direction: column; + align-items: center; + position: absolute; + background: linear-gradient(0deg, #2d3143 0%, #191a24 100%); + left: 0; + z-index: 2; + top: 60px; + animation-name: dropDownAnimation; + animation-duration: 200ms; +} +.headings { + display: flex; + padding: 32px 16px 16px 16px; + flex-direction: column; + align-items: center; + gap: 24px; + align-self: stretch; +} +.headings > div { + display: flex; + padding-right: 6px; + align-items: center; + gap: 8px; + align-self: stretch; +} +.logoContainer { + display: flex; + width: 50px; + height: 50px; + justify-content: center; + align-items: center; + gap: 9px; + aspect-ratio: 1/1; +} + +.info { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + gap: 4px; + flex: 1 0 0; +} + +.info p { + color: #85869b; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; + letter-spacing: 0.07px; +} +.info > p:nth-child(1) { + color: #fff; + font-size: 18px; + font-weight: 500; + line-height: 18px; /* 100% */ +} +.navs { + display: flex; + padding: 16px 0; + flex-direction: column; + align-items: flex-start; + align-self: stretch; +} +.nav { + display: flex; + padding: 8px 16px; + align-items: center; + gap: 16px; + align-self: stretch; +} +.nav:hover { + background: rgba(149, 154, 255, 0.05); +} +.nav path { + stroke: #858699; +} +.nav:hover path { + stroke: #d2d3e0; +} +.nav p { + color: #d2d3e1; + font-size: 18px; + font-weight: 400; + line-height: normal; +} +.footer { + display: flex; + padding: 16px; + flex-direction: column; + align-items: flex-start; + gap: 10px; + align-self: stretch; +} +.footer > div { + display: flex; + padding: 12px 16px; + flex-direction: column; + align-items: flex-start; + gap: 24px; + align-self: stretch; + border-radius: 8px; + background: #1d1e2c; +} +.footer > div > div { + display: flex; + height: 24px; + justify-content: space-between; + align-items: center; + align-self: stretch; +} + +@keyframes dropDownAnimation { + 0% { + opacity: 0; + transform: translateY(-5%); + } + 100% { + opacity: 1; + transform: translateY(0); + } +} @media (max-width: 768px) { .mobileHamburger { display: flex; height: 61px; - padding-left: 16px; + align-items: center; gap: 10px; flex-shrink: 0; + position: relative; } .mainContainer { @@ -25,4 +165,7 @@ align-items: center; border-bottom: none; } + .hamburgerMenu { + display: flex; + } } diff --git a/frontend/src/app/components/sidebar/Sidebar.jsx b/frontend/src/app/components/sidebar/Sidebar.jsx index b10e182..79b6fc1 100644 --- a/frontend/src/app/components/sidebar/Sidebar.jsx +++ b/frontend/src/app/components/sidebar/Sidebar.jsx @@ -13,31 +13,19 @@ import AgentIcon from "../icons/agent"; import DownloadIcon from "../icons/download"; import LogoIcon from "../icons/logo"; import ArrowDownIcon from "../icons/arrowDown"; +import useNavigations from "@/app/hooks/useNagivation"; const Sidebar = () => { - const router = useRouter(); const [isCollapsed, setIsCollapsed] = useState(false); - const navToHome = () => { - router.push("/home"); - }; - const navToOrganization = () => { - router.push("/organization"); - }; - const navToProject = () => { - router.push("/projects"); - }; - const navToUsers = () => { - router.push("/users"); - }; - const navToRoles = () => { - router.push("/roles"); - }; - const navToCredentials = () => { - router.push("/credentials"); - }; - const navToAgents = () => { - router.push("/agents"); - }; + const { + navToAgents, + navToCredentials, + navToProject, + navToRoles, + navToHome, + navToOrganization, + navToUsers, + } = useNavigations(); const pathname = usePathname(); return ( diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index 3bf291a..73a4924 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -55,7 +55,7 @@ a { } @media (max-width: 900px) { :root { - --table-font-size: 9px; + --table-font-size: 10px; } } @media (max-width: 500px) { diff --git a/frontend/src/app/hooks/useIsMobile.jsx b/frontend/src/app/hooks/useIsMobile.jsx index 32b0027..c174472 100644 --- a/frontend/src/app/hooks/useIsMobile.jsx +++ b/frontend/src/app/hooks/useIsMobile.jsx @@ -1,7 +1,7 @@ import { useState, useEffect } from "react"; export default function useIsMobile(breakpoint = 768) { - const [isMobile, setIsMobile] = useState(false); + const [isMobile, setIsMobile] = useState(true); useEffect(() => { const checkScreen = () => { diff --git a/frontend/src/app/hooks/useNagivation.jsx b/frontend/src/app/hooks/useNagivation.jsx new file mode 100644 index 0000000..c857141 --- /dev/null +++ b/frontend/src/app/hooks/useNagivation.jsx @@ -0,0 +1,36 @@ +import { useRouter } from "next/navigation"; +const useNavigations = () => { + const router = useRouter(); + const navToHome = () => { + router.push("/home"); + }; + const navToOrganization = () => { + router.push("/organization"); + }; + const navToProject = () => { + router.push("/projects"); + }; + const navToUsers = () => { + router.push("/users"); + }; + const navToRoles = () => { + router.push("/roles"); + }; + const navToCredentials = () => { + router.push("/credentials"); + }; + const navToAgents = () => { + router.push("/agents"); + }; + + return { + navToHome, + navToAgents, + navToCredentials, + navToOrganization, + navToProject, + navToRoles, + navToUsers, + }; +}; +export default useNavigations; diff --git a/frontend/src/app/organization/page.jsx b/frontend/src/app/organization/page.jsx index 8ea1c70..be07122 100644 --- a/frontend/src/app/organization/page.jsx +++ b/frontend/src/app/organization/page.jsx @@ -68,26 +68,26 @@ const OrganizationPage = () => { topbarTitle="Organization" requiredButtons={["title", "add", "search"]} /> - {isMobile ? ( -
- - {sampleData.map((data, key) => ( - - ))} -
- ) : ( -
- - - - - - - - - - {sampleData.map((org, index) => { +
+ + {isMobile && + sampleData.map((data, key) => )} +
+ +
+
Organization NameDate Created
+ + + + + + + + + + {!isMobile && + sampleData.map((org, index) => { return ( @@ -100,10 +100,9 @@ const OrganizationPage = () => { ); })} - -
Organization NameDate Created
{org.organizationName}
-
- )} + + +
diff --git a/frontend/src/app/organization/styles.module.css b/frontend/src/app/organization/styles.module.css index e9672e7..23c8fcd 100644 --- a/frontend/src/app/organization/styles.module.css +++ b/frontend/src/app/organization/styles.module.css @@ -61,4 +61,13 @@ gap: 12px; align-self: stretch; overflow: auto; + display: none; +} +@media (max-width: 768px) { + .cardContainer { + display: flex; + } + .tableContainer { + display: none; + } } diff --git a/frontend/src/app/projects/page.jsx b/frontend/src/app/projects/page.jsx index 02e20d9..5ea212b 100644 --- a/frontend/src/app/projects/page.jsx +++ b/frontend/src/app/projects/page.jsx @@ -181,33 +181,35 @@ const ProjectsPage = () => { topbarTitle="Project" requiredButtons={["title", "add", "search"]} /> - {isMobile ? ( -
- - {sampleData.map((data, key) => ( + +
+ + {isMobile && + sampleData.map((data, key) => ( router.push("/projects/view")} /> ))} -
- ) : ( -
- - - - - - - - - - - - - - {sampleData.map((project, index) => { + + +
+
NameVersionCPU Used/LimitMemory Used/LimitStorage Used/LimitDate Created
+ + + + + + + + + + + + + {!isMobile && + sampleData.map((project, index) => { return ( { ); })} - -
NameVersionCPU Used/LimitMemory Used/LimitStorage Used/LimitDate Created
-
- )} + + +
diff --git a/frontend/src/app/projects/styles.module.css b/frontend/src/app/projects/styles.module.css index e57aab3..c0047e3 100644 --- a/frontend/src/app/projects/styles.module.css +++ b/frontend/src/app/projects/styles.module.css @@ -92,4 +92,13 @@ gap: 12px; align-self: stretch; overflow: auto; + display: none; +} +@media (max-width: 768px) { + .cardContainer { + display: flex; + } + .tableContainer { + display: none; + } }