Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/client/vite-4.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrr authored Sep 20, 2024
2 parents 4409e21 + 5ee1a9d commit 9edf968
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/src/pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project[]>([])
const [papers, setPapers] = useState<Paper[]>([])
const [currentPage, setCurrentPage] = useState<number>(1)
Expand Down Expand Up @@ -97,7 +98,7 @@ const Dashboard = () => {
<div className='bg-white dark:bg-gray-800 shadow-md rounded p-4 mb-6'>
<div className='flex justify-between items-center'>
<div>
<h2 className='text-xl font-bold dark:text-white'>User: [email protected]</h2>
<h2 className='text-xl font-bold dark:text-white'>User: {email}</h2>
<p className='dark:text-gray-300'></p>
<p className='dark:text-gray-300'>
Projects: {projects.length} | Papers: {totalPapers}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Dashboard/Papers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Papers = ({ papers, currentPage, pageSize, totalPapers, setCurrentPage }:
Previous
</button>
<span className='dark:text-gray-300'>
Page {currentPage} of {Math.ceil(totalPapers / pageSize)}
Page {currentPage} of {Math.max(Math.ceil(totalPapers / pageSize), 1)}
</span>
<button
onClick={() =>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Dashboard/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Projects = ({ projects }: ProjectsProps) => {
</td>
<td className='py-2 px-4 border-b dark:border-gray-700 dark:text-gray-300 text-right'>
<a
href={`http://localhost:5173/projects/${project.id}`}
href={`https://atlas.seas.upenn.edu/projects/${project.id}`}
target='_blank'
rel='noreferrer'
className='text-blue-500 dark:text-blue-400'
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/Login/Galaxy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const Galaxy = ({ loggingIn }: { loggingIn?: boolean }) => {
}).then((res) => {
if (res.ok) {
localStorage.setItem('token', res.headers.get('Authorization')!)
localStorage.setItem('email', params.email!)
navigate('/dashboard')
}
})
Expand Down

0 comments on commit 9edf968

Please sign in to comment.