feat(LOY-61): add confirmation box to close when redeemed a reward
This commit is contained in:
@@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user