From 56da8d9db847ed2a796c7ce526321d73de29d79c Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 20 Nov 2026 23:05:45 +0530 Subject: [PATCH 1/3] feat(platform): #222: create responsive dashboard UI and unified navigation layout --- .gitignore | 1 + .../app/components/bits/Badge/index.tsx | 40 ++ .../components/bits/Badge/styles.module.css | 92 ++++ .../app/components/bits/Card/index.tsx | 45 ++ .../components/bits/Card/styles.module.css | 34 ++ .../app/components/bits/Table/Table/index.tsx | 25 ++ .../bits/Table/Table/styles.module.css | 9 + .../components/bits/Table/TableBody/index.tsx | 25 ++ .../bits/Table/TableBody/styles.module.css | 3 + .../components/bits/Table/TableCell/index.tsx | 25 ++ .../bits/Table/TableCell/styles.module.css | 5 + .../bits/Table/TableContainer/index.tsx | 25 ++ .../Table/TableContainer/styles.module.css | 5 + .../components/bits/Table/TableHead/index.tsx | 25 ++ .../bits/Table/TableHead/styles.module.css | 10 + .../bits/Table/TableHeader/index.tsx | 25 ++ .../bits/Table/TableHeader/styles.module.css | 3 + .../components/bits/Table/TableRow/index.tsx | 25 ++ .../bits/Table/TableRow/styles.module.css | 12 + .../app/components/bits/Table/index.ts | 7 + .../app/components/items/AppNavbar/index.tsx | 217 +++++++++ .../items/AppNavbar/styles.module.css | 275 ++++++++++++ .../app/components/items/AppShell/index.tsx | 74 ++++ .../items/AppShell/styles.module.css | 81 ++++ .../app/components/items/AppSidebar/index.tsx | 304 +++++++++++++ .../items/AppSidebar/styles.module.css | 331 ++++++++++++++ .../app/components/items/Table/index.tsx | 114 +++++ .../components/items/Table/styles.module.css | 10 + .../dashboard/ProjectsMetrics/index.tsx | 93 ++++ .../ProjectsMetrics/styles.module.css | 105 +++++ .../dashboard/ProjectsTable/index.tsx | 373 ++++++++++++++++ .../dashboard/ProjectsTable/styles.module.css | 281 ++++++++++++ .../platform/app/dashboard/billing/page.tsx | 237 ++++++++++ rocket/platform/app/dashboard/layout.tsx | 41 ++ .../app/dashboard/new-project/page.tsx | 5 + rocket/platform/app/dashboard/new/page.tsx | 164 +++++++ rocket/platform/app/dashboard/page.tsx | 382 ++-------------- .../platform/app/dashboard/settings/page.tsx | 139 ++++++ .../platform/app/dashboard/styles.module.css | 417 +++--------------- rocket/platform/app/dashboard/usage/page.tsx | 180 ++++++++ rocket/platform/app/icons/BellIcon.tsx | 23 + rocket/platform/app/icons/ChevronDownIcon.tsx | 22 + rocket/platform/app/icons/ChevronLeftIcon.tsx | 22 + .../platform/app/icons/ChevronRightIcon.tsx | 22 + rocket/platform/app/icons/CreditCardIcon.tsx | 23 + .../platform/app/icons/ExternalLinkIcon.tsx | 24 + rocket/platform/app/icons/EyeIcon.tsx | 23 + rocket/platform/app/icons/FileTextIcon.tsx | 26 ++ .../platform/app/icons/MoreHorizontalIcon.tsx | 24 + rocket/platform/app/icons/PauseIcon.tsx | 23 + rocket/platform/app/icons/PencilIcon.tsx | 23 + rocket/platform/app/icons/PlayIcon.tsx | 22 + rocket/platform/app/icons/SearchIcon.tsx | 23 + rocket/platform/app/icons/SettingsIcon.tsx | 23 + .../platform/app/icons/SidebarToggleIcon.tsx | 23 + rocket/platform/app/icons/TrashIcon.tsx | 26 ++ rocket/platform/app/icons/TrendUpIcon.tsx | 23 + rocket/platform/app/icons/index.ts | 17 + 58 files changed, 3961 insertions(+), 715 deletions(-) create mode 100644 rocket/platform/app/components/bits/Badge/index.tsx create mode 100644 rocket/platform/app/components/bits/Badge/styles.module.css create mode 100644 rocket/platform/app/components/bits/Card/index.tsx create mode 100644 rocket/platform/app/components/bits/Card/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/Table/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/Table/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableBody/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableBody/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableCell/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableCell/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableContainer/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableContainer/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableHead/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableHead/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableHeader/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableHeader/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/TableRow/index.tsx create mode 100644 rocket/platform/app/components/bits/Table/TableRow/styles.module.css create mode 100644 rocket/platform/app/components/bits/Table/index.ts create mode 100644 rocket/platform/app/components/items/AppNavbar/index.tsx create mode 100644 rocket/platform/app/components/items/AppNavbar/styles.module.css create mode 100644 rocket/platform/app/components/items/AppShell/index.tsx create mode 100644 rocket/platform/app/components/items/AppShell/styles.module.css create mode 100644 rocket/platform/app/components/items/AppSidebar/index.tsx create mode 100644 rocket/platform/app/components/items/AppSidebar/styles.module.css create mode 100644 rocket/platform/app/components/items/Table/index.tsx create mode 100644 rocket/platform/app/components/items/Table/styles.module.css create mode 100644 rocket/platform/app/container/dashboard/ProjectsMetrics/index.tsx create mode 100644 rocket/platform/app/container/dashboard/ProjectsMetrics/styles.module.css create mode 100644 rocket/platform/app/container/dashboard/ProjectsTable/index.tsx create mode 100644 rocket/platform/app/container/dashboard/ProjectsTable/styles.module.css create mode 100644 rocket/platform/app/dashboard/billing/page.tsx create mode 100644 rocket/platform/app/dashboard/layout.tsx create mode 100644 rocket/platform/app/dashboard/new-project/page.tsx create mode 100644 rocket/platform/app/dashboard/new/page.tsx create mode 100644 rocket/platform/app/dashboard/settings/page.tsx create mode 100644 rocket/platform/app/dashboard/usage/page.tsx create mode 100644 rocket/platform/app/icons/BellIcon.tsx create mode 100644 rocket/platform/app/icons/ChevronDownIcon.tsx create mode 100644 rocket/platform/app/icons/ChevronLeftIcon.tsx create mode 100644 rocket/platform/app/icons/ChevronRightIcon.tsx create mode 100644 rocket/platform/app/icons/CreditCardIcon.tsx create mode 100644 rocket/platform/app/icons/ExternalLinkIcon.tsx create mode 100644 rocket/platform/app/icons/EyeIcon.tsx create mode 100644 rocket/platform/app/icons/FileTextIcon.tsx create mode 100644 rocket/platform/app/icons/MoreHorizontalIcon.tsx create mode 100644 rocket/platform/app/icons/PauseIcon.tsx create mode 100644 rocket/platform/app/icons/PencilIcon.tsx create mode 100644 rocket/platform/app/icons/PlayIcon.tsx create mode 100644 rocket/platform/app/icons/SearchIcon.tsx create mode 100644 rocket/platform/app/icons/SettingsIcon.tsx create mode 100644 rocket/platform/app/icons/SidebarToggleIcon.tsx create mode 100644 rocket/platform/app/icons/TrashIcon.tsx create mode 100644 rocket/platform/app/icons/TrendUpIcon.tsx diff --git a/.gitignore b/.gitignore index 11f14f6..8e99fbe 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,4 @@ Rocket Platform* # Next.js types next-env.d.ts +.DS_Store diff --git a/rocket/platform/app/components/bits/Badge/index.tsx b/rocket/platform/app/components/bits/Badge/index.tsx new file mode 100644 index 0000000..4a6ba88 --- /dev/null +++ b/rocket/platform/app/components/bits/Badge/index.tsx @@ -0,0 +1,40 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface BadgeProps extends React.HTMLAttributes { + variant?: 'default' | 'active' | 'deploying' | 'paused' | 'count' | 'keycap'; + size?: 'sm' | 'md'; + dot?: boolean; + children: React.ReactNode; + className?: string; +} + +export function Badge({ + variant = 'default', + size = 'md', + dot = false, + children, + className = '', + ...props +}: BadgeProps): React.JSX.Element { + const showDot = + dot || + variant === 'active' || + variant === 'deploying' || + variant === 'paused'; + + return ( + + {showDot && + ); +} + +export default Badge; diff --git a/rocket/platform/app/components/bits/Badge/styles.module.css b/rocket/platform/app/components/bits/Badge/styles.module.css new file mode 100644 index 0000000..d529288 --- /dev/null +++ b/rocket/platform/app/components/bits/Badge/styles.module.css @@ -0,0 +1,92 @@ +.badge { + display: inline-flex; + align-items: center; + gap: 6px; + font-family: var(--font-inter), system-ui, sans-serif; + font-weight: 500; + border-radius: 9999px; + white-space: nowrap; + line-height: 1; + transition: all 0.15s ease; +} + +/* Sizes */ +.sm { + font-size: 11px; + padding: 3px 8px; +} + +.md { + font-size: 12px; + padding: 4px 10px; +} + +/* Indicator dot */ +.dot { + width: 6px; + height: 6px; + border-radius: 9999px; + display: inline-block; + flex-shrink: 0; +} + +/* Variants */ +.default { + background: rgba(255, 255, 255, 0.06); + color: #c9c9d9; + border: 1px solid rgba(255, 255, 255, 0.08); +} + +.active { + background: rgba(16, 185, 129, 0.12); + color: #34d399; + border: 1px solid rgba(16, 185, 129, 0.25); +} + +.active .dot { + background: #10b981; + box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); +} + +.deploying { + background: rgba(245, 158, 11, 0.12); + color: #fbbf24; + border: 1px solid rgba(245, 158, 11, 0.25); +} + +.deploying .dot { + background: #f59e0b; + box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); +} + +.paused { + background: rgba(148, 163, 184, 0.12); + color: #94a3b8; + border: 1px solid rgba(148, 163, 184, 0.2); +} + +.paused .dot { + background: #64748b; +} + +.count { + background: rgba(255, 255, 255, 0.08); + color: #f7f7fa; + font-size: 11px; + font-weight: 600; + padding: 2px 7px; + min-width: 18px; + justify-content: center; + border-radius: 9999px; +} + +.keycap { + background: rgba(255, 255, 255, 0.05); + color: #8f90a6; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 4px; + font-size: 11px; + font-family: inherit; + padding: 2px 5px; + line-height: 1.2; +} diff --git a/rocket/platform/app/components/bits/Card/index.tsx b/rocket/platform/app/components/bits/Card/index.tsx new file mode 100644 index 0000000..b01db60 --- /dev/null +++ b/rocket/platform/app/components/bits/Card/index.tsx @@ -0,0 +1,45 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface CardProps extends React.HTMLAttributes { + padding?: 'none' | 'sm' | 'md' | 'lg'; + interactive?: boolean; + className?: string; + children: React.ReactNode; +} + +export function Card({ + padding = 'md', + interactive = false, + className = '', + children, + ...props +}: CardProps): React.JSX.Element { + const padClass = + padding === 'none' + ? styles.padNone + : padding === 'sm' + ? styles.padSm + : padding === 'lg' + ? styles.padLg + : styles.padMd; + + return ( +
+ {children} +
+ ); +} + +export default Card; diff --git a/rocket/platform/app/components/bits/Card/styles.module.css b/rocket/platform/app/components/bits/Card/styles.module.css new file mode 100644 index 0000000..6472fe6 --- /dev/null +++ b/rocket/platform/app/components/bits/Card/styles.module.css @@ -0,0 +1,34 @@ +.card { + background: #11111a; + border: 1px solid rgba(255, 255, 255, 0.07); + border-radius: 14px; + color: #f7f7fa; + transition: all 0.2s ease; + position: relative; +} + +.padNone { + padding: 0; +} + +.padSm { + padding: 14px 16px; +} + +.padMd { + padding: 20px 22px; +} + +.padLg { + padding: 26px 28px; +} + +.interactive { + cursor: pointer; +} + +.interactive:hover { + border-color: rgba(255, 255, 255, 0.14); + transform: translateY(-1px); + box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5); +} diff --git a/rocket/platform/app/components/bits/Table/Table/index.tsx b/rocket/platform/app/components/bits/Table/Table/index.tsx new file mode 100644 index 0000000..6088ca8 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/Table/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableProps extends React.TableHTMLAttributes { + children: React.ReactNode; + className?: string; +} + +export function Table({ + children, + className = '', + ...props +}: TableProps): React.JSX.Element { + return ( + + {children} +
+ ); +} + +export default Table; diff --git a/rocket/platform/app/components/bits/Table/Table/styles.module.css b/rocket/platform/app/components/bits/Table/Table/styles.module.css new file mode 100644 index 0000000..d27e7d8 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/Table/styles.module.css @@ -0,0 +1,9 @@ +.table { + width: 100%; + border-collapse: separate; + border-spacing: 0; + font-family: var(--font-inter), system-ui, sans-serif; + font-size: 13px; + color: #f7f7fa; + text-align: left; +} diff --git a/rocket/platform/app/components/bits/Table/TableBody/index.tsx b/rocket/platform/app/components/bits/Table/TableBody/index.tsx new file mode 100644 index 0000000..6376a91 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableBody/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableBodyProps extends React.HTMLAttributes { + children: React.ReactNode; + className?: string; +} + +export function TableBody({ + children, + className = '', + ...props +}: TableBodyProps): React.JSX.Element { + return ( + + {children} + + ); +} + +export default TableBody; diff --git a/rocket/platform/app/components/bits/Table/TableBody/styles.module.css b/rocket/platform/app/components/bits/Table/TableBody/styles.module.css new file mode 100644 index 0000000..57002b0 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableBody/styles.module.css @@ -0,0 +1,3 @@ +.body { + /* Body container styles */ +} diff --git a/rocket/platform/app/components/bits/Table/TableCell/index.tsx b/rocket/platform/app/components/bits/Table/TableCell/index.tsx new file mode 100644 index 0000000..d9dabb6 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableCell/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableCellProps extends React.TdHTMLAttributes { + children?: React.ReactNode; + className?: string; +} + +export function TableCell({ + children, + className = '', + ...props +}: TableCellProps): React.JSX.Element { + return ( + + {children} + + ); +} + +export default TableCell; diff --git a/rocket/platform/app/components/bits/Table/TableCell/styles.module.css b/rocket/platform/app/components/bits/Table/TableCell/styles.module.css new file mode 100644 index 0000000..613d6bb --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableCell/styles.module.css @@ -0,0 +1,5 @@ +.cell { + padding: 16px; + vertical-align: middle; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); +} diff --git a/rocket/platform/app/components/bits/Table/TableContainer/index.tsx b/rocket/platform/app/components/bits/Table/TableContainer/index.tsx new file mode 100644 index 0000000..39e149a --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableContainer/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableContainerProps extends React.HTMLAttributes { + children: React.ReactNode; + className?: string; +} + +export function TableContainer({ + children, + className = '', + ...props +}: TableContainerProps): React.JSX.Element { + return ( +
+ {children} +
+ ); +} + +export default TableContainer; diff --git a/rocket/platform/app/components/bits/Table/TableContainer/styles.module.css b/rocket/platform/app/components/bits/Table/TableContainer/styles.module.css new file mode 100644 index 0000000..98e4e63 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableContainer/styles.module.css @@ -0,0 +1,5 @@ +.container { + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; +} diff --git a/rocket/platform/app/components/bits/Table/TableHead/index.tsx b/rocket/platform/app/components/bits/Table/TableHead/index.tsx new file mode 100644 index 0000000..fdf6946 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableHead/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableHeadProps extends React.ThHTMLAttributes { + children?: React.ReactNode; + className?: string; +} + +export function TableHead({ + children, + className = '', + ...props +}: TableHeadProps): React.JSX.Element { + return ( + + {children} + + ); +} + +export default TableHead; diff --git a/rocket/platform/app/components/bits/Table/TableHead/styles.module.css b/rocket/platform/app/components/bits/Table/TableHead/styles.module.css new file mode 100644 index 0000000..ba3a236 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableHead/styles.module.css @@ -0,0 +1,10 @@ +.headCell { + padding: 12px 16px; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.06em; + text-transform: uppercase; + color: #8f90a6; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); + white-space: nowrap; +} diff --git a/rocket/platform/app/components/bits/Table/TableHeader/index.tsx b/rocket/platform/app/components/bits/Table/TableHeader/index.tsx new file mode 100644 index 0000000..49358ee --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableHeader/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableHeaderProps extends React.HTMLAttributes { + children: React.ReactNode; + className?: string; +} + +export function TableHeader({ + children, + className = '', + ...props +}: TableHeaderProps): React.JSX.Element { + return ( + + {children} + + ); +} + +export default TableHeader; diff --git a/rocket/platform/app/components/bits/Table/TableHeader/styles.module.css b/rocket/platform/app/components/bits/Table/TableHeader/styles.module.css new file mode 100644 index 0000000..653a6de --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableHeader/styles.module.css @@ -0,0 +1,3 @@ +.header { + border-bottom: 1px solid rgba(255, 255, 255, 0.08); +} diff --git a/rocket/platform/app/components/bits/Table/TableRow/index.tsx b/rocket/platform/app/components/bits/Table/TableRow/index.tsx new file mode 100644 index 0000000..ccc8503 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableRow/index.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +import styles from './styles.module.css'; + +export interface TableRowProps extends React.HTMLAttributes { + children: React.ReactNode; + className?: string; +} + +export function TableRow({ + children, + className = '', + ...props +}: TableRowProps): React.JSX.Element { + return ( + + {children} + + ); +} + +export default TableRow; diff --git a/rocket/platform/app/components/bits/Table/TableRow/styles.module.css b/rocket/platform/app/components/bits/Table/TableRow/styles.module.css new file mode 100644 index 0000000..abc0844 --- /dev/null +++ b/rocket/platform/app/components/bits/Table/TableRow/styles.module.css @@ -0,0 +1,12 @@ +.row { + transition: background-color 0.15s ease; + border-bottom: 1px solid rgba(255, 255, 255, 0.04); +} + +.row:hover { + background-color: rgba(255, 255, 255, 0.02); +} + +.row:last-child td { + border-bottom: none; +} diff --git a/rocket/platform/app/components/bits/Table/index.ts b/rocket/platform/app/components/bits/Table/index.ts new file mode 100644 index 0000000..da93bef --- /dev/null +++ b/rocket/platform/app/components/bits/Table/index.ts @@ -0,0 +1,7 @@ +export * from '@/app/components/bits/Table/TableContainer'; +export * from '@/app/components/bits/Table/Table'; +export * from '@/app/components/bits/Table/TableHeader'; +export * from '@/app/components/bits/Table/TableHead'; +export * from '@/app/components/bits/Table/TableBody'; +export * from '@/app/components/bits/Table/TableRow'; +export * from '@/app/components/bits/Table/TableCell'; diff --git a/rocket/platform/app/components/items/AppNavbar/index.tsx b/rocket/platform/app/components/items/AppNavbar/index.tsx new file mode 100644 index 0000000..3cc9f46 --- /dev/null +++ b/rocket/platform/app/components/items/AppNavbar/index.tsx @@ -0,0 +1,217 @@ +'use client'; + +import Image from 'next/image'; +import Link from 'next/link'; +import React, {useEffect, useRef, useState} from 'react'; + +import {BellIcon, ExternalLinkIcon, SidebarToggleIcon} from '@/app/icons'; + +import styles from './styles.module.css'; + +export interface AppNavbarProps { + isSidebarOpen?: boolean; + onToggleSidebar?: () => void; +} + +interface NotificationItemData { + id: string; + title: string; + description: string; + time: string; + type: 'success' | 'info' | 'warning'; +} + +const DUMMY_NOTIFICATIONS: NotificationItemData[] = [ + { + id: 'n-1', + title: 'Deployment Successful', + description: 'blog-backend was deployed to us-east-1.', + time: '5m ago', + type: 'success', + }, + { + id: 'n-2', + title: 'SSL Certificate Active', + description: 'survey-def456.rocket.app is now secure.', + time: '1h ago', + type: 'info', + }, + { + id: 'n-3', + title: 'Monthly Usage Alert', + description: '12.5% of request quota reached this cycle.', + time: '1d ago', + type: 'warning', + }, +]; + +export function AppNavbar({ + isSidebarOpen = true, + onToggleSidebar, +}: AppNavbarProps): React.JSX.Element { + const [isNotificationsOpen, setIsNotificationsOpen] = useState(false); + const [notifications, setNotifications] = useState(DUMMY_NOTIFICATIONS); + const notifRef = useRef(null); + + // Close notifications dropdown when clicking outside + useEffect(() => { + function handleClickOutside(e: MouseEvent) { + if (notifRef.current && !notifRef.current.contains(e.target as Node)) { + setIsNotificationsOpen(false); + } + } + if (isNotificationsOpen) { + document.addEventListener('mousedown', handleClickOutside); + } + return () => { + document.removeEventListener('mousedown', handleClickOutside); + }; + }, [isNotificationsOpen]); + + function handleClearNotifications() { + setNotifications([]); + setIsNotificationsOpen(false); + } + + return ( +
+
+ {/* Only show the toggle button and logo when the sidebar is CLOSED */} + {!isSidebarOpen && ( + <> + {onToggleSidebar && ( + + )} + + + Rocket Logo + Rocket + + + )} +
+ +
+ {/* Notifications Dropdown */} +
+ + + {isNotificationsOpen && ( +
+
+ Notifications + {notifications.length > 0 ? ( + + {notifications.length} new + + ) : ( + All read + )} +
+ +
+ {notifications.length === 0 ? ( +
+ No new notifications +
+ ) : ( + notifications.map(item => ( +
+
+ )) + )} +
+ + {notifications.length > 0 && ( +
+ +
+ )} +
+ )} +
+ + + Docs + + +
+
+ ); +} + +export default AppNavbar; diff --git a/rocket/platform/app/components/items/AppNavbar/styles.module.css b/rocket/platform/app/components/items/AppNavbar/styles.module.css new file mode 100644 index 0000000..ca13226 --- /dev/null +++ b/rocket/platform/app/components/items/AppNavbar/styles.module.css @@ -0,0 +1,275 @@ +.navbar { + height: 64px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 24px; + background-color: rgba(8, 8, 13, 0.7); + backdrop-filter: blur(12px); + border-bottom: 1px solid rgba(255, 255, 255, 0.06); + position: sticky; + top: 0; + z-index: 30; + gap: 16px; +} + +.leftGroup { + display: flex; + align-items: center; + gap: 12px; +} + +.brandLink { + display: flex; + align-items: center; + gap: 10px; + text-decoration: none; + color: #ffffff; +} + +.brandName { + font-family: var(--font-space-grotesk), sans-serif; + font-size: 17px; + font-weight: 700; + letter-spacing: -0.02em; +} + +.sidebarToggleBtn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + border-radius: 9px; + background: rgba(255, 255, 255, 0.04); + border: 1px solid rgba(255, 255, 255, 0.08); + color: #c9c9d9; + cursor: pointer; + transition: all 0.15s ease; +} + +.sidebarToggleBtn:hover { + background: rgba(255, 255, 255, 0.08); + color: #ffffff; +} + +.rightGroup { + display: flex; + align-items: center; + gap: 12px; + position: relative; +} + +.iconButton { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + border-radius: 10px; + background: rgba(255, 255, 255, 0.04); + border: 1px solid rgba(255, 255, 255, 0.08); + color: #c9c9d9; + cursor: pointer; + transition: all 0.15s ease; +} + +.iconButton:hover { + background: rgba(255, 255, 255, 0.08); + color: #ffffff; +} + +.iconButtonActive { + background: rgba(225, 29, 72, 0.15); + border-color: rgba(225, 29, 72, 0.35); + color: #ffffff; +} + +.notificationDot { + position: absolute; + top: 8px; + right: 8px; + width: 6px; + height: 6px; + border-radius: 9999px; + background: #e11d48; +} + +.docsLink { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 12px; + font-size: 13px; + font-weight: 500; + color: #c9c9d9; + background: rgba(255, 255, 255, 0.04); + border: 1px solid rgba(255, 255, 255, 0.08); + border-radius: 8px; + transition: all 0.15s ease; + text-decoration: none; +} + +.docsLink:hover { + background: rgba(255, 255, 255, 0.08); + color: #ffffff; +} + +/* Notifications Dropdown Banner */ +.notificationsWrapper { + position: relative; +} + +.notificationsDropdown { + position: absolute; + top: calc(100% + 10px); + right: 0; + width: 320px; + background: #12131d; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 14px; + box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.7); + z-index: 50; + overflow: hidden; + animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1); +} + +.notificationsHeader { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + border-bottom: 1px solid rgba(255, 255, 255, 0.06); +} + +.notificationsTitle { + font-size: 13px; + font-weight: 600; + color: #f7f7fa; +} + +.notificationsBadge { + font-size: 11px; + font-weight: 500; + color: #ff6b85; + background: rgba(225, 29, 72, 0.15); + padding: 2px 8px; + border-radius: 9999px; +} + +.notificationsList { + display: flex; + flex-direction: column; + max-height: 320px; + overflow-y: auto; +} + +.notificationItem { + display: flex; + align-items: flex-start; + gap: 12px; + padding: 12px 16px; + border-bottom: 1px solid rgba(255, 255, 255, 0.04); + transition: background 0.15s ease; + cursor: pointer; +} + +.notificationItem:hover { + background: rgba(255, 255, 255, 0.03); +} + +.notificationItem:last-child { + border-bottom: none; +} + +.statusIndicator { + width: 7px; + height: 7px; + border-radius: 9999px; + margin-top: 5px; + flex-shrink: 0; +} + +.statusSuccess { + background: #10b981; + box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); +} + +.statusInfo { + background: #3b82f6; + box-shadow: 0 0 6px rgba(59, 130, 246, 0.6); +} + +.statusWarning { + background: #f59e0b; + box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); +} + +.notificationContent { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; +} + +.notificationText { + font-size: 12px; + font-weight: 500; + color: #f7f7fa; + line-height: 1.4; +} + +.notificationDesc { + font-size: 11px; + color: #8f90a6; + line-height: 1.3; +} + +.notificationTime { + font-size: 10px; + color: #6b6c7e; + margin-top: 2px; +} + +.notificationsFooter { + padding: 10px 16px; + text-align: center; + border-top: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(255, 255, 255, 0.02); +} + +.markReadBtn { + font-size: 11px; + font-weight: 500; + color: #ff6b85; + background: transparent; + border: none; + cursor: pointer; + transition: color 0.15s ease; +} + +.markReadBtn:hover { + color: #ff8fa3; +} + +@keyframes dropdownFade { + from { + opacity: 0; + transform: translateY(-6px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@media (max-width: 768px) { + .navbar { + padding: 0 16px; + } + + .notificationsDropdown { + width: 280px; + } +} diff --git a/rocket/platform/app/components/items/AppShell/index.tsx b/rocket/platform/app/components/items/AppShell/index.tsx new file mode 100644 index 0000000..7d360cb --- /dev/null +++ b/rocket/platform/app/components/items/AppShell/index.tsx @@ -0,0 +1,74 @@ +'use client'; + +import React, {useState} from 'react'; + +import AppNavbar from '@/app/components/items/AppNavbar'; +import AppSidebar from '@/app/components/items/AppSidebar'; + +import styles from './styles.module.css'; + +export interface AppShellProps { + children: React.ReactNode; + projectCount?: number; +} + +export function AppShell({ + children, + projectCount = 3, +}: AppShellProps): React.JSX.Element { + // Single sidebar state: true = open/expanded, false = collapsed/closed + const [isSidebarOpen, setIsSidebarOpen] = useState(true); + + function toggleSidebar() { + setIsSidebarOpen(prev => !prev); + } + + function closeSidebar() { + setIsSidebarOpen(false); + } + + return ( +
+