├── .eslintrc.cjs ├── .gitignore ├── README.md ├── index.html ├── package-lock.json ├── package.json ├── postcss.config.js ├── public └── vite.svg ├── src ├── App.css ├── App.jsx ├── assets │ └── react.svg ├── components │ ├── Auth │ │ └── Login.jsx │ ├── Dashboard │ │ ├── AdminDashboard.jsx │ │ └── EmployeeDashboard.jsx │ ├── TaskList │ │ ├── AcceptTask.jsx │ │ ├── CompleteTask.jsx │ │ ├── FailedTask.jsx │ │ ├── NewTask.jsx │ │ └── TaskList.jsx │ └── other │ │ ├── AllTask.jsx │ │ ├── CreateTask.jsx │ │ ├── Header.jsx │ │ └── TaskListNumbers.jsx ├── context │ └── AuthProvider.jsx ├── index.css ├── main.jsx └── utils │ └── localStorage.jsx ├── tailwind.config.js └── vite.config.js /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ems", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^18.2.66", 18 | "@types/react-dom": "^18.2.22", 19 | "@vitejs/plugin-react": "^4.2.1", 20 | "autoprefixer": "^10.4.20", 21 | "eslint": "^8.57.0", 22 | "eslint-plugin-react": "^7.34.1", 23 | "eslint-plugin-react-hooks": "^4.6.0", 24 | "eslint-plugin-react-refresh": "^0.4.6", 25 | "postcss": "^8.4.47", 26 | "tailwindcss": "^3.4.13", 27 | "vite": "^5.2.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext, useEffect, useState } from 'react' 2 | import Login from './components/Auth/Login' 3 | import EmployeeDashboard from './components/Dashboard/EmployeeDashboard' 4 | import AdminDashboard from './components/Dashboard/AdminDashboard' 5 | import { AuthContext } from './context/AuthProvider' 6 | 7 | const App = () => { 8 | 9 | const [user, setUser] = useState(null) 10 | const [loggedInUserData, setLoggedInUserData] = useState(null) 11 | const [userData,SetUserData] = useContext(AuthContext) 12 | 13 | useEffect(()=>{ 14 | const loggedInUser = localStorage.getItem('loggedInUser') 15 | 16 | if(loggedInUser){ 17 | const userData = JSON.parse(loggedInUser) 18 | setUser(userData.role) 19 | setLoggedInUserData(userData.data) 20 | } 21 | 22 | },[]) 23 | 24 | 25 | const handleLogin = (email, password) => { 26 | if (email == 'admin@me.com' && password == '123') { 27 | setUser('admin') 28 | localStorage.setItem('loggedInUser', JSON.stringify({ role: 'admin' })) 29 | } else if (userData) { 30 | const employee = userData.find((e) => email == e.email && e.password == password) 31 | if (employee) { 32 | setUser('employee') 33 | setLoggedInUserData(employee) 34 | localStorage.setItem('loggedInUser', JSON.stringify({ role: 'employee',data:employee })) 35 | } 36 | } 37 | else { 38 | alert("Invalid Credentials") 39 | } 40 | } 41 | 42 | 43 | 44 | return ( 45 | <> 46 | {!user ? : ''} 47 | {user == 'admin' ? : (user == 'employee' ? : null) } 48 | 49 | ) 50 | } 51 | 52 | export default App -------------------------------------------------------------------------------- /src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/Auth/Login.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | 3 | const Login = ({handleLogin}) => { 4 | 5 | 6 | 7 | const [email, setEmail] = useState('') 8 | const [password, setPassword] = useState('') 9 | 10 | 11 | const submitHandler = (e)=>{ 12 | e.preventDefault() 13 | handleLogin(email,password) 14 | setEmail("") 15 | setPassword("") 16 | } 17 | 18 | 19 | return ( 20 |
21 |
22 |
{ 24 | submitHandler(e) 25 | }} 26 | className='flex flex-col items-center justify-center' 27 | > 28 | { 31 | setEmail(e.target.value) 32 | }} 33 | required 34 | className='outline-none bg-transparent border-2 border-emerald-600 font-medium text-lg py-2 px-6 rounded-full placeholder:text-gray-400' type="email" placeholder='Enter your email' 35 | /> 36 | { 39 | setPassword(e.target.value) 40 | }} 41 | required 42 | className='outline-none bg-transparent border-2 border-emerald-600 font-medium text-lg py-2 px-6 rounded-full mt-3 placeholder:text-gray-400' type="password" placeholder='Enter password' /> 43 | 44 |
45 |
46 |
47 | ) 48 | } 49 | 50 | export default Login -------------------------------------------------------------------------------- /src/components/Dashboard/AdminDashboard.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Header from '../other/Header' 3 | import CreateTask from '../other/CreateTask' 4 | import AllTask from '../other/AllTask' 5 | 6 | const AdminDashboard = (props) => { 7 | return ( 8 |
9 |
10 | 11 | 12 |
13 | ) 14 | } 15 | 16 | export default AdminDashboard -------------------------------------------------------------------------------- /src/components/Dashboard/EmployeeDashboard.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Header from '../other/Header' 3 | import TaskListNumbers from '../other/TaskListNumbers' 4 | import TaskList from '../TaskList/TaskList' 5 | 6 | const EmployeeDashboard = (props) => { 7 | 8 | return ( 9 |
10 | 11 |
12 | 13 | 14 |
15 | ) 16 | } 17 | 18 | export default EmployeeDashboard -------------------------------------------------------------------------------- /src/components/TaskList/AcceptTask.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const AcceptTask = ({data}) => { 4 | console.log(); 5 | return ( 6 |
7 |
8 |

{data.category}

9 |

{data.taskDate}

10 |
11 |

{data.taskTitle}

12 |

13 | {data.taskDescription} 14 |

15 |
16 | 17 | 18 |
19 |
20 | ) 21 | } 22 | 23 | export default AcceptTask -------------------------------------------------------------------------------- /src/components/TaskList/CompleteTask.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const CompleteTask = ({data}) => { 4 | return ( 5 |
6 |
7 |

{data.category}

8 |

{data.taskDate}

9 |
10 |

{data.taskTitle}

11 |

12 | {data.taskDescription} 13 |

14 |
15 | 16 |
17 |
18 | ) 19 | } 20 | 21 | export default CompleteTask -------------------------------------------------------------------------------- /src/components/TaskList/FailedTask.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const FailedTask = () => { 4 | return ( 5 |
6 |
7 |

{data.category}

8 |

{data.taskDate}

9 |
10 |

{data.taskTitle}

11 |

12 | {data.taskDescription} 13 |

14 |
15 | 16 |
17 |
18 | ) 19 | } 20 | 21 | export default FailedTask -------------------------------------------------------------------------------- /src/components/TaskList/NewTask.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const NewTask = ({data}) => { 4 | return ( 5 |
6 |
7 |

{data.category}

8 |

{data.taskDate}

9 |
10 |

{data.taskTitle}

11 |

12 | {data.taskDescription} 13 |

14 |
15 | 16 |
17 |
18 | ) 19 | } 20 | 21 | export default NewTask -------------------------------------------------------------------------------- /src/components/TaskList/TaskList.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import AcceptTask from './AcceptTask' 3 | import NewTask from './NewTask' 4 | import CompleteTask from './CompleteTask' 5 | import FailedTask from './FailedTask' 6 | 7 | const TaskList = ({ data }) => { 8 | return ( 9 |
10 | {data.tasks.map((elem, idx) => { 11 | if (elem.active) { 12 | return 13 | } 14 | if (elem.newTask) { 15 | return 16 | } 17 | if (elem.completed) { 18 | return 19 | } 20 | if (elem.failed) { 21 | return 22 | } 23 | 24 | })} 25 |
26 | ) 27 | } 28 | 29 | export default TaskList -------------------------------------------------------------------------------- /src/components/other/AllTask.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react' 2 | import { AuthContext } from '../../context/AuthProvider' 3 | 4 | const AllTask = () => { 5 | 6 | const [userData,setUserData] = useContext(AuthContext) 7 | 8 | 9 | return ( 10 |
11 |
12 |

