-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use @contellar for state manipulation
- Loading branch information
1 parent
b9ff26c
commit 36cc69e
Showing
18 changed files
with
372 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
import { useSetAtom } from "jotai"; | ||
import { useCallback } from "react"; | ||
|
||
import { WideButton } from "./wideButton"; | ||
|
||
import { useColor } from "@/hooks/color"; | ||
import { clearItemsAtom } from "@/stores/timerLists"; | ||
import { timerListAtom } from "@/stores/timerLists"; | ||
import { getUUID } from "@/utils/uuid"; | ||
|
||
export function ClearList() { | ||
const clear = useSetAtom(clearItemsAtom); | ||
const send = useSetAtom(timerListAtom); | ||
const clear = useCallback( | ||
() => send({ type: "clear", target: getUUID() }), | ||
[send], | ||
); | ||
const danger = useColor("danger"); | ||
return <WideButton text="clear all" color={danger} onPress={clear} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.