-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e1f886
commit 446d30e
Showing
12 changed files
with
271 additions
and
65 deletions.
There are no files selected for viewing
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,18 @@ | ||
import "./TitleInput.scss"; | ||
|
||
const TitleInput = ({ id, type, label, value, setChange }) => { | ||
return ( | ||
<> | ||
<div className="input-title"> | ||
<input | ||
id={id} | ||
type={type} | ||
value={value} | ||
onChange={(e) => setChange(e.target.value)} | ||
/> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default TitleInput; |
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,31 @@ | ||
@import url("https://fonts.googleapis.com/css?family=Sora:300,300i,400,400i,500,500i,700,700i,900,900i&display=swap"); | ||
|
||
%focus { | ||
outline: 0; | ||
} | ||
|
||
.input-title { | ||
position: relative; | ||
width: 100%; | ||
color: black; | ||
font-size: 12px; | ||
font-family: "Poppins", sans-serif; | ||
|
||
input { | ||
color: #000; | ||
font-weight: 700; | ||
font-size: 18px; | ||
font-family: "Sora", sans-serif; | ||
background-color: transparent; | ||
border: none; | ||
border-bottom: 1px solid black; | ||
|
||
&:focus { | ||
@extend %focus; | ||
} | ||
} | ||
|
||
&:focus { | ||
@extend %focus; | ||
} | ||
} |
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,18 @@ | ||
import "./DescriptionInput.scss"; | ||
|
||
const DescriptionInput = ({ id, type, label, value, setChange }) => { | ||
return ( | ||
<> | ||
<div className="input-desc"> | ||
<textarea | ||
id={id} | ||
type={type} | ||
value={value} | ||
onChange={(e) => setChange(e.target.value)} | ||
/> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default DescriptionInput; |
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,28 @@ | ||
%focus { | ||
outline: 0; | ||
} | ||
.input-desc { | ||
padding-top: 20px; | ||
textarea { | ||
background-color: transparent; | ||
box-sizing: border-box; | ||
|
||
padding: 0.5em; | ||
font-family: "Poppins", sans-serif; | ||
min-width: 100%; | ||
font-size: 12px; | ||
&:focus { | ||
@extend %focus; | ||
} | ||
} | ||
textarea:placeholder { | ||
font-family: "Poppins", sans-serif; | ||
color: #ccc; | ||
&:focus { | ||
@extend %focus; | ||
} | ||
} | ||
&:focus { | ||
@extend %focus; | ||
} | ||
} |
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
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
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,47 @@ | ||
import { Trash2, Edit } from "react-feather"; | ||
|
||
const ContentTodoCard = ({ | ||
item, | ||
isChecked, | ||
addToCompleted, | ||
deleteFromBoard, | ||
setIsEdited, | ||
}) => { | ||
return ( | ||
<> | ||
<div className="todo-card-wrapper"> | ||
<div className="todo-card-check"> | ||
<h4>{item.title}</h4> | ||
<label class="check-container"> | ||
{isChecked ? ( | ||
<input type="checkbox" checked /> | ||
) : ( | ||
<input type="checkbox" onClick={() => addToCompleted(item)} /> | ||
)} | ||
<span class="checkmark"></span> | ||
</label> | ||
</div> | ||
{item.description && ( | ||
<p className="item-description">{item.description}</p> | ||
)} | ||
<p></p> | ||
<div class="todo-card-wrapper-button"> | ||
<button disabled="disabled">{item.type}</button> | ||
<div className="button-group"> | ||
{item.status !== "completed" && ( | ||
<i onClick={() => setIsEdited(true)}> | ||
<Edit /> | ||
</i> | ||
)} | ||
|
||
<i onClick={() => deleteFromBoard(item)}> | ||
<Trash2 /> | ||
</i> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ContentTodoCard; |
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,57 @@ | ||
import React, { useState } from "react"; | ||
import { Save } from "react-feather"; | ||
import TitleInput from "../../components/Input/TitleInput"; | ||
import DescriptionInput from "../../components/InputArea/DescriptionInput"; | ||
import { useDispatchTodo } from "../../data/Todo"; | ||
import "./TodoCard.scss"; | ||
|
||
const EditedTodoCard = ({ item, setIsEdited, status }) => { | ||
const dispatch = useDispatchTodo(); | ||
const editItem = (item) => { | ||
dispatch({ type: "UPDATE DATA", data: { item } }); | ||
setIsEdited(false); | ||
}; | ||
const [task, setTask] = useState({ | ||
id: item.id, | ||
status: item.status, | ||
type: item.type, | ||
title: item.title, | ||
description: item.description, | ||
}); | ||
|
||
const setChange = (option, value) => { | ||
setTask((prevState) => { | ||
return { ...prevState, [option]: value }; | ||
}); | ||
}; | ||
|
||
return ( | ||
<div className="todo-card-wrapper"> | ||
<div className="todo-card-check"> | ||
<h4> | ||
<TitleInput | ||
value={task.title} | ||
id="edit-title" | ||
setChange={(value) => setChange("title", value)} | ||
/> | ||
</h4> | ||
</div> | ||
<DescriptionInput | ||
value={task.description} | ||
id="edit-desc" | ||
setChange={(value) => setChange("description", value)} | ||
/> | ||
<p></p> | ||
<div class="todo-card-wrapper-button"> | ||
<button disabled="disabled">{item.type}</button> | ||
<div className="button-group"> | ||
<i onClick={() => editItem(task)}> | ||
<Save /> | ||
</i> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EditedTodoCard; |
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
Oops, something went wrong.