Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project-15-to-dos-zustand-vite #39

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@

# Todo - useContext Project

Replace this readme with your own information about your project.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
Todo app where you list your todos, delete when finished.

## Getting Started with the Project

### Dependency Installation & Startup Development Server

Once cloned, navigate to the project's root directory and this project uses npm (Node Package Manager) to manage its dependencies.

The command below is a combination of installing dependencies, opening up the project on VS Code and it will run a development server on your terminal.
Zustand, useContext

```bash
npm i && code . && npm run dev
```

### The Problem

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?


### View it live

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
Netlify: https://mytodos-erika.netlify.app/

## Instructions

Expand Down
168 changes: 154 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.18.0"
"react-router-dom": "^6.18.0",
"styled-components": "^6.1.13",
"zustand": "^5.0.1"
},
"devDependencies": {
"@types/react": "^18.2.15",
Expand Down
5 changes: 2 additions & 3 deletions pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## Netlify link
Add your Netlify link here.
PS. Don't forget to add it in your readme as well.
https://mytodos-erika.netlify.app/

## Collaborators
Add any collaborators here.
-
27 changes: 26 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
import React from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to import React

import { useTheme } from "./context/ThemeContext";
import { GlobalStyle } from "./styles/GlobalStyle";
import Header from "./components/Header";
import TodoList from "./components/TodoList";
import AddTodoPopup from "./components/AddTodoPopup";
import AddTodoButton from "./components/AddTodoButton";


export const App = () => {
return <div>Find me in App.jsx!</div>;
const { isDarkMode } = useTheme();
const [isPopupOpen, setIsPopupOpen] = React.useState(false);



return (
<>
<GlobalStyle theme={{ isDarkMode }} />
<div>
<Header theme={{ isDarkMode }} togglePopup={() => setIsPopupOpen(true)} />
<TodoList />
{isPopupOpen && <AddTodoPopup onClose={() => setIsPopupOpen(false)} />}
<AddTodoButton onClick={() => setIsPopupOpen(true)} />
</div>
</>
)
};

Binary file added src/assets/Detective-check-footprint 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Detective-check-footprint-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/components/AddTodoButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import styled from "styled-components";

const FloatingButton = styled.button`
position: fixed;
bottom: 20px;
right: 20px;
width: 60px;
height: 60px;
background-color: #6c63ff; /* Lila färg */
color: #fff;
border: none;
border-radius: 50%;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: background-color 0.3s ease;

&:hover {
background-color: #5a54e3; /* Lite mörkare lila vid hover */
}
`;

const AddTodoButton = ({ onClick }) => {
return <FloatingButton onClick={onClick}>+</FloatingButton>;
};

export default AddTodoButton;
Loading