From 5ee1a9da38249c397bb78e7761b343c938a010be Mon Sep 17 00:00:00 2001 From: amirrr <6696894+amirrr@users.noreply.github.com> Date: Wed, 18 Sep 2024 00:31:34 +0200 Subject: [PATCH] fix project url --- client/src/pages/Dashboard/Dashboard.tsx | 3 ++- client/src/pages/Dashboard/Papers.tsx | 2 +- client/src/pages/Dashboard/Projects.tsx | 2 +- client/src/pages/Login/Galaxy.tsx | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/pages/Dashboard/Dashboard.tsx b/client/src/pages/Dashboard/Dashboard.tsx index f40c03a..e5f222f 100644 --- a/client/src/pages/Dashboard/Dashboard.tsx +++ b/client/src/pages/Dashboard/Dashboard.tsx @@ -5,6 +5,7 @@ import { API_URL } from '../../service/api' import { useNavigate } from 'react-router-dom' const Dashboard = () => { + const email = localStorage.getItem('email') || '' const [projects, setProjects] = useState([]) const [papers, setPapers] = useState([]) const [currentPage, setCurrentPage] = useState(1) @@ -97,7 +98,7 @@ const Dashboard = () => {
-

User: user@example.com

+

User: {email}

Projects: {projects.length} | Papers: {totalPapers} diff --git a/client/src/pages/Dashboard/Papers.tsx b/client/src/pages/Dashboard/Papers.tsx index 44e480c..8de120e 100644 --- a/client/src/pages/Dashboard/Papers.tsx +++ b/client/src/pages/Dashboard/Papers.tsx @@ -96,7 +96,7 @@ const Papers = ({ papers, currentPage, pageSize, totalPapers, setCurrentPage }: Previous - Page {currentPage} of {Math.ceil(totalPapers / pageSize)} + Page {currentPage} of {Math.max(Math.ceil(totalPapers / pageSize), 1)}