Skip to content

Commit

Permalink
chore: updates to credential slider (#1555)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath authored Oct 23, 2023
1 parent 20012ee commit c6bcbe6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
26 changes: 20 additions & 6 deletions app/src/components/AddCredentialSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AnonCredsCredentialMetadataKey } from '@aries-framework/anoncreds/build
import { CredentialState } from '@aries-framework/core'
import { useCredentialByState } from '@aries-framework/react-hooks'
import { useNavigation } from '@react-navigation/native'
import { useTheme, Screens, Stacks, testIdWithKey } from 'aries-bifold'
import { useTheme, Screens, Stacks, testIdWithKey, testIdForAccessabilityLabel } from 'aries-bifold'
import React, { useEffect, useState, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { DeviceEventEmitter, Modal, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
Expand Down Expand Up @@ -65,6 +65,9 @@ const AddCredentialSlider: React.FC = () => {
drawerRowItem: {
color: ColorPallet.grayscale.black,
},
closeButton: {
alignSelf: 'flex-start',
},
})

const deactivateSlider = useCallback(() => {
Expand Down Expand Up @@ -113,19 +116,30 @@ const AddCredentialSlider: React.FC = () => {
accessibilityRole={'button'}
onPress={deactivateSlider}
hitSlop={hitSlop}
style={styles.closeButton}
>
<Icon name="window-close" size={35} style={styles.drawerRowItem}></Icon>
</TouchableOpacity>
<Text style={styles.drawerTitleText}>Choose</Text>
<Text style={styles.drawerTitleText}>{t('AddCredentialSlider.Choose')}</Text>
{showGetFoundationCredential && (
<TouchableOpacity style={styles.drawerRow} onPress={goToPersonCredentialScreen}>
<TouchableOpacity
style={styles.drawerRow}
onPress={goToPersonCredentialScreen}
testID={testIdWithKey(testIdForAccessabilityLabel(t('BCID.GetDigitalID')))}
accessibilityLabel={t('BCID.GetDigitalID')}
>
<Icon name="credit-card" size={30} style={styles.drawerRowItem}></Icon>
<Text style={{ ...styles.drawerRowItem, marginLeft: 5 }}>Get your Person credential</Text>
<Text style={{ ...styles.drawerRowItem, marginLeft: 5 }}>{t('BCID.GetDigitalID')}</Text>
</TouchableOpacity>
)}
<TouchableOpacity style={styles.drawerRow} onPress={goToScanScreen}>
<TouchableOpacity
style={styles.drawerRow}
onPress={goToScanScreen}
testID={testIdWithKey(testIdForAccessabilityLabel(t('AddCredentialSlider.ScanQRCode')))}
accessibilityLabel={t('AddCredentialSlider.ScanQRCode')}
>
<Icon name="qrcode" size={30} style={styles.drawerRowItem}></Icon>
<Text style={{ ...styles.drawerRowItem, marginLeft: 5 }}>Scan a QR code</Text>
<Text style={{ ...styles.drawerRowItem, marginLeft: 5 }}>{t('AddCredentialSlider.ScanQRCode')}</Text>
</TouchableOpacity>
</View>
</View>
Expand Down
4 changes: 4 additions & 0 deletions app/src/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ const translation = {
"Title": "Notifications",
"PushNotifications": "Push Notifications",
"Continue": "Continue",
},
"AddCredentialSlider": {
"Choose": "Choose",
"ScanQRCode": "Scan a QR code",
}
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ const translation = {
"Title": "Notifications (FR)",
"PushNotifications": "Push Notifications (FR)",
"Continue": "Continue (FR)",
},
"AddCredentialSlider": {
"Choose": "Choose (FR)",
"ScanQRCode": "Scan a QR code (FR)",
}
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/localization/pt-br/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ const translation = {
"Title": "Notifications (PT-BR)",
"PushNotifications": "Push Notifications (PT-BR)",
"Continue": "Continue (PT-BR)",
},
"AddCredentialSlider": {
"Choose": "Choose (PT-BR)",
"ScanQRCode": "Scan a QR code (PT-BR)",
}
}

Expand Down
2 changes: 1 addition & 1 deletion bifold

0 comments on commit c6bcbe6

Please sign in to comment.