Skip to content

Commit

Permalink
Merge branch 'feat/dashboard-UI' of https://github.com/aditya-shrey/p…
Browse files Browse the repository at this point in the history
…roductivity-pulse into feat/dashboard-UI
  • Loading branch information
maddoxrb committed Aug 5, 2024
2 parents ead3039 + 258ce16 commit e750033
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Since the deployment process is specific to your environment, ensure to follow y
- React - Frontend library
- Node.js - JavaScript runtime
- Firebase - Backend services (Authentication, Firestore, etc.)
- GitHub Actions - CI/CD

## Contributing

Expand Down
35 changes: 22 additions & 13 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';
import logo from '../assets/logo.png';

const Navbar = ({ signInWithGoogle }) => {
const location = useLocation();
const isDashboard = location.pathname === '/dashboard';

return (
<nav className="bg-white shadow-md z-50">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
Expand All @@ -17,27 +21,32 @@ const Navbar = ({ signInWithGoogle }) => {
</div>
</div>
</div>
<div className="hidden md:block">
<div className="ml-4 flex items-center md:ml-6">
<button className="bg-primary text-white px-4 py-2 rounded-md text-sm font-medium"
onClick={signInWithGoogle}
>Sign Up</button>
<button
onClick={signInWithGoogle}
className="ml-3 bg-secondary text-white px-4 py-2 rounded-md text-sm font-medium"
>
Log In
</button>
{!isDashboard && (
<div className="hidden md:block">
<div className="ml-4 flex items-center md:ml-6">
<button
className="bg-primary text-white px-4 py-2 rounded-md text-sm font-medium"
onClick={signInWithGoogle}
>
Sign Up
</button>
<button
onClick={signInWithGoogle}
className="ml-3 bg-secondary text-white px-4 py-2 rounded-md text-sm font-medium"
>
Log In
</button>
</div>
</div>
</div>
)}
</div>
</div>
</nav>
);
};

Navbar.propTypes = {
signInWithGoogle: PropTypes.func.isRequired
signInWithGoogle: PropTypes.func.isRequired,
};

export default Navbar;
4 changes: 4 additions & 0 deletions src/pages/dashboard/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ChartJS.register(
Legend
);

const filterDeletedTasks = (tasks) => tasks.filter(task => !task._deleted);

Check warning on line 30 in src/pages/dashboard/Analytics.js

View workflow job for this annotation

GitHub Actions / lint

'filterDeletedTasks' is assigned a value but never used

Check warning on line 30 in src/pages/dashboard/Analytics.js

View workflow job for this annotation

GitHub Actions / lint

'filterDeletedTasks' is assigned a value but never used

const TimelineItem = ({ project, index, total }) => (
<div className="relative mb-8">
<div className={`absolute w-2 h-full bg-gray-300 ${index < total - 1 ? 'border-r-2 border-gray-300' : ''} left-1/2 transform -translate-x-1/2`}></div>
Expand Down Expand Up @@ -54,6 +56,7 @@ TimelineItem.propTypes = {
};

const Analytics = ({ userTaskData, teamTaskCompletionData, categoryData, projectTimelineData, statuses }) => {

// Filter out deleted tasks
const filteredUserTaskData = userTaskData.filter(data => !data._deleted);
const filteredTeamTaskCompletionData = {
Expand All @@ -66,6 +69,7 @@ const Analytics = ({ userTaskData, teamTaskCompletionData, categoryData, project
};
const filteredProjectTimelineData = projectTimelineData.filter(project => !project._deleted);


return (
<div className="p-8 bg-white rounded-lg shadow-md w-full">
<h2 className="text-2xl font-bold mb-6 flex items-center">
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dashboard/TaskArchive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'react-icons/fa';
import PropTypes from 'prop-types';

const Tasks = ({
const TaskArchive = ({
tasks,
members,
usernames,
Expand Down Expand Up @@ -207,7 +207,7 @@ const Tasks = ({
);
};

Tasks.propTypes = {
TaskArchive.propTypes = {
tasks: PropTypes.arrayOf(PropTypes.object).isRequired,
members: PropTypes.arrayOf(PropTypes.object).isRequired,
usernames: PropTypes.object.isRequired,
Expand All @@ -230,4 +230,4 @@ Tasks.propTypes = {
priorities: PropTypes.arrayOf(PropTypes.string).isRequired
};

export default Tasks;
export default TaskArchive;
2 changes: 1 addition & 1 deletion src/pages/dashboard/Tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Tasks.propTypes = {
setNewTask: PropTypes.func.isRequired,
dueDate: PropTypes.string.isRequired,
setDueDate: PropTypes.func.isRequired,
userAssigned: PropTypes.string.isRequired,
userAssigned: PropTypes.array.isRequired,
setUserAssigned: PropTypes.func.isRequired,
priority: PropTypes.string.isRequired,
setPriority: PropTypes.func.isRequired,
Expand Down

0 comments on commit e750033

Please sign in to comment.