diff --git a/src/components/InfoBlock.tsx b/src/components/InfoBlock.tsx
index 38f07e168..8a7d505cf 100644
--- a/src/components/InfoBlock.tsx
+++ b/src/components/InfoBlock.tsx
@@ -17,6 +17,7 @@ export interface InfoBlockProps {
text: string;
action: () => void;
};
+ showButton?: boolean;
}
export const InfoBlock = ({
@@ -27,6 +28,7 @@ export const InfoBlock = ({
backgroundColor,
title,
titleBolded,
+ showButton,
}: InfoBlockProps) => {
return (
@@ -58,9 +60,15 @@ export const InfoBlock = ({
{text}
-
-
-
+ {showButton ? (
+
+
+
+ ) : null}
);
};
+
+InfoBlock.defaultProps = {
+ showButton: true,
+};
diff --git a/src/screens/home/views/BluetoothDisabledView.tsx b/src/screens/home/views/BluetoothDisabledView.tsx
index dc51588f9..8ccdeba91 100644
--- a/src/screens/home/views/BluetoothDisabledView.tsx
+++ b/src/screens/home/views/BluetoothDisabledView.tsx
@@ -11,10 +11,10 @@ export const BluetoothDisabledView = () => {
-
+
{i18n.translate('Home.BluetoothDisabled')}
-
+
{i18n.translate('Home.EnableBluetoothCTA')}
diff --git a/src/screens/home/views/OverlayView.tsx b/src/screens/home/views/OverlayView.tsx
index 6b390c9bf..911b97361 100644
--- a/src/screens/home/views/OverlayView.tsx
+++ b/src/screens/home/views/OverlayView.tsx
@@ -2,17 +2,16 @@ import React, {useCallback} from 'react';
import {useNavigation} from '@react-navigation/native';
import {Box, InfoBlock, BoxProps} from 'components';
import {useI18n, I18n} from '@shopify/react-i18n';
-import {SystemStatus, useStartExposureNotificationService} from 'services/ExposureNotificationService';
+import {SystemStatus} from 'services/ExposureNotificationService';
+import {Linking} from 'react-native';
import {InfoShareView} from './InfoShareView';
import {StatusHeaderView} from './StatusHeaderView';
const SystemStatusOff = ({i18n}: {i18n: I18n}) => {
- const startExposureNotificationService = useStartExposureNotificationService();
-
- const enableExposureNotifications = useCallback(() => {
- startExposureNotificationService();
- }, [startExposureNotificationService]);
+ const toSettings = useCallback(() => {
+ Linking.openSettings();
+ }, []);
return (
{
title={i18n.translate('OverlayOpen.ExposureNotificationCardStatus')}
titleBolded={i18n.translate('OverlayOpen.ExposureNotificationCardStatusOff')}
text={i18n.translate('OverlayOpen.ExposureNotificationCardBody')}
- button={{text: i18n.translate('OverlayOpen.ExposureNotificationCardAction'), action: enableExposureNotifications}}
+ button={{text: i18n.translate('OverlayOpen.ExposureNotificationCardAction'), action: toSettings}}
backgroundColor="errorBackground"
color="errorText"
/>
);
};
-/*
const BluetoothStatusOff = ({i18n}: {i18n: I18n}) => {
const toSettings = useCallback(() => {
Linking.openSettings();
@@ -41,10 +39,10 @@ const BluetoothStatusOff = ({i18n}: {i18n: I18n}) => {
button={{text: i18n.translate('OverlayOpen.BluetoothCardAction'), action: toSettings}}
backgroundColor="errorBackground"
color="errorText"
+ showButton={false}
/>
);
};
-*/
const NotificationStatusOff = ({action, i18n}: {action: () => void; i18n: I18n}) => {
return (
@@ -75,16 +73,16 @@ export const OverlayView = ({status, notificationWarning, turnNotificationsOn, m
- {status !== SystemStatus.Active && (
+ {(status === SystemStatus.Disabled || status === SystemStatus.Restricted) && (
)}
- {/* {status !== SystemStatus.Active && (
+ {status === SystemStatus.BluetoothOff && (
- )}*/}
+ )}
{notificationWarning && (