feat(LOY-61): add confirmation box to close when redeemed a reward

This commit is contained in:
Christian Andolf
2025-02-12 14:22:13 +01:00
parent 962836606e
commit b656023bac
15 changed files with 189 additions and 39 deletions

View File

@@ -12,6 +12,7 @@ import type { CountdownProps } from "@/types/components/countdown"
export default function Countdown({
minutes = 30,
seconds = 0,
onChange = () => undefined,
}: CountdownProps) {
const [time, setTime] = useState(dt.duration({ minutes, seconds }))
const timeSeconds = time.asSeconds()
@@ -20,6 +21,7 @@ export default function Countdown({
() => {
setTime((currentTime) => {
const newTime = currentTime.asMilliseconds() - 1000
onChange(newTime)
return dt.duration(newTime)
})
},