-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create subscription confirmed modal
- Loading branch information
1 parent
446c63b
commit efabebd
Showing
3 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
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
79 changes: 79 additions & 0 deletions
79
src/components/modals/ModalRegistrationConfirmed/index.tsx
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,79 @@ | ||
import { useRef } from 'react'; | ||
import { RiMoneyDollarCircleLine, RiWhatsappLine } from 'react-icons/ri'; | ||
|
||
import { | ||
Box, | ||
Button, | ||
Icon, | ||
Image, | ||
Modal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalOverlay, | ||
Stack, | ||
Tooltip, | ||
useDisclosure, | ||
} from '@chakra-ui/react'; | ||
|
||
import subscriptionConfirmedImage from '../../../../public/assets/subscription-confirmed-image.webp'; | ||
|
||
interface Props { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
onOpen: () => void; | ||
type: 'SERVO' | 'PARTICIPANTE'; | ||
} | ||
|
||
export function ModalRegistrationConfirmed({ | ||
isOpen, | ||
onClose, | ||
onOpen, | ||
type, | ||
}: Props) { | ||
// const { isOpen, onOpen, onClose } = useDisclosure(); | ||
const finalRef = useRef(null); | ||
|
||
return ( | ||
<> | ||
<Modal finalFocusRef={finalRef} isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>Inscrição Confirmada!!!🎉</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<Box> | ||
<Image | ||
src={subscriptionConfirmedImage.src} | ||
alt="Imagem de inscrição confirmada" | ||
w="100%" | ||
/> | ||
</Box> | ||
</ModalBody> | ||
|
||
<ModalFooter> | ||
<Stack direction="row" width="100%" justify="space-between"> | ||
<Button onClick={onClose}>Fechar</Button> | ||
<Button | ||
onClick={handleOpenLink} | ||
colorScheme="green" | ||
leftIcon={<RiWhatsappLine />} | ||
> | ||
Entrar no Grupo | ||
</Button> | ||
</Stack> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
</> | ||
); | ||
|
||
function handleOpenLink() { | ||
const servantUrl = 'https://chat.whatsapp.com/JxOldQVBSnlH9xsnceoa16'; | ||
const participantUrl = 'https://chat.whatsapp.com/E86yx3zd5Ue8X7EdBvWfsD'; | ||
const finalUrl = type === 'PARTICIPANTE' ? participantUrl : servantUrl; | ||
window.open(finalUrl, '_blank'); | ||
} | ||
} |