-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: UI Facelift Notifications Popover (#658)
## What was done? - Updated all (or almost all) notifications-related components with our own, removing native-base from those. <img width="1440" alt="Bildschirmfoto 2024-09-15 um 16 57 47" src="https://github.com/user-attachments/assets/ab82c187-907b-40f7-a230-e9df41f04232">
- Loading branch information
Showing
10 changed files
with
200 additions
and
272 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,52 +1,35 @@ | ||
import { Box, CloseIcon, Heading, Modal, Pressable, useTheme, Row, Button, Text } from 'native-base'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { getIconForNotificationPreferenceModal } from '../../helper/notification-helper'; | ||
import { Button } from '../Button'; | ||
import { BaseModalProps, Modal, ModalFooter, ModalHeader, ModalTitle } from '../Modal'; | ||
import { Typography } from '../Typography'; | ||
|
||
type Props = { | ||
interface NotificationModalProps extends BaseModalProps { | ||
messageType: string; | ||
headline?: string; | ||
modalText: string; | ||
onClose: () => any; | ||
}; | ||
const AppointmentCancelledModal: React.FC<Props> = ({ messageType, onClose, headline, modalText }) => { | ||
} | ||
const NotificationModal = ({ isOpen, onOpenChange, messageType, headline, modalText }: NotificationModalProps) => { | ||
const { t } = useTranslation(); | ||
const { space } = useTheme(); | ||
|
||
const Icon = getIconForNotificationPreferenceModal(messageType); | ||
|
||
return ( | ||
<> | ||
<Modal.Content width="350" marginX="auto" backgroundColor="transparent"> | ||
<Box position="absolute" zIndex="1" right="20px" top="14px"> | ||
<Pressable onPress={onClose}> | ||
<CloseIcon color="white" /> | ||
</Pressable> | ||
</Box> | ||
<Modal.Body background="primary.900" padding={space['1']}> | ||
<Box alignItems="center" marginY={space['1']}> | ||
<Icon /> | ||
</Box> | ||
<Box paddingY={space['2']} maxW={'100%'}> | ||
{headline && ( | ||
<Heading maxWidth="330px" marginX="auto" fontSize="lg" textAlign={'center'} color="lightText" marginBottom={space['0.5']}> | ||
{headline} | ||
</Heading> | ||
)} | ||
<Text my={2} textAlign={'center'} fontSize="sm" color="lightText"> | ||
{modalText} | ||
</Text> | ||
</Box> | ||
<Box> | ||
<Row marginBottom={space['0.5']}> | ||
<Button variant={'outlinelight'} onPress={onClose} width="100%"> | ||
{t('notification.controlPanel.closeButton')} | ||
</Button> | ||
</Row> | ||
</Box> | ||
</Modal.Body> | ||
</Modal.Content> | ||
</> | ||
<Modal isOpen={isOpen} onOpenChange={onOpenChange}> | ||
<ModalHeader> | ||
<ModalTitle>{headline}</ModalTitle> | ||
</ModalHeader> | ||
<div className="flex flex-col items-center"> | ||
<Icon className="scale-[0.5]" /> | ||
<Typography>{modalText}</Typography> | ||
</div> | ||
<ModalFooter> | ||
<Button className="w-full lg:w-fit" variant="outline" onClick={() => onOpenChange(false)}> | ||
{t('notification.controlPanel.closeButton')} | ||
</Button> | ||
</ModalFooter> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default AppointmentCancelledModal; | ||
export default NotificationModal; |
Oops, something went wrong.