Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions src/apps/TodoList/TodoList.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,84 @@
outline: 2px solid var(--color-accent);
outline-offset: -2px;
}

.todos.app-design {
padding: 24px;
gap: 18px;
}

.todos__add {
padding: 18px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 16px;
}

.todos__add > button {
background: var(--color-text);
color: var(--color-bg);
font-weight: 650;
padding-inline: 22px;
}

.todos__filters {
align-items: stretch;
padding: 5px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 13px;
}

.todos__filters button {
flex: 1;
border-color: transparent;
}

.todos__list {
padding: 0;
margin: 0;
}

.todos__row {
padding: 12px;
margin-bottom: 10px;
border: 1px solid var(--color-border);
border-radius: 14px;
background: var(--color-surface);
box-shadow: 0 3px 9px #00000008;
}

.todos__row .todos__check {
flex: 0 0 44px;
height: 44px;
display: grid;
place-items: center;
cursor: pointer;
}

.todos__row input[type="checkbox"] {
width: 24px;
height: 24px;
margin: 0;
cursor: pointer;
}

.todos__row > span {
font-size: 14px;
line-height: 1.5;
}

.todos__row:has(input:checked) {
background: color-mix(in srgb, var(--color-surface) 60%, var(--color-bg));
}

.todos > p {
color: var(--color-text-dim);
font-size: 12px;
}

@media (max-width: 600px) {
.todos.app-design {
padding: 14px;
}
}
23 changes: 16 additions & 7 deletions src/apps/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { AppHeading } from "../shared/AppHeading";
import { ListChecks } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import type { AppProps } from "../../types";
import { useTodoStore } from "../../stores/useTodoStore";
Expand Down Expand Up @@ -75,7 +77,12 @@ export function TodoList({ launchProps }: AppProps) {
}

return (
<section className="todos" aria-label="To-Do List">
<section className="todos app-design" aria-label="To-Do List">
<AppHeading
icon={ListChecks}
title="My tasks"
subtitle="A LITTLE PROGRESS, EVERY DAY"
/>
<form className="todos__add" onSubmit={addTask}>
<label>
New task
Expand Down Expand Up @@ -123,12 +130,14 @@ export function TodoList({ launchProps }: AppProps) {
else rows.current.delete(task.id);
}}
>
<input
type="checkbox"
aria-label={`Complete ${task.title}`}
checked={task.completed}
onChange={() => toggle(task.id)}
/>
<label className="todos__check">
<input
type="checkbox"
aria-label={`Complete ${task.title}`}
checked={task.completed}
onChange={() => toggle(task.id)}
/>
</label>
{editingId === task.id ? (
<div className="todos__edit">
<label>
Expand Down
2 changes: 1 addition & 1 deletion src/apps/registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const appRegistry: Record<AppId, AppDefinition> = {
icon: "ListTodo",
component: TodoList,
defaultWidth: 600,
defaultHeight: 520,
defaultHeight: 740,
minWidth: 300,
minHeight: 300,
singleInstance: true,
Expand Down
Loading