-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: update config-specs version * feat: add ScooterHelpScreen using data from firestore * feat: update markdown-renderer to handle numbered lists * fix: only one expandable section is open at the time * fix: revert markdown renderer updates, should be separate PR * fix: revert markdown renderer * fix: rename index state and handle undefined operator
- Loading branch information
Showing
20 changed files
with
191 additions
and
17 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
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
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
2 changes: 1 addition & 1 deletion
2
src/mobility/components/MobilitySingleBenefitInfoSectionItem.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
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
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
82 changes: 82 additions & 0 deletions
82
src/stacks-hierarchy/Root_ParkingViolationsReporting/Root_ScooterHelpScreen.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,82 @@ | ||
import React, {useState} from 'react'; | ||
import {View} from 'react-native'; | ||
import {StyleSheet} from '@atb/theme'; | ||
import {ThemeText} from '@atb/components/text'; | ||
import {getTextForLanguage, useTranslation} from '@atb/translations'; | ||
import {RootNavigationProps, RootStackScreenProps} from '@atb/stacks-hierarchy'; | ||
import {ScooterHelpTexts} from '@atb/translations/screens/ScooterHelp'; | ||
import {ScreenContainer} from './components/ScreenContainer'; | ||
import { | ||
ExpandableSectionItem, | ||
LinkSectionItem, | ||
Section, | ||
} from '@atb/components/sections'; | ||
import {ContentHeading} from '@atb/components/heading'; | ||
import {useNavigation} from '@react-navigation/native'; | ||
import {useVehicle} from '@atb/mobility/use-vehicle'; | ||
import {useFirestoreConfigurationContext} from '@atb/configuration'; | ||
|
||
export type ScooterHelpScreenProps = | ||
RootStackScreenProps<'Root_ScooterHelpScreen'>; | ||
|
||
export const Root_ScooterHelpScreen = ({route}: ScooterHelpScreenProps) => { | ||
const {vehicleId} = route.params; | ||
const style = useStyles(); | ||
const {t, language} = useTranslation(); | ||
const navigation = useNavigation<RootNavigationProps>(); | ||
const {scooterFaqs} = useFirestoreConfigurationContext(); | ||
const [currentlyOpenFaqIndex, setCurrentlyOpenFaqIndex] = useState<number>(); | ||
|
||
const {operatorName, operatorId} = useVehicle(vehicleId); | ||
|
||
return ( | ||
<ScreenContainer | ||
leftHeaderButton={{type: 'close'}} | ||
title={t(ScooterHelpTexts.title)} | ||
> | ||
<View style={style.container}> | ||
<ContentHeading text={t(ScooterHelpTexts.contactAndReport)} /> | ||
<Section> | ||
{operatorId != undefined && ( | ||
<LinkSectionItem | ||
text={t(ScooterHelpTexts.contactOperator(operatorName))} | ||
/> | ||
)} | ||
<LinkSectionItem | ||
text={t(ScooterHelpTexts.reportParking)} | ||
onPress={() => | ||
navigation.navigate('Root_ParkingViolationsSelectScreen') | ||
} | ||
/> | ||
</Section> | ||
<ContentHeading text={t(ScooterHelpTexts.faq)} /> | ||
<Section> | ||
{scooterFaqs?.map((item, index) => ( | ||
<ExpandableSectionItem | ||
key={item.id} | ||
text={getTextForLanguage(item.title, language) ?? ''} | ||
textType="body__primary--bold" | ||
showIconText={false} | ||
expanded={currentlyOpenFaqIndex === index} | ||
onPress={() => { | ||
setCurrentlyOpenFaqIndex(index); | ||
}} | ||
expandContent={ | ||
<ThemeText isMarkdown={true}> | ||
{getTextForLanguage(item.description, language)} | ||
</ThemeText> | ||
} | ||
/> | ||
))} | ||
</Section> | ||
</View> | ||
</ScreenContainer> | ||
); | ||
}; | ||
|
||
const useStyles = StyleSheet.createThemeHook((theme) => ({ | ||
container: { | ||
rowGap: theme.spacing.small, | ||
margin: theme.spacing.medium, | ||
}, | ||
})); |
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
Oops, something went wrong.