Skip to content

Commit

Permalink
feat: changement de la navigation pour la sections plus (#205)
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Drouin <jean-christophe.drouin@mcn.gouv.qc.ca>
  • Loading branch information
jcdrouin21 authored Jan 15, 2025
1 parent 511b34a commit 4b6a91f
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 297 deletions.
2 changes: 1 addition & 1 deletion app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ SPEC CHECKSUMS:
anoncreds: 045f191123bb20d7dcdc2f7c19df57ae30c427f6
aries-askar: 3a78d5cfc8faedbfc55a9ff35e2309fc4574a147
BEMCheckBox: 5ba6e37ade3d3657b36caecc35c8b75c6c2b1a4e
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CatCrypto: a477899b6be4954e75be4897e732da098cc0a5a8
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand Down
31 changes: 11 additions & 20 deletions app/src/components/ContactUs.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,36 @@
import { useTheme } from '@hyperledger/aries-bifold-core'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'

import CalendarImg from '../assets/img/calendar-empty.svg'
import ClockImg from '../assets/img/clock.svg'
import PhoneImg from '../assets/img/telephone.svg'

const ContactUs: React.FC = () => {
const { ColorPallet, TextTheme } = useTheme()
const { TextTheme } = useTheme()
const { t } = useTranslation()

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: ColorPallet.brand.primaryBackground,
},

textHeaderTitle: {
...TextTheme.headingThree,
flexShrink: 1,
color: TextTheme.headingThree.color,
paddingTop: 8,
paddingBottom: 8,
paddingVertical: 8,
},
textSectionTitle: {
...TextTheme.title,
flexShrink: 1,
color: TextTheme.bold.color,
paddingTop: 8,
paddingBottom: 8,
},
section: {
paddingVertical: 12,
},
sectionRow: {
paddingVertical: 8,
flexDirection: 'row',
alignContent: 'center',
alignItems: 'center',
},
sectionDoubleRow: {
paddingTop: 10,
flexDirection: 'row',
alignItems: 'flex-start',
height: 100,
Expand All @@ -53,32 +44,32 @@ const ContactUs: React.FC = () => {
color: TextTheme.normal.color,
textAlign: 'left',
textDecorationLine: 'none',
marginLeft: 10,
paddingLeft: 10,
},
})

return (
<SafeAreaView style={styles.container} edges={['left', 'right']}>
<View>
<View style={styles.section}>
<Text style={styles.textSectionTitle}> {t('OptionsPlus.JoinUsTitle')}</Text>
<Text style={styles.textSectionTitle}>{t('OptionsPlus.JoinUsTitle')}</Text>
</View>
<View style={styles.sectionRow}>
<CalendarImg />
<Text style={styles.sectionDescription}> {t('OptionsPlus.DaysOpen')}</Text>
<Text style={styles.sectionDescription}>{t('OptionsPlus.DaysOpen')}</Text>
</View>
<View style={styles.sectionRow}>
<ClockImg />
<Text style={styles.sectionDescription}> {t('OptionsPlus.OpeningHours')}</Text>
<Text style={styles.sectionDescription}>{t('OptionsPlus.OpeningHours')}</Text>
</View>
<View style={styles.sectionDoubleRow}>
<View style={[styles.sectionRow, styles.sectionDoubleRow]}>
<PhoneImg style={styles.phoneImage} />
<Text style={styles.sectionDescription}>
{t('OptionsPlus.PhoneNumber')}
{'\n'}
{t('OptionsPlus.TollFreeNumber')}
</Text>
</View>
</SafeAreaView>
</View>
)
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/components/Help/HelpListSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const HelpListSlider: React.FC = () => {
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'flex-start',
marginVertical: 12,
paddingVertical: 12,
flexWrap: 'wrap',
},
drawerRowItem: {
Expand Down Expand Up @@ -160,7 +160,7 @@ const HelpListSlider: React.FC = () => {
accessibilityRole="button"
onPress={() => {
deactivateSlider()
navigation.navigate(Stacks.HelpCenterStack as never, { screen: Screens.HelpCenter } as never)
navigation.navigate(Stacks.HelpCenterStack, { screen: Screens.HelpCenter })
}}
>
<View>
Expand Down
2 changes: 1 addition & 1 deletion app/src/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const translation = {
OpeningHours: 'From 8 a.m. to 6 p.m.',
PhoneNumber: '1 877 644-4545',
TollFreeNumber: '1 800 361-9596 (ATS number for the hearing impaired)',
Copyright: '@ Government of Quebec',
Copyright: '© Government of Quebec',
},
Screens: {
Splash: 'Splash',
Expand Down
2 changes: 1 addition & 1 deletion app/src/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const translation = {
OpeningHours: 'De 8h à 18h',
PhoneNumber: '1 877 644-4545',
TollFreeNumber: '1 800 361-9596 (numéro ATS pour malentendants)',
Copyright: '@ Gouvernement du Québec',
Copyright: '© Gouvernement du Québec',
},
StatusMessages: {
InitAgent: "Initialisation de l'agent ...",
Expand Down
34 changes: 1 addition & 33 deletions app/src/navigators/PlusStack.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { useTheme } from '@hyperledger/aries-bifold-core'
import { useDefaultStackOptions } from '@hyperledger/aries-bifold-core/App/navigators/defaultStackOptions'
import ListContacts from '@hyperledger/aries-bifold-core/App/screens/ListContacts'
import { createStackNavigator } from '@react-navigation/stack'
import React from 'react'
import { useTranslation } from 'react-i18next'

import Plus from '../screens/Plus'

import AboutStack from './AboutStack'
import HelpCenterStack from './HelpCenterStack'
import SettingStack from './SettingStack'
import { Screens, OptionsPlusStackParams, Stacks } from './navigators'
import { Screens, OptionsPlusStackParams } from './navigators'

const PlusStack: React.FC = () => {
const StackPlus = createStackNavigator<OptionsPlusStackParams>()
Expand All @@ -27,34 +23,6 @@ const PlusStack: React.FC = () => {
title: t('Screens.OptionsPlus'),
}}
/>
<StackPlus.Screen
name={Screens.Contacts}
component={ListContacts}
options={{
title: t('Screens.Contacts'),
}}
/>
<StackPlus.Screen
name={Stacks.SettingsStack}
component={SettingStack}
options={{
headerShown: false,
}}
/>
<StackPlus.Screen
name={Stacks.HelpCenterStack}
component={HelpCenterStack}
options={{
headerShown: false,
}}
/>
<StackPlus.Screen
name={Stacks.AboutStack}
component={AboutStack}
options={{
headerShown: false,
}}
/>
</StackPlus.Navigator>
)
}
Expand Down
13 changes: 4 additions & 9 deletions app/src/navigators/RootStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { DeviceEventEmitter } from 'react-native'

import SettingStack from '../navigators/SettingStack'

import AboutStack from './AboutStack'
import HelpCenterStack from './HelpCenterStack'
import SettingStack from './SettingStack'
import TabStack from './TabStack'
import { RootStackParams, Stacks } from './navigators'

Expand Down Expand Up @@ -106,13 +106,6 @@ const RootStack: React.FC = () => {
})}
/>
<Stack.Screen name={Bifoldstacks.ConnectStack} component={ConnectStack} />
<Stack.Screen
name={Bifoldstacks.SettingStack}
component={SettingStack}
options={{
cardStyleInterpolator: forFade,
}}
/>
<Stack.Screen name={Bifoldstacks.ContactStack} component={ContactStack} />
<Stack.Screen name={Bifoldstacks.NotificationStack} component={NotificationStack} />
<Stack.Screen
Expand All @@ -132,7 +125,9 @@ const RootStack: React.FC = () => {
cardStyleInterpolator: forFade,
}}
/>
<Stack.Screen name={Stacks.SettingsStack} component={SettingStack} />
<Stack.Screen name={Stacks.HelpCenterStack} component={HelpCenterStack} />
<Stack.Screen name={Stacks.AboutStack} component={AboutStack} />
</Stack.Navigator>
)
}
Expand Down
15 changes: 0 additions & 15 deletions app/src/navigators/SettingStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import React from 'react'
import { useTranslation } from 'react-i18next'

