+
{props.list.title}
@@ -39,7 +43,12 @@ export default function ListTitle(props: Props) {
})}
{props.progress !== '0' ? (
-
+
{props.progress}%
) : null}
diff --git a/app/[listsId]/SingleViewList.tsx b/app/[listsId]/SingleViewList.tsx
index 6d1d0e8..d9748b1 100644
--- a/app/[listsId]/SingleViewList.tsx
+++ b/app/[listsId]/SingleViewList.tsx
@@ -194,7 +194,7 @@ export default function SingleViewList(props: Props) {
<>
{data.singleListWithTasks.sharedUsers.length > 1 && (
-
+
You
{data.singleListWithTasks.sharedUsers.map((user: User) => {
if (props.currentUser === user.username) {
@@ -211,9 +211,8 @@ export default function SingleViewList(props: Props) {
);
})}
share this list.
-
+
)}
- {onShareError ?
{onShareError}
: null}
@@ -227,7 +226,7 @@ export default function SingleViewList(props: Props) {
placeholder="enter a username"
value={username}
onChange={(event) => setUsername(event.currentTarget.value)}
- onFocus={() => setOnError('')}
+ onFocus={() => setOnShareError('')}
/>
+ {onShareError ? (
+
+ {onShareError}
+
+ ) : null}
diff --git a/app/components/TaskComponent.tsx b/app/components/TaskComponent.tsx
index a756816..d75721c 100644
--- a/app/components/TaskComponent.tsx
+++ b/app/components/TaskComponent.tsx
@@ -31,7 +31,6 @@ export default function TaskComponent(props: Props) {
const [done, setDone] = useState(props.task.done);
const [title, setTitle] = useState(props.task.title);
const [editTitle, setEditTitle] = useState(false);
-
const { task } = props;
const [handleDeleteTask, { loading }] = useMutation(deleteTaskMutation, {
@@ -81,6 +80,18 @@ export default function TaskComponent(props: Props) {
id={`task-title-${task.id}`}
className="checkbox checkbox-primary"
checked={done}
+ onKeyUp={async (event) => {
+ if (event.key === 'Enter') {
+ setDone(!done);
+ await handleUpdateTask({
+ variables: {
+ id: task.id,
+ title: title,
+ done: !done,
+ },
+ });
+ }
+ }}
onChange={async () => {
setDone(!done);
await handleUpdateTask({