diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..95cdb49 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "to-do-list-app"] + path = to-do-list-app + url = https://github.com/phenomenalCode/to-do-list-app.git diff --git a/README.md b/README.md index d1c68b5..4d8a7bb 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Todo \ No newline at end of file +# Todo + +netlify: https://darius-to-do-app.netlify.app/ diff --git a/index.html b/index.html index f7ac4e4..705d22b 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,10 @@ + Todo diff --git a/package.json b/package.json index caf6289..72ad3a1 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,16 @@ "preview": "vite preview" }, "dependencies": { + "@date-io/date-fns": "^3.2.1", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.0", + "@mui/lab": "^7.0.0-beta.13", + "@mui/material": "^7.1.0", + "@mui/x-date-pickers": "^8.5.0", + "date-fns": "^4.1.0", "react": "^19.0.0", - "react-dom": "^19.0.0" + "react-dom": "^19.0.0", + "zustand": "^5.0.5" }, "devDependencies": { "@eslint/js": "^9.21.0", @@ -22,6 +30,6 @@ "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.19", "globals": "^15.15.0", - "vite": "^6.2.0" + "vite": "^6.3.5" } } diff --git a/public/photos/7247856.webp b/public/photos/7247856.webp new file mode 100644 index 0000000..0f41ea1 Binary files /dev/null and b/public/photos/7247856.webp differ diff --git a/public/photos/stars-night-galaxy-4k-3840x2160.webp b/public/photos/stars-night-galaxy-4k-3840x2160.webp new file mode 100644 index 0000000..6c1b3f8 Binary files /dev/null and b/public/photos/stars-night-galaxy-4k-3840x2160.webp differ diff --git a/src/App.jsx b/src/App.jsx index 5427540..555a082 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,148 @@ +import React, { useState, useMemo, useCallback } from 'react'; +import { useTaskStore } from './store/useTaskStore'; +import { Header } from './Header'; +import { SubmitTask } from './SubmitTask'; +import { DisplayTasks } from './DisplayTasks'; +import { Footer } from './Footer'; +import './index.css'; +import { + Box, + Button, + Typography, + Paper, + Container, + CssBaseline, + createTheme, + ThemeProvider, +} from '@mui/material'; + +// // Optionally lazy load heavy components: +// const Header = React.lazy(() => import('./Header')); +// const SubmitTask = React.lazy(() => import('./SubmitTask')); +// const DisplayTasks = React.lazy(() => import('./DisplayTasks')); +// const Footer = React.lazy(() => import('./Footer')); + export const App = () => { + const [darkMode, setDarkMode] = useState(false); + const tasks = useTaskStore((s) => s.tasks); + + // Memoize theme to prevent recreation on every render + const theme = useMemo( + () => + createTheme({ + palette: { + mode: darkMode ? 'dark' : 'light', + primary: { + main: darkMode ? '#9c27b0' : '#1976d2', + contrastText: '#fff', + }, + background: { + default: darkMode ? '#000' : '#fff', + paper: darkMode ? '#1a1a1a' : '#f5f5f5', + }, + }, + }), + [darkMode] + ); + + const toggleDarkMode = useCallback(() => { + setDarkMode((prev) => !prev); + }, []); + + const completeAll = () => { + const { tasks, toggleTaskCompletion } = useTaskStore.getState(); + tasks.forEach((t) => !t.completed && toggleTaskCompletion(t.id)); + }; + return ( -

React Boilerplate

- ) -} + + + + +
+ + + + + + + ({ + order: { xs: 1, md: 2 }, + flexGrow: 1, + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + gap: 3, + width: '100%', + maxWidth: { md: 900, lg: 1100 }, + p: { xs: 2, sm: 3, md: 4 }, + borderRadius: 2, + boxShadow: 4, + backgroundColor: + theme.palette.mode === 'dark' + ? 'rgba(33,33,33,0.85)' + : 'rgba(255,255,255,0.85)', + color: theme.palette.text.primary, + })} + > + + + To Do List + + Total Tasks: {tasks.length} + + Uncompleted Tasks: {tasks.filter((t) => !t.completed).length} + + + + + + + + + + + + +