Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Molaryy committed Dec 17, 2023
1 parent a3cba65 commit 068f64d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
12 changes: 7 additions & 5 deletions frontend/src/components/BreakTime.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import { useEffect, useState } from 'react'
const requestNotificationPermission = () => {
Expand All @@ -18,13 +19,14 @@ const sendNotification = () => {
setCanSendNotification(false)
}
}
*/

const BreakTime = () => {
useEffect(() => {
/* useEffect(() => {
requestNotificationPermission()
}, [])
sendNotification()
return <></>
}
sendNotification() */
return <></>;
};

export default BreakTime
export default BreakTime;
14 changes: 13 additions & 1 deletion frontend/src/components/Form/TimerFormHandler.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { FormEvent, useEffect, useState } from 'react';
import TimerForm from './TimerForm.tsx';
import pauseSound from '/assets/5-minutes-lofi.mp3';
import workSound from '/assets/Wakey-Wakey.mp3';
import BreakTime from '../BreakTime.tsx';

const TimerFormHandler = () => {
const [workTime, setWorkTime] = useState<string[]>(['00', '25', '00']);
Expand Down Expand Up @@ -115,7 +118,16 @@ const TimerFormHandler = () => {
isWorking={isWorkTimerRunning}
isInPause={isPauseTimerRunning}
/>
{startPauseSound ? <></> : <></>}
{startPauseSound ? (
<>
<BreakTime />
<audio controls src={pauseSound} autoPlay hidden />
</>
) : startWorkSound[0] && startWorkSound[1] ? (
<audio controls src={workSound} autoPlay hidden />
) : (
<></>
)}
</>
);
};
Expand Down

0 comments on commit 068f64d

Please sign in to comment.