feat: add MemoFooter and MemoCompleteList components; enhance ListItem with strike-through for completed tasks

This commit is contained in:
Ahmed-Elgendy25 2026-03-23 20:49:02 +02:00
parent f9f239d4d3
commit 849a8762cb
6 changed files with 35 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -54,6 +54,9 @@ export const ListItem = ({ children, className, node: _node, ...domProps }: List
"[&>button]:mr-2 [&>button]:align-middle",
// Inline paragraph for task text
"[&>p]:inline [&>p]:m-0",
// NEW: strike through text when checkbox is checked
"[&:has(button[data-state=checked])]:line-through",
"[&:has(button[data-state=checked])]:text-gray-400",
className,
)}
{...domProps}

View File

@ -12,6 +12,7 @@ import { MEMO_CARD_BASE_CLASSES } from "./constants";
import { useImagePreview } from "./hooks";
import { computeCommentAmount, MemoViewContext } from "./MemoViewContext";
import type { MemoViewProps } from "./types";
import MemoFooter from "./components/MemoFooter";
const MemoView: React.FC<MemoViewProps> = (props: MemoViewProps) => {
const {
@ -165,7 +166,7 @@ const MemoView: React.FC<MemoViewProps> = (props: MemoViewProps) => {
/>
<MemoBody compact={compact} />
<MemoFooter/>
<PreviewImageDialog
open={previewState.open}
onOpenChange={setPreviewOpen}

View File

@ -0,0 +1,19 @@
import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
function MemoCompleteList() {
return (
<section className=" flex items-center gap-3">
<div className=" flex items-center gap-2 ">
<span>Completed Task</span>
<Switch
defaultChecked
className=" [&>[data-slot=switch-thumb][data-state=unchecked]]:bg-mauve-400 [&>[data-slot=switch-thumb][data-state=checked]]:bg-white"
/>
</div>
<Button className=" not-hover:border-foreground not-hover:text-foreground bg-transparent border-2 transition-all ease-linear">Clear Completed</Button>
</section>
)
}
export default MemoCompleteList

View File

@ -0,0 +1,11 @@
import MemoCompleteList from "./MemoCompleteList";
function MemoFooter() {
return (
<footer className=" w-full mt-5 flex justify-end items-center">
<MemoCompleteList/>
</footer>
);
}
export default MemoFooter;