import HelpCenterButton from '../components/Help/HelpCenterButton'
import HistoryPage from '../screens/HistoryPage'
import Settings from '../screens/Settings'

import { Screens, SettingStackParams } from './navigators'
Expand Down Expand Up @@ -36,20 +35,6 @@ const SettingsStack: React.FC = () => {
...ScreenOptionsDictionary[Screens.Language],
}}
/>
<StackSettings.Screen
name={Screens.HistoryPage}
component={HistoryPage}
options={{
title: t('Settings.History'),
}}
/>
<StackSettings.Screen
name={Screens.Notification}
component={HistoryPage}
options={{
title: t('Settings.History'),
}}
/>
<StackSettings.Screen
name={Screens.CreatePIN}
component={PINCreate}
Expand Down
10 changes: 2 additions & 8 deletions app/src/navigators/navigators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ export type RootStackParams = {
[BifoldStacks.TabStack]: NavigatorScreenParams<TabStackParams>
[BifoldScreens.Chat]: { connectionId: string }
[BifoldStacks.ConnectionStack]: NavigatorScreenParams<DeliveryStackParams>
[BifoldStacks.SettingStack]: NavigatorScreenParams<SettingStackParams>
[BifoldStacks.ConnectStack]: NavigatorScreenParams<ConnectStackParams>
[BifoldStacks.ContactStack]: NavigatorScreenParams<ContactStackParams>
[BifoldStacks.ProofRequestsStack]: NavigatorScreenParams<ProofRequestsStackParams>
[BifoldStacks.NotificationStack]: NavigatorScreenParams<NotificationStackParams>
[BifoldStacks.HistoryStack]: NavigatorScreenParams<HistoryStackParams>
[Stacks.SettingsStack]: NavigatorScreenParams<SettingStackParams>
[Stacks.HelpCenterStack]: NavigatorScreenParams<HelpCenterStackParams>
[Stacks.AboutStack]: NavigatorScreenParams<AboutStackParams>
}

export type TabStackParams = {
Expand All @@ -75,8 +76,6 @@ export type TermsStackParams = {
export type SettingStackParams = {
[Screens.Settings]: undefined
[Screens.Language]: undefined
[Screens.HistoryPage]: undefined
[Screens.Notification]: undefined
[Screens.CreatePIN]: { updatePIN?: boolean }
[Screens.UseBiometry]: undefined
}
Expand Down Expand Up @@ -104,11 +103,6 @@ export type AboutStackParams = {
export type ActivitiesStackParams = {
[Screens.Activities]: undefined
}

export type OptionsPlusStackParams = {
[Screens.OptionsPlus]: undefined
[Screens.Contacts]: undefined
[Stacks.SettingsStack]: NavigatorScreenParams<SettingStackParams>
[Stacks.HelpCenterStack]: NavigatorScreenParams<HelpCenterStackParams>
[Stacks.AboutStack]: NavigatorScreenParams<AboutStackParams>
}
94 changes: 0 additions & 94 deletions app/src/screens/HistoryPage.tsx

This file was deleted.

Loading

0 comments on commit 4b6a91f

Please sign in to comment.