diff --git a/new_dashboard_ui.patch b/new_dashboard_ui.patch new file mode 100644 index 00000000..b95493ae --- /dev/null +++ b/new_dashboard_ui.patch @@ -0,0 +1,405 @@ +diff --git a/home/user/static/js/components/dashboard-layout.tsx b/home/user/static/js/components/dashboard-layout.tsx +new file mode 100644 +index 0000000..f114f4e +--- /dev/null ++++ b/home/user/static/js/components/dashboard-layout.tsx +@@ -0,0 +1,72 @@ ++ ++"use client" ++ ++import { useState } from 'react' ++import { Button } from "@/components/ui/button" ++import { MoonIcon, SunIcon } from "@radix-ui/react-icons" ++import { useTheme } from "next-themes" ++import { SidebarNav } from './sidebar-nav' ++import { UserProfileDropdown } from './user-profile-dropdown' ++ ++export function ThemeToggle() { ++ const { setTheme, theme } = useTheme() ++ ++ return ( ++ ++ ) ++} ++ ++export default function DashboardLayout({ children }) { ++ const [isSidebarOpen, setIsSidebarOpen] = useState(true) ++ ++ return ( ++
++ {/* Sidebar */} ++ ++ ++ {/* Main content */} ++
++ {/* Header */} ++
++
++ ++
++ ++ ++
++
++
++ ++ {/* Page content */} ++
++
++ {children} ++
++
++
++
++ ) ++} +diff --git a/home/user/static/js/components/sidebar-nav.tsx b/home/user/static/js/components/sidebar-nav.tsx +new file mode 100644 +index 0000000..3412126 +--- /dev/null ++++ b/home/user/static/js/components/sidebar-nav.tsx +@@ -0,0 +1,30 @@ ++ ++import Link from 'next/link' ++import { HomeIcon, PackageIcon, ShoppingCartIcon, UsersIcon, SettingsIcon } from 'lucide-react' ++ ++const navItems = [ ++ { name: 'Dashboard', href: '/dashboard', icon: HomeIcon }, ++ { name: 'Products', href: '/products', icon: PackageIcon }, ++ { name: 'Orders', href: '/orders', icon: ShoppingCartIcon }, ++ { name: 'Customers', href: '/customers', icon: UsersIcon }, ++ { name: 'Settings', href: '/settings', icon: SettingsIcon }, ++] ++ ++export function SidebarNav({ isOpen }) { ++ return ( ++ ++ ) ++} +diff --git a/home/user/static/js/components/theme-provider.tsx b/home/user/static/js/components/theme-provider.tsx +new file mode 100644 +index 0000000..1e0c8e3 +--- /dev/null ++++ b/home/user/static/js/components/theme-provider.tsx +@@ -0,0 +1,10 @@ ++ ++"use client" ++ ++import * as React from "react" ++import { ThemeProvider as NextThemesProvider } from "next-themes" ++import { type ThemeProviderProps } from "next-themes/dist/types" ++ ++export function ThemeProvider({ children, ...props }: ThemeProviderProps) { ++ return {children} ++} +diff --git a/home/user/static/js/components/user-profile-dropdown.tsx b/home/user/static/js/components/user-profile-dropdown.tsx +new file mode 100644 +index 0000000..538c176 +--- /dev/null ++++ b/home/user/static/js/components/user-profile-dropdown.tsx +@@ -0,0 +1,56 @@ ++ ++"use client" ++ ++import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" ++import { Button } from "@/components/ui/button" ++import { ++ DropdownMenu, ++ DropdownMenuContent, ++ DropdownMenuGroup, ++ DropdownMenuItem, ++ DropdownMenuLabel, ++ DropdownMenuSeparator, ++ DropdownMenuTrigger, ++} from "@/components/ui/dropdown-menu" ++import { UserIcon, SettingsIcon, LogOutIcon } from 'lucide-react' ++ ++export function UserProfileDropdown() { ++ return ( ++ ++ ++ ++ ++ ++ ++
++

John Doe

++

++ john.doe@example.com ++

++
++
++ ++ ++ ++ ++ Profile ++ ++ ++ ++ Settings ++ ++ ++ ++ ++ ++ Log out ++ ++
++
++ ) ++} +diff --git a/home/user/templates/base.html b/home/user/templates/base.html +index 4b164a1..289e8b5 100644 +--- a/home/user/templates/base.html ++++ b/home/user/templates/base.html +@@ -1,67 +1,23 @@ + +-{% load static %} + + + + + +- {% block title %}Dropship Project{% endblock %} +- +- ++ {% block title %}Dropship V2{% endblock %} ++ ++ ++ {% block extra_head %}{% endblock %} + +- +- +- +-
+- {% if messages %} +- {% for message in messages %} +- +- {% endfor %} +- {% endif %} +- +- {% block content %} +- {% endblock %} ++ ++
++ {% block content %}{% endblock %} +
+- +- +- +- +- ++ {% block extra_body %}{% endblock %} + + +diff --git a/home/user/templates/dashboard.html b/home/user/templates/dashboard.html +index 3c3e54c..b403270 100644 +--- a/home/user/templates/dashboard.html ++++ b/home/user/templates/dashboard.html +@@ -1,90 +1,38 @@ + + {% extends 'base.html' %} +- +-{% block title %}Dashboard{% endblock %} ++{% load static %} + + {% block content %} +-
+-

Dashboard

+-
+-
+-
+-
+-
Total Orders
+-

{{ total_orders }}

+-
+-
+-
+-
+-
+-
+-
Total Spent
+-

${{ total_spent|floatformat:2 }}

+-
+-
+-
+-
+-
+-
+-
Available Products
+-

{{ product_count }}

+-
+-
+-
+-
+-
+-
+-

Recent Orders

+- {% if user_orders %} +- +- +- +- +- +- +- +- +- +- +- +- {% for order in user_orders %} +- +- +- +- +- +- +- +- {% endfor %} +- +-
Order IDProductQuantityTotal PriceStatus
{{ order.id }}{{ order.product.name }}{{ order.quantity }}${{ order.total_price }}{{ order.get_status_display }}
+- {% else %} +-

You have no recent orders.

+- {% endif %} +-
+-
+-

Top Products

+-
    +- {% for product in top_products %} +-
  • +- {{ product.name }} +- {{ product.order_count }} +-
  • +- {% endfor %} +-
+-

Quick Links

+- +-
+-
+-
++
++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + {% endblock %}