feat(INJI-106): add missing labels related to permission error and refactored some variable names

Co-authored-by: Harsh Vardhan <harsh59v@gmail.com>
This commit is contained in:
Alka
2023-06-07 13:52:04 +05:30
committed by Harsh Vardhan
parent 4dd7449d5e
commit 7d4af6b596
6 changed files with 24 additions and 14 deletions

View File

@@ -286,12 +286,17 @@
},
"RequestScreen": {
"bluetoothDenied": "Please enable Bluetooth to be able to request Card",
"nearByPermissionDenied": "Please enable Nearby Permission to be able to request Card",
"bluetoothStateAndroid": "Please turn on bluetooth from quick settings to support local sharing",
"bluetoothStateIos": "Please turn on bluetooth from control center to support local sharing",
"showQrCode": "Display this QR code to request resident Card",
"incomingVc": "Incoming Card",
"request": "Request",
"errors": {
"nearbyDevicesPermissionDenied": {
"message": "Please enable Nearby Devices Permission to be able to request Card",
"button": "Allow access to Nearby"
}
},
"status": {
"accepted": {
"title": "Success!",
@@ -344,8 +349,8 @@
"message": "Location permission is required for the scanning functionality",
"button": "Allow access to location"
},
"nearbyPermissionDenied": {
"message": "Nearby permission is required for the scanning functionality",
"nearbyDevicesPermissionDenied": {
"message": "Nearby Devices permission is required for the scanning functionality",
"button": "Allow access to Nearby"
}
},

View File

@@ -41,6 +41,7 @@ import {
checkMultiple,
PermissionStatus,
PERMISSIONS,
request,
requestMultiple,
RESULTS,
} from 'react-native-permissions';

View File

@@ -1,6 +1,6 @@
{
"bluetoothDenied": "Please enable Bluetooth to be able to request {{vcLabel}}",
"nearByPermissionDenied": "Please enable Nearby Permission to be able to request card",
"nearbyDevicesPermissionDenied": "Please enable Nearby Devices Permission to be able to request card",
"showQrCode": "Display this QR code to request resident {{vcLabel}}",
"incomingVc": "Incoming {{vcLabel}}",
"request": "Request",

View File

@@ -17,6 +17,7 @@ export const RequestScreen: React.FC = () => {
<Column
fill
padding="24"
align="space-between"
backgroundColor={Theme.Colors.lightGreyBackgroundColor}>
{controller.isBluetoothDenied && <BluetoothPrompt {...props} />}
{controller.isNearByDevicesPermissionDenied && (
@@ -47,15 +48,14 @@ const BluetoothPrompt: React.FC<RequestScreenProps> = ({ t, controller }) => {
const NearByPrompt: React.FC<RequestScreenProps> = ({ t, controller }) => {
return (
<Column padding="24" fill align="space-between">
<Column fill align="space-between">
<Centered fill>
<Text color={Theme.Colors.errorMessage} align="center">
{t('nearByPermissionDenied')}
{t('errors.nearbyDevicesPermissionDenied.message')}
</Text>
</Centered>
<Button
margin={[32, 0, 0, 0]}
title={t('gotoSettings')}
title={t('errors.nearbyDevicesPermissionDenied.button')}
onPress={controller.GOTO_SETTINGS}
/>
</Column>

View File

@@ -73,12 +73,12 @@ export const ScanScreen: React.FC = () => {
<Column padding="24" fill align="space-between">
<Centered fill>
<Text align="center" color={Theme.Colors.errorMessage}>
{t('errors.nearbyPermissionDenied.message')}
{t('errors.nearbyDevicesPermissionDenied.message')}
</Text>
</Centered>
<Button
title={t('errors.nearbyPermissionDenied.button')}
title={t('errors.nearbyDevicesPermissionDenied.button')}
onPress={openSettings}></Button>
</Column>
);

View File

@@ -45,7 +45,7 @@ export function useScanScreen() {
);
const isBluetoothDenied = useSelector(scanService, selectIsBluetoothDenied);
const locationError = { message: '', button: '' };
const nearByPermissionError = { message: '', button: '' };
const nearByDevicesPermissionError = { message: '', button: '' };
if (isLocationDisabled) {
locationError.message = t('errors.locationDisabled.message');
@@ -55,13 +55,17 @@ export function useScanScreen() {
locationError.button = t('errors.locationDenied.button');
}
if (isNearByDevicesPermissionDenied) {
nearByPermissionError.message = t('errors.nearbyPermissionDenied.message');
nearByPermissionError.button = t('errors.nearbyPermissionDenied.button');
nearByDevicesPermissionError.message = t(
'errors.nearbyDevicesPermissionDenied.message'
);
nearByDevicesPermissionError.button = t(
'errors.nearbyDevicesPermissionDenied.button'
);
}
return {
locationError,
nearByPermissionError,
nearByDevicesPermissionError,
isEmpty: !shareableVcs.length,
isBluetoothPermissionDenied,
isNearByDevicesPermissionDenied,