-
Notifications
You must be signed in to change notification settings - Fork 34
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-todos-context-vite #24
Open
lunek1
wants to merge
22
commits into
Technigo:main
Choose a base branch
from
lunek1:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
222f281
Delete pull_request_template.md
lunek1 a99b0d5
Delete src/assets/banner.svg
lunek1 927f9b8
Update README.md
lunek1 7eb4798
Created components, need to add functions
lunek1 ec5a7d1
Listname, workout components done. Todo need fix
lunek1 42d0fd8
Components done, except to do list, add responsive
lunek1 bc32a32
TodoList component done, all styling done
lunek1 e2a6c4d
Added folders to components
lunek1 0440a9c
Responsiveness added
lunek1 36db829
Fixed responsiveness ReminderBlock
lunek1 593d0ab
Merge branch 'main' of https://github.com/lunek1/project-todos-contex…
lunek1 69e35df
Delete .gitignore
lunek1 6f1c786
Delete instructions.md
lunek1 06d40a0
Update README.md
lunek1 9bb68bb
Update index.css
lunek1 8c88e2a
Removed reminder, added hide/show to workout
lunek1 b416cf6
Merge branch 'main' of https://github.com/lunek1/project-todos-contex…
lunek1 46cdcb5
StickyNotes component added
lunek1 74781fe
Changes h2 size for responsiveness
lunek1 8e4d4fb
Changed color to darker on all buttons
lunek1 ca5d8d1
Added labels for accessibility
lunek1 57c4f1a
Removed text inside label
lunek1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,26 @@ | ||
<h1 align="center"> | ||
<a href=""> | ||
<img src="./src/assets/banner.svg" alt="Project Banner Image"> | ||
</a> | ||
</h1> | ||
|
||
# Todo - useContext Project | ||
|
||
Replace this readme with your own information about your project. | ||
## Getting Started with the Project | ||
|
||
Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. | ||
|
||
## Getting Started with the Project | ||
|
||
### Dependency Installation & Startup Development Server | ||
This weeks project was to do an To-Do App. In the app you can add tasks to a list, I've set a maximum of 10 tasks at a time. Once completed you check the box and the task will be overlined, you can also choose to remove a task. | ||
|
||
Once cloned, navigate to the project's root directory and this project uses npm (Node Package Manager) to manage its dependencies. | ||
### The Problem | ||
|
||
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. | ||
How did you plan? | ||
It was fun to have free hands on this weeks project. Although, that made it quite difficult to decide on what to do. Decided to go simple and went for a To-Do list design/approach that I personally could use as a weekly planner. | ||
|
||
```bash | ||
npm i && code . && npm run dev | ||
``` | ||
If you had more time, what would be next? | ||
With more time I would have added date/time to the To-Do tasks. I would have added a component for notes were the user can write down information more freely. Also would have liked to add a "complete all-button" to the To-Do list that targets all tasks. | ||
|
||
### The Problem | ||
What technologies did you use? | ||
State hooks such as useState were used to manage data within each component, such as to-do tasks, reminder text, workout days, etc. | ||
Event handling functions were implemented to handle user interactions like adding/removing tasks, toggling task completion, setting reminders, etc. | ||
|
||
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? | ||
Setting the date in ListName.jsx and ReminderBlock.jsx might not be showing as it should on phone views. | ||
|
||
### 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. | ||
https://majestic-moxie-414767.netlify.app/ | ||
|
||
## Instructions | ||
|
||
<a href="instructions.md"> | ||
See instructions of this project | ||
</a> |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
import { useState } from "react"; | ||
import { TodoProvider } from "./Components/TodoContext/TodoContext.jsx"; | ||
import { ListName } from "./Components/ListName/ListName.jsx"; | ||
import { TodoList } from "./Components/TodoList/TodoList.jsx"; | ||
import { WorkoutBlock } from "./Components/Workout/WorkoutBlock.jsx"; | ||
import { StickyNote } from "./Components/StickyNote/StickyNote.jsx"; // Import StickyNote | ||
import "./index.css"; | ||
|
||
export const App = () => { | ||
return <div>Find me in App.jsx!</div>; | ||
const [isWorkoutBlockVisible, setIsWorkoutBlockVisible] = useState(true); | ||
|
||
const toggleWorkoutBlockVisibility = () => { | ||
setIsWorkoutBlockVisible(!isWorkoutBlockVisible); | ||
}; | ||
|
||
return ( | ||
<TodoProvider> | ||
<div> | ||
<h1>To-Do App</h1> | ||
</div> | ||
<div className="container"> | ||
<div className="left-block"> | ||
<TodoList /> | ||
</div> | ||
<div className="right-block"> | ||
<div className="first-block"> | ||
<ListName /> | ||
</div> | ||
<div | ||
className={`second-block ${ | ||
isWorkoutBlockVisible ? "expanded" : "collapsed" | ||
}`} | ||
> | ||
<div className="second-block-content"> | ||
{isWorkoutBlockVisible && <WorkoutBlock />} | ||
</div> | ||
<button | ||
className="toggle-button" | ||
onClick={toggleWorkoutBlockVisibility} | ||
> | ||
{isWorkoutBlockVisible ? "−" : "+"} | ||
</button> | ||
</div> | ||
<div className="third-block"> | ||
<StickyNote /> | ||
</div> | ||
</div> | ||
</div> | ||
</TodoProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.listname-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
text-align: center; | ||
} | ||
|
||
.listname-container h2 { | ||
font-family: "Poltawski Nowy", sans-serif; | ||
font-size: 25px; | ||
color: #382e2c; | ||
margin: auto; | ||
margin-top: 10px; | ||
} | ||
|
||
.listname-container input { | ||
font-family: "Raleway", sans-serif; | ||
font-size: 18px; | ||
color: #695853; | ||
margin-left: 10px; | ||
cursor: pointer; | ||
border: 1px solid #9a9086; | ||
border-radius: 10px; | ||
padding: 6px 10px; | ||
} | ||
|
||
.listname-container input:focus { | ||
outline: 1px solid #695853; | ||
} | ||
|
||
/* Media Query */ | ||
@media (max-width: 480px) { | ||
.listname-container h2 { | ||
font-size: 18px; | ||
} | ||
|
||
.listname-container input { | ||
font-size: 14px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { useState } from "react"; | ||
import "./ListName.css"; | ||
|
||
export const ListName = () => { | ||
// State to store the list name and date | ||
const [listName, setListName] = useState("Weekly planner"); | ||
const [date, setDate] = useState(""); | ||
|
||
// Handler to update the list name | ||
const handleListNameChange = (event) => { | ||
setListName(event.target.value); | ||
}; | ||
|
||
// Handler to update the date | ||
const handleDateChange = (event) => { | ||
setDate(event.target.value); | ||
}; | ||
|
||
// Function to clear default text when input is clicked | ||
const clearDefaultText = (stateSetter, defaultText) => { | ||
if (stateSetter === listName) { | ||
if (listName === defaultText) { | ||
setListName(""); | ||
} | ||
} else if (stateSetter === date) { | ||
if (date === defaultText) { | ||
setDate(""); | ||
} | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="listname-container"> | ||
<div className="input-group"> | ||
<h2> | ||
<label htmlFor="listName">List name:</label> | ||
<input | ||
type="text" | ||
id="listName" | ||
value={listName} | ||
onChange={handleListNameChange} | ||
onClick={() => clearDefaultText(listName, "Weekly planner")} | ||
/> | ||
</h2> | ||
</div> | ||
<div className="input-group"> | ||
<h2> | ||
<label htmlFor="date">Date:</label> | ||
<input | ||
type="week" | ||
id="date" | ||
value={date} | ||
onChange={handleDateChange} | ||
onClick={() => clearDefaultText(date, "")} | ||
/> | ||
</h2> | ||
</div> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming conventions could be improved for consistency and clarity. For example, some components and CSS classes use camelCase while others use kebab-case.