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

react1-week3/Viki #289

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

react1-week3/Viki #289

wants to merge 3 commits into from

Conversation

VictoriaDem17
Copy link

No description provided.

Copy link

@BrantalikP BrantalikP left a comment

Choose a reason for hiding this comment

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

@VictoriaDem17 Heey, The app is beautiful as always 👏 Great job! I have found some issues related to functionality, please look into it. Thank you!

@@ -0,0 +1,81 @@
import { v4 as uuidv4 } from "uuid";

Choose a reason for hiding this comment

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

kudos for using uuid library 👏

import TodoList from "./components/TodoList";
import Form from "./components/Form";
import Header from "./components/Header";
import Timer from "./components/Timer";

Choose a reason for hiding this comment

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

Hey @VictoriaDem17, The app is crashing right now due to a mismatch between file names for Form, TodoList, and Header. Please fix the file names :) (All of them should be capitalized)


const TodoList = ({ todos, setTodos, setEditTodo }) => {
const handleComplete = ({ id }) => {
setTodos(

Choose a reason for hiding this comment

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

Although it's not wrong but its better to use the parameter from setter directly, to ensure the data stay consists
The same applies for all methods :)
setTodos(prevTodos => prevTodos.map ... )

"https://gist.githubusercontent.com/benna100/391eee7a119b50bd2c5960ab51622532/raw"
)
.then((res) => res.json())
.then((data) => setTodos(data));

Choose a reason for hiding this comment

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

missing error handling


return (
<div>
{todos.length === 0 ? (

Choose a reason for hiding this comment

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

this is ok, but I think you can choose more readable approach

if(todos.length === 0) return null

return ( 
<div> {todos.map... }..... </div>)


useEffect(() => {
if (editTodo) {
setInput(editTodo.description, editTodo.deadline);

Choose a reason for hiding this comment

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

this wont work, setter takes only one argument, you are passing to

editTodo,
setEditTodo,
}) => {
const updateTodo = (description, id, completed, deadline) => {

Choose a reason for hiding this comment

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

The update logic is broken right now, please look into it

Screen.Recording.2024-04-14.at.15.12.17.mov

/>
<input
type="date"
className="deadline-input"

Choose a reason for hiding this comment

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

you can set minValue for date to prevent selecting the dates in the past

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants