From c782fbb3a4241a5a6f98c1f396fecbfb078344fb Mon Sep 17 00:00:00 2001 From: rahulsan007 Date: Sun, 8 Oct 2023 15:26:02 +0530 Subject: [PATCH 1/2] Add 'Create First Project' button to dashboard --- pages/__app/dashboard/index.tsx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pages/__app/dashboard/index.tsx b/pages/__app/dashboard/index.tsx index 8c587028..112e778a 100644 --- a/pages/__app/dashboard/index.tsx +++ b/pages/__app/dashboard/index.tsx @@ -1,14 +1,15 @@ import type { NextPage } from 'next' import { useRouter } from 'next/router' import { useEffect, useMemo } from 'react' - import { useSelectedProject, useUserProjects } from '@/hooks/query/project' import DashboardLayout from '@/layouts/DashboardLayout' +import { useProjectModal } from '@/store/useProjectModal' const DashBoardPage: NextPage = () => { const router = useRouter() const { projects } = useUserProjects() const { project: selectedProject } = useSelectedProject() + const projectModal = useProjectModal() const redirectToProject = useMemo(() => { if (!selectedProject) { @@ -22,11 +23,31 @@ const DashBoardPage: NextPage = () => { } }, [redirectToProject, router]) + const handleCreateProject = () => { + projectModal.openCreateProjectModal() + } + return ( -
-

Dashboard Page

-
+ {projects && projects.length > 0 ? ( +
+

No project selected

+
+ ) : ( +
+
+

+ You don't have any project yet. +

+ +
+
+ )}
) } From e80a74b7bf327ef70edda29453e4099cc7e3a3b8 Mon Sep 17 00:00:00 2001 From: rahulsan007 Date: Sun, 8 Oct 2023 15:29:49 +0530 Subject: [PATCH 2/2] feat:Add 'Create First Project' button to dashboard --- pages/__app/dashboard/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/__app/dashboard/index.tsx b/pages/__app/dashboard/index.tsx index 112e778a..cc28a53e 100644 --- a/pages/__app/dashboard/index.tsx +++ b/pages/__app/dashboard/index.tsx @@ -37,7 +37,7 @@ const DashBoardPage: NextPage = () => {

- You don't have any project yet. + You don't have any projects yet.