feat: styles and mark tasks

This commit is contained in:
2025-04-15 12:43:53 +03:00
parent 3d4858bcbb
commit af335ab4a8
10 changed files with 54 additions and 17 deletions

View File

@@ -1,16 +1,40 @@
import { FunctionComponent } from "preact";
import { tv } from "tailwind-variants";
import classes from "./task.module.scss";
interface TaskProps {
name: string;
checked?: boolean;
}
const Task: FunctionComponent<TaskProps> = ({ name }: TaskProps) => {
const taskStyle = tv({
base: "flex aspect-square h-full flex-col items-center justify-center rounded-full border",
variants: {
checked: {
true: "bg-black",
false: "bg-white",
},
},
});
const markStyle = tv({
base: "text-4xl font-light text-white",
variants: {
checked: {
true: "block",
false: "hidden",
},
},
});
const Task: FunctionComponent<TaskProps> = ({ name, checked = false }: TaskProps) => {
return (
// Временное действие для тестирования
<button onClick={() => alert(name)}>
<div class={classes.task}>
<div class="aspect-square h-full rounded-full border bg-white"></div>
<div class={taskStyle({ checked })}>
<p class={markStyle({ checked })}></p>
</div>
{name}
</div>
</button>