-
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
1268ee5
commit 566148d
Showing
19 changed files
with
880 additions
and
68 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -1,38 +1,7 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
.App{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
justify-content: space-between; | ||
height: 100vh; | ||
background-color: #e5e5dc; | ||
} |
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
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,17 @@ | ||
import React from 'react'; | ||
import './CreateTask.styles.scss'; | ||
|
||
type Props = { | ||
onOpenModal: () => void; | ||
}; | ||
|
||
|
||
const CreateTask = ({ onOpenModal }: Props) => { | ||
return ( | ||
<div className="createtask-card" onClick={onOpenModal}> | ||
<p>+</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CreateTask; |
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 @@ | ||
.createtask-card{ | ||
display: flex; | ||
width: 180px; | ||
height: 200px; | ||
background-color: #f5f0e1; | ||
border-radius: 8px; | ||
overflow: hidden; | ||
align-items: center; | ||
justify-content: center; | ||
opacity: 0.78; | ||
} | ||
.createtask-card:hover{ | ||
opacity: 1; | ||
} | ||
.createtask-card > p { | ||
color: #1e3d59; | ||
font-size: 60px; | ||
} |
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,52 @@ | ||
import React from 'react'; | ||
import './Task.styles.scss'; | ||
import { Task as TaskType } from '../../models/Task'; | ||
import { useDraggable } from '@dnd-kit/core'; | ||
import { TaskStatus } from '../../models/TaskStatus'; | ||
import { stat } from 'fs/promises'; | ||
|
||
interface Props { | ||
id: number; | ||
title: string; | ||
text: string; | ||
status: TaskStatus; | ||
deleteTask: () => void; // Function to delete the task | ||
onEdit: () => void; // Function to edit the task | ||
}; | ||
|
||
|
||
const Task= ({ id, title, text, status, deleteTask, onEdit } : Props) => { | ||
|
||
const {attributes, listeners, setNodeRef, transform} = useDraggable({id: id}); | ||
|
||
const style = transform ? { | ||
position: 'absolute' as 'absolute', | ||
zIndex: '1000', | ||
transform: `translate(${transform.x}px, ${transform.y}px)`, | ||
} : undefined; | ||
|
||
// const headerColor = status === TaskStatus.Pending ? "#5c3c92" : | ||
// status === TaskStatus.InProgress ? "#ff6e40" : "#c4a35a"; | ||
|
||
return ( | ||
<div className='task-card' | ||
style={style}> | ||
<div className="task-header" ref={setNodeRef} {...listeners} {...attributes} | ||
// style={ | ||
// {backgroundColor: headerColor} | ||
// } | ||
> | ||
<h3>{title}</h3> | ||
</div> | ||
<div className="task-textarea" ref={setNodeRef} {...listeners} {...attributes}> | ||
<p className='task-text'>{text} </p> | ||
</div> | ||
<div className="task-footer"> | ||
<button type="submit" className='button' onClick={onEdit}>Edit</button> | ||
<button type="submit" className='button' onClick={deleteTask}>Delete</button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Task; |
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,59 @@ | ||
.task-card{ | ||
display: flex; | ||
flex-direction: column; | ||
width: 180px; | ||
height: 200px; | ||
background-color: #f5f0e1; | ||
border-radius: 8px; | ||
box-shadow: 3px 3px 3px red; | ||
overflow: hidden; | ||
// position: fixed; | ||
} | ||
|
||
.task-card:active{ | ||
box-shadow: 5px 5px 5px rgba(255, 0, 0, 0.563); | ||
} | ||
|
||
.task-header{ | ||
background-color: #ff6e40; | ||
color: white; | ||
padding: 0.65px; | ||
font-size: 13px; | ||
font-weight: bold; | ||
text-align: center; | ||
flex-shrink: 0; | ||
} | ||
|
||
.task-textarea{ | ||
padding: 6px; | ||
font-size: 13px; | ||
color: #333; | ||
text-align: center; | ||
overflow: hidden; | ||
flex-grow: 1; | ||
} | ||
|
||
.task-footer{ | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: #ffc13b; | ||
color: #555; | ||
padding: 6px; | ||
text-align: center; | ||
border-top: 1px solid #ddd; | ||
flex-shrink: 0; | ||
} | ||
|
||
.button{ | ||
width: 57px; | ||
height: 30px; | ||
margin: 0 7px; | ||
background-color: #f5f0e1; | ||
border: 1.25px solid #ff6e40; | ||
border-radius: 6px; | ||
color: #1e3d59; | ||
font-weight: bold; | ||
} | ||
.button:hover{ | ||
background-color: #f5f0e1ba; | ||
} |
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 React from 'react'; | ||
import './TaskLine.styles.scss'; | ||
import Task from '../Task/Task.component'; | ||
import CreateTask from '../CreateTask/CreateTask.component'; | ||
import { TaskStatus } from '../../models/TaskStatus'; | ||
import { Task as TaskType } from '../../models/Task'; | ||
import { useDroppable } from '@dnd-kit/core'; | ||
|
||
type Props = { | ||
taskLineName: string; | ||
tasks: TaskType[]; | ||
onCreateTask?: () => void; | ||
onDeleteTask: (id: number) => void; | ||
onEditTask: (task: TaskType) => void; | ||
} | ||
|
||
const TaskLine = ({ taskLineName, tasks, onCreateTask, onDeleteTask, onEditTask} : Props) => { | ||
|
||
const backgroundColor = | ||
taskLineName === "Pending" ? "#077b8a" : | ||
taskLineName === "In Progress" ? "#e0a96d" : "#77c593" ; | ||
|
||
const { setNodeRef } = useDroppable({id: taskLineName}); | ||
|
||
return ( | ||
|
||
<div ref={setNodeRef} className='tasklist-container' style={{ backgroundColor }}> | ||
<h3 className='tasklist-name'>{taskLineName}</h3> | ||
<div className='taskline'> | ||
{tasks.map((task) => ( | ||
<Task | ||
key={task.id} | ||
{...task} | ||
deleteTask={() => onDeleteTask(task.id)} | ||
onEdit={() => onEditTask(task)} | ||
/> | ||
))} | ||
{taskLineName === "Pending" && onCreateTask && ( | ||
<CreateTask onOpenModal={onCreateTask} /> | ||
)} | ||
</div> | ||
</div> | ||
|
||
|
||
) | ||
} | ||
export default TaskLine; |
Oops, something went wrong.