From 9d458fb60e8b84210f492541bab2c5dc94adcc8b Mon Sep 17 00:00:00 2001
From: MAZE
Date: Mon, 29 Apr 2024 15:21:50 +0430
Subject: [PATCH] feat: add form to sleep timer
---
.../modals/sleep-timer/sleep-timer.tsx | 114 ++++++++++--------
1 file changed, 63 insertions(+), 51 deletions(-)
diff --git a/src/components/modals/sleep-timer/sleep-timer.tsx b/src/components/modals/sleep-timer/sleep-timer.tsx
index 99fe487..b17cf63 100644
--- a/src/components/modals/sleep-timer/sleep-timer.tsx
+++ b/src/components/modals/sleep-timer/sleep-timer.tsx
@@ -69,6 +69,12 @@ export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) {
setRunning(false);
};
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+
+ handleStart();
+ };
+
return (
@@ -78,62 +84,68 @@ export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) {
-
- {!running && (
-
-
-
- setHours(e.target.value === '' ? '' : e.target.value)
- }
- />
-
- )}
-
- {!running && (
-
-
-
- setMinutes(e.target.value === '' ? '' : e.target.value)
- }
- />
-
- )}
-
- {running ?
: null}
-
-
- {running && (
-
+
+
);
}