Employee Name

13 |

New Task

14 |
Active Task
15 |
Completed
16 |
Failed
17 |
18 |
19 | {userData.map(function(elem,idx){ 20 | return
21 |

{elem.firstName}

22 |

{elem.taskCounts.newTask}

23 |
{elem.taskCounts.active}
24 |
{elem.taskCounts.completed}
25 |
{elem.taskCounts.failed}
26 |
27 | })} 28 |
29 | 30 | 31 |
32 | ) 33 | } 34 | 35 | export default AllTask -------------------------------------------------------------------------------- /src/components/other/CreateTask.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext, useState } from 'react' 2 | import { AuthContext } from '../../context/AuthProvider' 3 | 4 | const CreateTask = () => { 5 | 6 | const [userData, setUserData] = useContext(AuthContext) 7 | 8 | const [taskTitle, setTaskTitle] = useState('') 9 | const [taskDescription, setTaskDescription] = useState('') 10 | const [taskDate, setTaskDate] = useState('') 11 | const [asignTo, setAsignTo] = useState('') 12 | const [category, setCategory] = useState('') 13 | 14 | const [newTask, setNewTask] = useState({}) 15 | 16 | const submitHandler = (e) => { 17 | e.preventDefault() 18 | 19 | setNewTask({ taskTitle, taskDescription, taskDate, category, active: false, newTask: true, failed: false, completed: false }) 20 | 21 | const data = userData 22 | 23 | data.forEach(function (elem) { 24 | if (asignTo == elem.firstName) { 25 | elem.tasks.push(newTask) 26 | elem.taskCounts.newTask = elem.taskCounts.newTask + 1 27 | } 28 | }) 29 | setUserData(data) 30 | console.log(data); 31 | 32 | setTaskTitle('') 33 | setCategory('') 34 | setAsignTo('') 35 | setTaskDate('') 36 | setTaskDescription('') 37 | 38 | } 39 | 40 | return ( 41 |
42 |
{ 43 | submitHandler(e) 44 | }} 45 | className='flex flex-wrap w-full items-start justify-between' 46 | > 47 |
48 |
49 |

Task Title

50 | { 53 | setTaskTitle(e.target.value) 54 | }} 55 | className='text-sm py-1 px-2 w-4/5 rounded outline-none bg-transparent border-[1px] border-gray-400 mb-4' type="text" placeholder='Make a UI design' 56 | /> 57 |
58 |
59 |

