Skip to content

Commit c548acb

Browse files
authored
Merge pull request #125 from huamanraj/new-dashboard-ui-#116
v2-dashboard: created a new ui for the dashboard #116
2 parents 66f3989 + e381661 commit c548acb

File tree

14 files changed

+383
-213
lines changed

14 files changed

+383
-213
lines changed

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"class-variance-authority": "^0.7.0",
2626
"clsx": "^2.1.1",
2727
"framer-motion": "^11.15.0",
28+
"geist": "^1.5.1",
2829
"lucide-react": "^0.456.0",
2930
"next": "15.5.3",
3031
"next-auth": "^4.24.11",

apps/web/src/app/(main)/dashboard/home/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client";
2-
2+
import React from "react";
33
import { useProjectTitleStore } from "@/store/useProjectTitleStore";
44
import Dashboard from "../page";
55
import { useProjectsData } from "@/store/useProjectsDataStore";
@@ -16,7 +16,7 @@ const Home = () => {
1616
const initializeState = () => {
1717
setData(projectsOfTheWeek);
1818
setRenderProjects(true);
19-
setProjectTitle("Projects of the week");
19+
setProjectTitle("Featured projects");
2020
};
2121

2222
initializeState();

apps/web/src/app/(main)/dashboard/layout.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
"use client";
2-
import { DashboardHeader } from "@/components/dashboard/DashboardHeader";
32
import Sidebar from "@/components/dashboard/Sidebar";
43
import FiltersContainer from "@/components/ui/FiltersContainer";
54
import { useFilterStore } from "@/store/useFilterStore";
65
import { useShowSidebar } from "@/store/useShowSidebar";
6+
import { IconWrapper } from "@/components/ui/IconWrapper";
7+
import { Bars3Icon } from "@heroicons/react/24/outline";
78

89
export default function DashboardLayout({
910
children,
1011
}: {
1112
children: React.ReactNode;
1213
}) {
1314
const { showFilters } = useFilterStore();
14-
const { showSidebar } = useShowSidebar();
15+
const { showSidebar, setShowSidebar } = useShowSidebar();
1516
return (
16-
<div className="flex flex-col md:gap-3">
17-
<div className="flex w-full h-16">
18-
<DashboardHeader></DashboardHeader>
19-
</div>
20-
<div className="flex flex-row w-full">
21-
{showFilters && <FiltersContainer></FiltersContainer>}
22-
<aside
23-
className={`w-48 md:w-[40%] xl:w-[20%] ${showSidebar ? "block relative" : "hidden"} xl:block`}
24-
>
25-
<Sidebar></Sidebar>
26-
</aside>
27-
<main className="flex-grow">{children}</main>
17+
<div className="flex w-screen h-screen bg-[#0a0a0b] overflow-hidden">
18+
{showFilters && <FiltersContainer />}
19+
<aside className={`h-full ${!showSidebar && "hidden xl:block"}`}>
20+
<Sidebar />
21+
</aside>
22+
<div className="flex-1 flex flex-col h-full">
23+
<div className="xl:hidden flex items-center h-16 px-4 border-b border-[#1a1a1d]">
24+
<IconWrapper onClick={() => setShowSidebar(true)}>
25+
<Bars3Icon className="size-5 text-ox-purple" />
26+
</IconWrapper>
27+
<h1 className="ml-4 text-lg font-semibold text-ox-white">Opensox</h1>
28+
</div>
29+
<main className="flex-1 h-full overflow-auto">
30+
{children}
31+
</main>
2832
</div>
2933
</div>
3034
);

apps/web/src/app/(main)/dashboard/projects/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ import { useRenderProjects } from "@/store/useRenderProjectsStore";
44
import Dashboard from "../page";
55
import { useEffect } from "react";
66
import { useProjectTitleStore } from "@/store/useProjectTitleStore";
7+
import { useProjectsData } from "@/store/useProjectsDataStore";
78

89
const Projects = () => {
910
const { setRenderProjects } = useRenderProjects();
1011
const { setProjectTitle } = useProjectTitleStore();
12+
const { setData } = useProjectsData();
1113

1214
useEffect(() => {
13-
setRenderProjects(false);
14-
setProjectTitle("Projects of the week");
15-
}, [setRenderProjects, setProjectTitle]);
15+
setRenderProjects(true); // Change to true to always render the container
16+
setProjectTitle("Projects");
17+
setData([]); // Clear any existing projects
18+
}, [setRenderProjects, setProjectTitle, setData]);
1619

17-
return <Dashboard></Dashboard>;
20+
return <Dashboard />;
1821
};
1922

