-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notif): ouverture settings du tél (#1458)
* feat(notif): ouverture settings du tél * fix(notif): retours PR
- Loading branch information
Showing
4 changed files
with
114 additions
and
3 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
80 changes: 80 additions & 0 deletions
80
front/src/components/notification/notificationPermissionInSettingsModal.component.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,80 @@ | ||
import * as React from "react"; | ||
import { useCallback } from "react"; | ||
import { Linking, Modal, ScrollView, StyleSheet, View } from "react-native"; | ||
|
||
import { Labels } from "../../constants"; | ||
import { Margins, Paddings, Styles } from "../../styles"; | ||
import { | ||
CloseButton, | ||
CustomButton, | ||
SecondaryText, | ||
TitleH1, | ||
} from "../baseComponents"; | ||
|
||
interface Props { | ||
visible: boolean; | ||
closeModal: () => void; | ||
} | ||
|
||
const NotificationPermissionInSettingsModal: React.FC<Props> = ({ | ||
visible, | ||
closeModal, | ||
}) => { | ||
const openSettings = useCallback(() => { | ||
void Linking.openSettings(); | ||
}, []); | ||
|
||
return ( | ||
<Modal animationType="slide" transparent={true} visible={visible}> | ||
<View style={Styles.modale.behindOfModal}> | ||
<View style={Styles.modale.modalView}> | ||
<View style={Styles.modale.closeButton}> | ||
<CloseButton onPress={closeModal} clear /> | ||
</View> | ||
<ScrollView> | ||
<View style={styles.content}> | ||
<TitleH1 | ||
title={Labels.notification.title} | ||
animated={false} | ||
style={styles.titleStyle} | ||
/> | ||
<SecondaryText>{Labels.notification.openSettings}</SecondaryText> | ||
<View style={[styles.buttonsContainer, styles.validationButtons]}> | ||
<CustomButton | ||
title={Labels.buttons.cancel} | ||
rounded={false} | ||
action={closeModal} | ||
/> | ||
<CustomButton | ||
title={Labels.buttons.settings} | ||
rounded | ||
action={openSettings} | ||
/> | ||
</View> | ||
</View> | ||
</ScrollView> | ||
</View> | ||
</View> | ||
</Modal> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
buttonsContainer: { | ||
flexDirection: "row", | ||
justifyContent: "center", | ||
marginTop: Margins.default, | ||
}, | ||
content: { | ||
alignItems: "center", | ||
paddingHorizontal: Paddings.largest, | ||
}, | ||
titleStyle: { | ||
marginTop: Margins.default, | ||
}, | ||
validationButtons: { | ||
flexWrap: "wrap-reverse", | ||
}, | ||
}); | ||
|
||
export default NotificationPermissionInSettingsModal; |
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