-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #359 from bounswe/issue#332
ask user to rest
- Loading branch information
Showing
4 changed files
with
178 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalHeader, | ||
ModalFooter, | ||
ModalBody, | ||
ModalCloseButton, | ||
Button, | ||
Text, | ||
} from '@chakra-ui/react'; | ||
|
||
function RestModal({ | ||
onClose, | ||
isOpen, | ||
interval, // Number of days for the recommended rest period | ||
onContinueWorkout, // Callback to handle when the user wants to continue the workout | ||
}) { | ||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader> | ||
Recommended Rest Period | ||
</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<Text mb={4}> | ||
It is recommended to rest for <strong>{interval} day{interval > 1 ? 's' : ''}</strong> before continuing your workouts. This will help you recover and maximize your performance. | ||
</Text> | ||
<Text> | ||
If you'd like, you can choose to continue the workout without waiting. | ||
</Text> | ||
</ModalBody> | ||
|
||
<ModalFooter> | ||
<Button colorScheme="gray" mr={3} onClick={onClose}> | ||
Close | ||
</Button> | ||
<Button colorScheme="purple" onClick={() => { | ||
onContinueWorkout(); | ||
onClose(); | ||
}}> | ||
Continue Anyway | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default RestModal; |
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