2023
export default Projects;

apps/web/src/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { authConfig } from "@/lib/auth/config";
1010
import { SessionWrapper } from "./SessionWrapper";
1111
import SupportDropdown from "@/components/landing-sections/SupportDropdown";
1212
import { TRPCProvider } from "@/providers/trpc-provider";
13+
import { GeistSans } from "geist/font/sans";
1314

1415
const dmReg = localFont({
1516
src: "./fonts/DMMono-Regular.ttf",
@@ -39,7 +40,7 @@ export default async function RootLayout({
3940
return (
4041
<html lang="en" suppressHydrationWarning>
4142
<body
42-
className={`${dmMed.variable} ${dmReg.variable} antialiased bg-background`}
43+
className={`${GeistSans.className} ${dmMed.variable} ${dmReg.variable} antialiased bg-background`}
4344
>
4445
<PostHogProvider>
4546
<ThemeProvider

apps/web/src/components/dashboard/DashboardContainer.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,36 @@ import { useLoading } from "@/store/useLoadingStore";
77
import { useProjectsNotFoundStore } from "@/store/useProjectsFoundStore";
88
import { ErrMsg } from "../ui/ErrMsg";
99
import SpinnerElm from "../ui/SpinnerElm";
10+
import { usePathname } from "next/navigation";
1011

1112
export default function DashboardContainer() {
1213
const { renderProjects } = useRenderProjects();
1314
const { data } = useProjectsData();
1415
const { loading } = useLoading();
1516
const { projectsNotFound } = useProjectsNotFoundStore();
17+
const pathname = usePathname();
18+
19+
const isProjectsPage = pathname === "/dashboard/projects";
20+
1621
return (
17-
<div
18-
className={`h-[80vh] md:h-[88vh] rounded-lg mx-1 md:mx-4 bg-ox-black-1 border border-ox-gray ${!renderProjects ? "flex items-center justify-center" : ""}`}
19-
>
20-
<div className={`max-h-full ${!loading ? "overflow-y-scroll" : ""}`}>
21-
{renderProjects && (
22+
<div className={`min-h-[calc(100vh-64px)] ${isProjectsPage ? "flex items-center justify-center" : ""}`}>
23+
<div className={`w-full ${!loading ? "h-full" : ""}`}>
24+
{renderProjects && !loading && (
2225
<ProjectsContainer projects={data}></ProjectsContainer>
2326
)}
2427
{loading && (
25-
<SpinnerElm text={"loading cool projects for you..."}></SpinnerElm>
26-
)}
27-
{projectsNotFound && (
28-
<ErrMsg
29-
text={
30-
"No projects were found matching the selected filters. Please adjust the filters and try again."
31-
}
32-
></ErrMsg>
28+
<div className="flex items-center justify-center h-full">
29+
<SpinnerElm text={"loading cool projects for you..."}></SpinnerElm>
30+
</div>
3331
)}
34-
{!renderProjects && !loading && (
35-
<ErrMsg
36-
text={"Click on 'Find Projects' to see the magic."}
37-
></ErrMsg>
32+
{projectsNotFound && !loading && (
33+
<div className="flex items-center justify-center h-full">
34+
<ErrMsg
35+
text={
36+
"No projects were found matching the selected filters. Please adjust the filters and try again."
37+
}
38+
></ErrMsg>
39+
</div>
3840
)}
3941
</div>
4042
</div>

0 commit comments

Comments
 (0)