Date

60 | { 63 | setTaskDate(e.target.value) 64 | }} 65 | className='text-sm py-1 px-2 w-4/5 rounded outline-none bg-transparent border-[1px] border-gray-400 mb-4' type="date" /> 66 |
67 |
68 |

Asign to

69 | { 72 | setAsignTo(e.target.value) 73 | }} 74 | className='text-sm py-1 px-2 w-4/5 rounded outline-none bg-transparent border-[1px] border-gray-400 mb-4' type="text" placeholder='employee name' /> 75 |
76 |
77 |

Category

78 | { 81 | setCategory(e.target.value) 82 | }} 83 | className='text-sm py-1 px-2 w-4/5 rounded outline-none bg-transparent border-[1px] border-gray-400 mb-4' type="text" placeholder='design, dev, etc' /> 84 |
85 |
86 | 87 |
88 |

Description

89 | 93 | 94 |
95 | 96 |
97 |
98 | ) 99 | } 100 | 101 | export default CreateTask -------------------------------------------------------------------------------- /src/components/other/Header.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import { setLocalStorage } from '../../utils/localStorage' 3 | 4 | const Header = (props) => { 5 | 6 | // const [username, setUsername] = useState('') 7 | 8 | // if(!data){ 9 | // setUsername('Admin') 10 | // }else{ 11 | // setUsername(data.firstName) 12 | // } 13 | 14 | const logOutUser = ()=>{ 15 | localStorage.setItem('loggedInUser','') 16 | props.changeUser('') 17 | // window.location.reload() 18 | } 19 | 20 | 21 | return ( 22 |
23 |

Hello
username 👋

24 | 25 |
26 | ) 27 | } 28 | 29 | export default Header -------------------------------------------------------------------------------- /src/components/other/TaskListNumbers.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const TaskListNumbers = ({data}) => { 4 | return ( 5 |
6 | 7 |
8 |

{data.taskCounts.newTask}

9 |

New Task

10 |
11 |
12 |

{data.taskCounts.completed}

13 |

Completed Task

14 |
15 |
16 |

{data.taskCounts.active}

17 |

Accepted Task

18 |
19 |
20 |

{data.taskCounts.failed}

21 |

Failed Task

22 |
23 |
24 | ) 25 | } 26 | 27 | export default TaskListNumbers -------------------------------------------------------------------------------- /src/context/AuthProvider.jsx: -------------------------------------------------------------------------------- 1 | import React, { createContext, useEffect, useState } from 'react' 2 | import { getLocalStorage, setLocalStorage } from '../utils/localStorage' 3 | 4 | export const AuthContext = createContext() 5 | 6 | const AuthProvider = ({ children }) => { 7 | // localStorage.clear() 8 | 9 | const [userData, setUserData] = useState(null) 10 | 11 | useEffect(() => { 12 | setLocalStorage() 13 | const {employees} = getLocalStorage() 14 | setUserData(employees) 15 | }, []) 16 | 17 | 18 | 19 | return ( 20 |
21 | 22 | {children} 23 | 24 |
25 | ) 26 | } 27 | 28 | export default AuthProvider -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | *{ 6 | color: #fff; 7 | } 8 | body{ 9 | background-color: #111; 10 | } 11 | #tasklist::-webkit-scrollbar{ 12 | background-color: transparent; 13 | height: 5px; 14 | } 15 | #tasklist::-webkit-scrollbar-thumb{ 16 | background-color: rgb(143, 143, 143); 17 | border-radius: 50px; 18 | } -------------------------------------------------------------------------------- /src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | import AuthProvider from './context/AuthProvider.jsx' 6 | 7 | 8 | ReactDOM.createRoot(document.getElementById('root')).render( 9 | 10 | 11 | 12 | 13 | 14 | 15 | , 16 | ) 17 | -------------------------------------------------------------------------------- /src/utils/localStorage.jsx: -------------------------------------------------------------------------------- 1 | 2 | const employees = [ 3 | { 4 | "id": 1, 5 | "firstName": "Arjun", 6 | "email": "e@e.com", 7 | "password": "123", 8 | "taskCounts": { 9 | "active": 2, 10 | "newTask": 1, 11 | "completed": 1, 12 | "failed": 0 13 | }, 14 | "tasks": [ 15 | { 16 | "active": true, 17 | "newTask": true, 18 | "completed": false, 19 | "failed": false, 20 | "taskTitle": "Update website", 21 | "taskDescription": "Revamp the homepage design", 22 | "taskDate": "2024-10-12", 23 | "category": "Design" 24 | }, 25 | { 26 | "active": false, 27 | "newTask": false, 28 | "completed": true, 29 | "failed": false, 30 | "taskTitle": "Client meeting", 31 | "taskDescription": "Discuss project requirements", 32 | "taskDate": "2024-10-10", 33 | "category": "Meeting" 34 | }, 35 | { 36 | "active": true, 37 | "newTask": false, 38 | "completed": false, 39 | "failed": false, 40 | "taskTitle": "Fix bugs", 41 | "taskDescription": "Resolve bugs reported in issue tracker", 42 | "taskDate": "2024-10-14", 43 | "category": "Development" 44 | } 45 | ] 46 | }, 47 | { 48 | "id": 2, 49 | "firstName": "Sneha", 50 | "email": "employee2@example.com", 51 | "password": "123", 52 | "taskCounts": { 53 | "active": 1, 54 | "newTask": 0, 55 | "completed": 1, 56 | "failed": 0 57 | }, 58 | "tasks": [ 59 | { 60 | "active": true, 61 | "newTask": false, 62 | "completed": false, 63 | "failed": false, 64 | "taskTitle": "Database optimization", 65 | "taskDescription": "Optimize queries for better performance", 66 | "taskDate": "2024-10-11", 67 | "category": "Database" 68 | }, 69 | { 70 | "active": false, 71 | "newTask": false, 72 | "completed": true, 73 | "failed": false, 74 | "taskTitle": "Design new feature", 75 | "taskDescription": "Create mockups for the new feature", 76 | "taskDate": "2024-10-09", 77 | "category": "Design" 78 | } 79 | ] 80 | }, 81 | { 82 | "id": 3, 83 | "firstName": "Ravi", 84 | "email": "employee3@example.com", 85 | "password": "123", 86 | "taskCounts": { 87 | "active": 2, 88 | "newTask": 1, 89 | "completed": 1, 90 | "failed": 0 91 | }, 92 | "tasks": [ 93 | { 94 | "active": true, 95 | "newTask": true, 96 | "completed": false, 97 | "failed": false, 98 | "taskTitle": "Prepare presentation", 99 | "taskDescription": "Prepare slides for upcoming client presentation", 100 | "taskDate": "2024-10-13", 101 | "category": "Presentation" 102 | }, 103 | { 104 | "active": true, 105 | "newTask": false, 106 | "completed": false, 107 | "failed": false, 108 | "taskTitle": "Code review", 109 | "taskDescription": "Review the codebase for optimization", 110 | "taskDate": "2024-10-12", 111 | "category": "Development" 112 | }, 113 | { 114 | "active": false, 115 | "newTask": false, 116 | "completed": true, 117 | "failed": false, 118 | "taskTitle": "Testing", 119 | "taskDescription": "Test the latest build for bugs", 120 | "taskDate": "2024-10-08", 121 | "category": "QA" 122 | } 123 | ] 124 | }, 125 | { 126 | "id": 4, 127 | "firstName": "Priya", 128 | "email": "employee4@example.com", 129 | "password": "123", 130 | "taskCounts": { 131 | "active": 2, 132 | "newTask": 1, 133 | "completed": 0, 134 | "failed": 0 135 | }, 136 | "tasks": [ 137 | { 138 | "active": true, 139 | "newTask": true, 140 | "completed": false, 141 | "failed": false, 142 | "taskTitle": "Write documentation", 143 | "taskDescription": "Update the project documentation", 144 | "taskDate": "2024-10-13", 145 | "category": "Documentation" 146 | }, 147 | { 148 | "active": true, 149 | "newTask": false, 150 | "completed": false, 151 | "failed": false, 152 | "taskTitle": "Set up CI/CD", 153 | "taskDescription": "Implement continuous integration pipeline", 154 | "taskDate": "2024-10-11", 155 | "category": "DevOps" 156 | } 157 | ] 158 | }, 159 | { 160 | "id": 5, 161 | "firstName": "Karan", 162 | "email": "employee5@example.com", 163 | "password": "123", 164 | "taskCounts": { 165 | "active": 2, 166 | "newTask": 1, 167 | "completed": 1, 168 | "failed": 0 169 | }, 170 | "tasks": [ 171 | { 172 | "active": true, 173 | "newTask": true, 174 | "completed": false, 175 | "failed": false, 176 | "taskTitle": "UI redesign", 177 | "taskDescription": "Redesign the user interface for better UX", 178 | "taskDate": "2024-10-14", 179 | "category": "Design" 180 | }, 181 | { 182 | "active": false, 183 | "newTask": false, 184 | "completed": true, 185 | "failed": false, 186 | "taskTitle": "Deploy new build", 187 | "taskDescription": "Deploy the latest build to production", 188 | "taskDate": "2024-10-09", 189 | "category": "DevOps" 190 | }, 191 | { 192 | "active": true, 193 | "newTask": false, 194 | "completed": false, 195 | "failed": false, 196 | "taskTitle": "Client feedback", 197 | "taskDescription": "Gather feedback from clients after product launch", 198 | "taskDate": "2024-10-12", 199 | "category": "Support" 200 | } 201 | ] 202 | } 203 | ]; 204 | 205 | 206 | const admin = [{ 207 | "id": 1, 208 | "email": "admin@example.com", 209 | "password": "123" 210 | }]; 211 | 212 | export const setLocalStorage = ()=>{ 213 | localStorage.setItem('employees',JSON.stringify(employees)) 214 | localStorage.setItem('admin',JSON.stringify(admin)) 215 | } 216 | export const getLocalStorage = ()=>{ 217 | const employees = JSON.parse(localStorage.getItem('employees')) 218 | const admin = JSON.parse(localStorage.getItem('admin')) 219 | 220 | return {employees,admin} 221 | } 222 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | 13 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | --------------------------------------------------------------------------------