mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 00:44:14 +00:00
feat: add header to todos
This commit is contained in:
parent
7f3ac26b98
commit
c6cc61a17f
5 changed files with 71 additions and 6 deletions
|
|
@ -22,6 +22,7 @@ export function Form() {
|
|||
<form onSubmit={handleSubmit}>
|
||||
<div className={styles.wrapper}>
|
||||
<input
|
||||
placeholder="I have to ..."
|
||||
type="text"
|
||||
value={value}
|
||||
onChange={e => setValue(e.target.value)}
|
||||
|
|
|
|||
|
|
@ -1 +1,14 @@
|
|||
/* WIP */
|
||||
.header {
|
||||
margin-bottom: 16px;
|
||||
|
||||
& .title {
|
||||
margin-bottom: 8px;
|
||||
font-family: var(--font-heading);
|
||||
font-size: var(--font-md);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
& .desc {
|
||||
color: var(--color-foreground-subtle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ interface TodoProps {
|
|||
export function Todo({ onClose, show }: TodoProps) {
|
||||
return (
|
||||
<Modal show={show} onClose={onClose}>
|
||||
<h2 className={styles.title}>Todos</h2>
|
||||
<header className={styles.header}>
|
||||
<h2 className={styles.title}>Todo Checklist</h2>
|
||||
<p className={styles.desc}>Super simple todo list.</p>
|
||||
</header>
|
||||
|
||||
<Form />
|
||||
<Todos />
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -1 +1,31 @@
|
|||
/* WIP */
|
||||
.todos {
|
||||
margin-top: 28px;
|
||||
|
||||
& header {
|
||||
display: flex;
|
||||
column-gap: 8px;
|
||||
align-items: center;
|
||||
|
||||
& .label {
|
||||
font-size: var(--font-sm);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
& .divider {
|
||||
flex-grow: 1;
|
||||
height: 1px;
|
||||
background-color: var(--color-neutral-200);
|
||||
}
|
||||
|
||||
& .counter {
|
||||
font-size: var(--font-sm);
|
||||
color: var(--color-foreground-subtle);
|
||||
}
|
||||
}
|
||||
|
||||
& .empty {
|
||||
margin-top: 16px;
|
||||
font-size: var(--font-sm);
|
||||
color: var(--color-foreground-subtle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,26 @@ export function Todos() {
|
|||
|
||||
return (
|
||||
<div className={styles.todos}>
|
||||
{todos.map(todo => (
|
||||
<Todo done={todo.done} id={todo.id} key={todo.id} todo={todo.todo} />
|
||||
))}
|
||||
<header>
|
||||
<p className={styles.label}>Your Todos</p>
|
||||
<div className={styles.divider} />
|
||||
<p className={styles.counter}>0 / 0</p>
|
||||
</header>
|
||||
|
||||
{todos.length > 0 ? (
|
||||
<>
|
||||
{todos.map(todo => (
|
||||
<Todo
|
||||
done={todo.done}
|
||||
id={todo.id}
|
||||
key={todo.id}
|
||||
todo={todo.todo}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
<p className={styles.empty}>You don't have any todos.</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue