Skip to content

Commit

Permalink
Ajout du boutton retour à l'accueil
Browse files Browse the repository at this point in the history
Signed-off-by: Claude Arseneault <[email protected]>
  • Loading branch information
ClaudeArs committed Sep 24, 2024
1 parent 643558a commit 6383f32
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
1 change: 1 addition & 0 deletions app/src/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const translation = {
ANIGAcceptDescription:
'From the account management, you will need to scan the QR code that will be presented to you.\r\n\r\nYou will then need to accept the certificate offer that will be proposed to you.',
ButtonTitle: 'Receive my attestation',
ButtonHome: 'Return to home page',
},
Screens: {
Splash: 'Splash',
Expand Down
1 change: 1 addition & 0 deletions app/src/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ const translation = {
ANIGAcceptDescription:
'Depuis la gestion de compte, vous devrez balayer le code QR qui vous sera présenté.\r\n\r\nVous devrez ensuite accepter l’offre d’attestation qui vous sera proposée.',
ButtonTitle: 'Recevoir mon attestation',
ButtonHome: 'Revenir à l’accueil',
},
StatusMessages: {
InitAgent: "Initialisation de l'agent ...",
Expand Down
49 changes: 28 additions & 21 deletions app/src/screens/DefaultNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {
testIdWithKey,
Screens,
NotificationStackParams,
TabStacks,
} from '@hyperledger/aries-bifold-core'
import { StackScreenProps } from '@react-navigation/stack'
import { HomeStackParams } from '@hyperledger/aries-bifold-core/App/types/navigators'
import { useNavigation } from '@react-navigation/native'
import { StackScreenProps, StackNavigationProp } from '@react-navigation/stack'
import { useTranslation } from 'react-i18next'
import { ScrollView, StyleSheet, Text, View } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
Expand All @@ -18,15 +21,14 @@ type DefaultProps = StackScreenProps<NotificationStackParams, Screens.CustomNoti
const DefaultNotification: React.FC<DefaultProps> = () => {
const { ColorPallet, TextTheme } = useTheme()
const { t } = useTranslation()
const { navigate } = useNavigation<StackNavigationProp<HomeStackParams>>()

const styles = StyleSheet.create({
container: {
height: '100%',
height: '77%',
padding: 20,
backgroundColor: ColorPallet.brand.primaryBackground,
},
pageContainer: {
marginBottom: 20,
backgroundColor: ColorPallet.brand.primaryBackground,
},
textHeaderTitle: {
...TextTheme.headingThree,
Expand All @@ -39,13 +41,12 @@ const DefaultNotification: React.FC<DefaultProps> = () => {
color: TextTheme.bold.color,
},
button: {
margin: 15,
marginTop: 24,
marginBottom: 20,
margin: 20,
marginTop: 10,
marginBottom: 10,
},
section: {
paddingVertical: 12,
paddingHorizontal: 10,
},
sectionDescription: {
...TextTheme.normal,
Expand All @@ -64,14 +65,11 @@ const DefaultNotification: React.FC<DefaultProps> = () => {
})

return (
<SafeAreaView edges={['left', 'right', 'bottom']} style={styles.pageContainer}>
<SafeAreaView edges={['left', 'right', 'bottom']}>
<ScrollView style={styles.container}>
<View style={styles.section}>
<HeaderText title={t('DefaultNotificationPage.Title')} />
<Text style={styles.sectionDescriptionTitle}> {t('DefaultNotificationPage.Description')}</Text>
<Text style={styles.sectionDescriptionTitle}> {t('DefaultNotificationPage.Description')}</Text>
<Text style={styles.sectionDescriptionTitle}> {t('DefaultNotificationPage.Description')}</Text>
<Text style={styles.sectionDescriptionTitle}> {t('DefaultNotificationPage.Description')}</Text>
</View>
<View style={styles.section}>
<Text style={styles.textSectionTitle}>{t('DefaultNotificationPage.SAGConnexion')}</Text>
Expand All @@ -81,15 +79,24 @@ const DefaultNotification: React.FC<DefaultProps> = () => {
<Text style={styles.textSectionTitle}>{t('DefaultNotificationPage.ANIGRequest')}</Text>
<Text style={styles.sectionDescription}> {t('DefaultNotificationPage.ANIGAcceptDescription')}</Text>
</View>
<View style={styles.button}>
<Button
buttonType={ButtonType.Primary}
testID={testIdWithKey('StartProcess')}
accessibilityLabel={t('DefaultNotificationPage.ButtonTitle')}
title={t('DefaultNotificationPage.ButtonTitle')}
></Button>
</View>
</ScrollView>
<View style={styles.button}>
<Button
buttonType={ButtonType.Primary}
testID={testIdWithKey('StartProcess')}
accessibilityLabel={t('DefaultNotificationPage.ButtonTitle')}
title={t('DefaultNotificationPage.ButtonTitle')}
></Button>
</View>
<View style={styles.button}>
<Button
buttonType={ButtonType.Secondary}
testID={testIdWithKey('StartProcess')}
accessibilityLabel={t('DefaultNotificationPage.ButtonHome')}
title={t('DefaultNotificationPage.ButtonHome')}
onPress={() => navigate(TabStacks.HomeStack as never, { screen: Screens.Home } as never)}
></Button>
</View>
</SafeAreaView>
)
}
Expand Down

0 comments on commit 6383f32

Please sign in to comment.