-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schedules): weekend meeting autofill
- Loading branch information
Showing
4 changed files
with
252 additions
and
5 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
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,32 @@ | ||
import { useState } from 'react'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { sourcesFormattedState } from '@states/sources'; | ||
|
||
const useWeekend = () => { | ||
const sources = useRecoilValue(sourcesFormattedState); | ||
|
||
const [openAutofill, setOpenAutofill] = useState(false); | ||
const [openExport, setOpenExport] = useState(false); | ||
|
||
const hasWeeks = sources.length > 0; | ||
|
||
return { hasWeeks }; | ||
const handleOpenAutofill = () => setOpenAutofill(true); | ||
|
||
const handleCloseAutofill = () => setOpenAutofill(false); | ||
|
||
const handleOpenExport = () => setOpenExport(true); | ||
|
||
const handleCloseExport = () => setOpenExport(false); | ||
|
||
return { | ||
hasWeeks, | ||
handleCloseAutofill, | ||
handleOpenAutofill, | ||
openAutofill, | ||
openExport, | ||
handleOpenExport, | ||
handleCloseExport, | ||
}; | ||
}; | ||
|
||
export default useWeekend; |
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