From 3b96e8f01d1535fbb1e781c718407a3efa574c31 Mon Sep 17 00:00:00 2001 From: ChrisDryden Date: Sat, 20 Jun 2020 22:22:52 -0400 Subject: [PATCH] added ability to change bluetooth status and implemented bluetooth status check --- package.json | 1 + .../home/views/BluetoothDisabledView.tsx | 8 +-- src/screens/home/views/OverlayView.tsx | 54 ++++++++++++------- yarn.lock | 12 +++++ 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 26542d7d5..ca9e175eb 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "react": "16.11.0", "react-native": "0.62.2", "react-native-background-fetch": "^3.0.4", + "react-native-bluetooth-status": "^1.5.1", "react-native-config": "^1.1.0", "react-native-gesture-handler": "^1.6.1", "react-native-markdown-display": "^6.1.0", diff --git a/src/screens/home/views/BluetoothDisabledView.tsx b/src/screens/home/views/BluetoothDisabledView.tsx index 69f276dc9..acf1f70a2 100644 --- a/src/screens/home/views/BluetoothDisabledView.tsx +++ b/src/screens/home/views/BluetoothDisabledView.tsx @@ -1,5 +1,5 @@ import React, {useCallback} from 'react'; -import {Linking} from 'react-native'; +import {Linking, NativeModules} from 'react-native'; import {useI18n} from '@shopify/react-i18n'; import {Box, Text, Button, Icon, LastCheckedDisplay} from 'components'; @@ -7,9 +7,6 @@ import {BaseHomeView} from '../components/BaseHomeView'; export const BluetoothDisabledView = () => { const [i18n] = useI18n(); - const toSettings = useCallback(() => { - Linking.openSettings(); - }, []); return ( @@ -23,9 +20,6 @@ export const BluetoothDisabledView = () => { {i18n.translate('Home.EnableBluetoothCTA')} - -