Skip to content
Snippets Groups Projects
Commit 050a1117 authored by Planoetscher Daniel (Student Com20)'s avatar Planoetscher Daniel (Student Com20)
Browse files

task overview item updated

parent f840a6bb
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,6 @@ export default function TaskForm({ task, onSubmit, project }: Props) { ...@@ -102,7 +102,6 @@ export default function TaskForm({ task, onSubmit, project }: Props) {
const handleSubmit = useCallback(async (e: FormEvent) => { const handleSubmit = useCallback(async (e: FormEvent) => {
e.preventDefault(); e.preventDefault();
console.log(priority);
if (validateName(name ?? '') === null && if (validateName(name ?? '') === null &&
validateText(text ?? '') === null && validateText(text ?? '') === null &&
...@@ -145,7 +144,7 @@ export default function TaskForm({ task, onSubmit, project }: Props) { ...@@ -145,7 +144,7 @@ export default function TaskForm({ task, onSubmit, project }: Props) {
} }
</select> </select>
<Picker onEmojiClick={(e, emoji) => setIcon(emoji.unified)} /> <Picker onEmojiClick={(e, emoji) => setIcon(emoji.originalUnified)} />
<h2>Dependencies</h2> <h2>Dependencies</h2>
{ {
allTasks.length > 0 ? ( allTasks.length > 0 ? (
......
@use 'styles/settings.scss' as s; @use 'styles/settings.scss'as s;
.assignee-list { .assignee-list {
display: flex; display: flex;
...@@ -10,17 +10,18 @@ ...@@ -10,17 +10,18 @@
} }
.assignee, .assignee,
.overhead { .avatar {
margin-left: -8px; margin-left: -8px;
width: 35px;
height: 35px;
img { img {
width: 35px; width: 100%;
height: 35px;
border-radius: 50%; border-radius: 50%;
} }
} }
.overhead { .overhead {
background: s.$primary; background: s.$primary;
display: flex; display: flex;
......
...@@ -2,6 +2,8 @@ import './task.scss'; ...@@ -2,6 +2,8 @@ import './task.scss';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import AssigneeList from 'components/ui/AssigneeList'; import AssigneeList from 'components/ui/AssigneeList';
import { Task as ITask } from 'adapters/task'; import { Task as ITask } from 'adapters/task';
import { useEffect, useState } from 'react';
import { getUser, User } from 'adapters/user';
interface Props { interface Props {
task: ITask, task: ITask,
...@@ -12,22 +14,22 @@ function formattedTime(date: Date) { ...@@ -12,22 +14,22 @@ function formattedTime(date: Date) {
} }
export default function Task({ task }: Props) { export default function Task({ task }: Props) {
const [assignees, setAssignees] = useState<User[]>([]);
const start = new Date(200); const start = new Date(200);
const end = new Date(300); const end = new Date(300);
const member = { useEffect(() => {
id: 'asdf', task.assigned.forEach((assign) => {
username: 'testname', getUser(assign.user).then((user) => setAssignees(state => [...state, user])).catch(() => {})
realname: 'Roland Bernard', })
role: 'Backend' }, []);
}
return ( return (
<Link to={'/tasks/' + task.id} className="task"> <Link to={'/tasks/' + task.id} className="task">
<div className="project-indicator"></div> <div className="project-indicator"></div>
<div className="main-info"> <div className="main-info">
<div className="icon-container"> <div className="icon-container">
{task.icon} {String.fromCharCode(parseInt(task.icon, 16))}
</div> </div>
<div className="text-container"> <div className="text-container">
<h4>{task.name}</h4> <h4>{task.name}</h4>
...@@ -37,7 +39,7 @@ export default function Task({ task }: Props) { ...@@ -37,7 +39,7 @@ export default function Task({ task }: Props) {
<div className="description-container"> <div className="description-container">
{task.text} {task.text}
</div> </div>
<AssigneeList assignees={[member, member, member, member, member]} max={3} /> <AssigneeList assignees={assignees} max={3} />
</Link> </Link>
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment