From 8d4c075677a580406ff9deda55b7f201ff0f2f00 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Mon, 4 Jul 2022 16:17:29 +1200 Subject: [PATCH] Remove dependencies used by AlarmModule --- Exercises.tsx | 4 ++-- Home.tsx | 19 ++----------------- Settings.tsx | 9 +++++++-- channels.ts | 13 ------------- index.js | 19 ------------------- package.json | 6 ------ yarn.lock | 32 -------------------------------- 7 files changed, 11 insertions(+), 91 deletions(-) delete mode 100644 channels.ts diff --git a/Exercises.tsx b/Exercises.tsx index 395678a1..e8287fe1 100644 --- a/Exercises.tsx +++ b/Exercises.tsx @@ -1,7 +1,7 @@ import {NativeStackScreenProps} from '@react-navigation/native-stack'; import React, {useEffect, useState} from 'react'; import {FlatList, StyleSheet, View} from 'react-native'; -import {List, TextInput} from 'react-native-paper'; +import {List, Searchbar, TextInput} from 'react-native-paper'; import {RootStackParamList} from './App'; import {getDb} from './db'; import Exercise from './exercise'; @@ -43,7 +43,7 @@ export default function Exercises({ return ( - + { setRefreshing(true); @@ -41,21 +37,10 @@ export default function Home() { setOffset(0); }; - const alarm = new Sound('argon.mp3', Sound.MAIN_BUNDLE, error => { - if (error) throw new Error(error); - }); - - const focus = async () => { - alarm.stop(); - Vibration.cancel(); - }; - useEffect(() => { refresh(); }, [search]); - useEffect(() => navigation.addListener('focus', focus), [navigation]); - const renderItem = ({item}: {item: Set}) => ( { @@ -98,7 +83,7 @@ export default function Home() { return ( - + - Alarm enabled? + Alarm enabled? @@ -65,4 +67,7 @@ const styles = StyleSheet.create({ container: { padding: 10, }, + text: { + marginBottom: 10, + }, }); diff --git a/channels.ts b/channels.ts deleted file mode 100644 index 560fdd59..00000000 --- a/channels.ts +++ /dev/null @@ -1,13 +0,0 @@ -import PushNotification, {Importance} from 'react-native-push-notification'; - -export const ALARM = 'alarm'; -PushNotification.createChannel( - { - channelId: ALARM, - channelName: 'Alarms', - channelDescription: 'Notifications of when alarms are triggered.', - importance: Importance.HIGH, - vibrate: false, - }, - created => console.log(`Created channel ${created}`), -); diff --git a/index.js b/index.js index 73afab36..cb3fdfce 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,6 @@ import React from 'react'; import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; -import PushNotification from 'react-native-push-notification'; import {Provider as PaperProvider, DarkTheme} from 'react-native-paper'; import Ionicon from 'react-native-vector-icons/Ionicons'; @@ -19,21 +18,3 @@ export default function Main() { } AppRegistry.registerComponent(appName, () => Main); - -PushNotification.configure({ - onNotification: function (notification) { - console.log('NOTIFICATION:', notification); - }, - - onAction: function (notification) { - console.log('ACTION:', notification.action); - console.log('NOTIFICATION:', notification); - }, - - onRegistrationError: function (err) { - console.error(err.message, err); - }, - - popInitialNotification: true, - requestPermissions: false, -}); diff --git a/package.json b/package.json index 30acc9f4..e487e22b 100644 --- a/package.json +++ b/package.json @@ -12,27 +12,21 @@ "dependencies": { "@babel/preset-env": "^7.1.6", "@react-native-async-storage/async-storage": "^1.17.7", - "@react-native-community/push-notification-ios": "^1.10.1", "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/material-top-tabs": "^6.2.1", "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", - "@types/react-native-background-timer": "^2.0.0", - "@types/react-native-push-notification": "^8.1.1", "@types/react-native-sqlite-storage": "^5.0.2", "@types/react-native-vector-icons": "^6.4.11", "react": "18.0.0", "react-devtools": "^4.24.7", "react-native": "0.69.1", - "react-native-background-timer": "^2.4.1", "react-native-gesture-handler": "^2.5.0", "react-native-pager-view": "^5.4.24", "react-native-paper": "^4.12.2", - "react-native-push-notification": "^8.1.1", "react-native-reanimated": "^2.9.0", "react-native-safe-area-context": "^4.3.1", "react-native-screens": "^3.14.0", - "react-native-sound": "^0.11.2", "react-native-sqlite-storage": "^6.0.1", "react-native-tab-view": "^3.1.1", "react-native-vector-icons": "^9.2.0" diff --git a/yarn.lock b/yarn.lock index 3a66bf17..8a3e00a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1603,13 +1603,6 @@ resolved "https://registry.yarnpkg.com/@react-native-community/eslint-plugin/-/eslint-plugin-1.2.0.tgz#7d6d789ae8edf73dc9bed1246cd48277edea8066" integrity sha512-o6aam+0Ug1xGK3ABYmBm0B1YuEKfM/5kaoZO0eHbZwSpw9UzDX4G5y4Nx/K20FHqUmJHkZmLvOUFYwN4N+HqKA== -"@react-native-community/push-notification-ios@^1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@react-native-community/push-notification-ios/-/push-notification-ios-1.10.1.tgz#d52a6d69ac1112df0f79e1d17978077629b76784" - integrity sha512-k6bZWUKLif4GjenyTD3aQLwA2VT3bNmt22INO/34lexnpmqkPDZF7nreqbckTHG0Zso9wDTe4N/AZJUC/d8iRg== - dependencies: - invariant "^2.2.4" - "@react-native/assets@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" @@ -1843,16 +1836,6 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== -"@types/react-native-background-timer@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/react-native-background-timer/-/react-native-background-timer-2.0.0.tgz#c44c57f8fbca9d9d5521fdd72a8f55232b79381e" - integrity sha512-y5VW82dL/ESOLg+5QQHyBdsFVA4ZklENxmOyxv8o06T+3HBG2JOSuz/CIPz1vKdB7dmWDGPZNuPosdtnp+xv2A== - -"@types/react-native-push-notification@^8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/react-native-push-notification/-/react-native-push-notification-8.1.1.tgz#0c9a181d7823cfad215d040bc5596c2d83e1a3cd" - integrity sha512-ZN4UbU4EM3C7XGt4zI6RqHEZS2+35EwOz9DPAD1lTTY3IpWMHAKYjryykvP35hFkSwrGMpT8nYuMFPEJRwDEJA== - "@types/react-native-sqlite-storage@^5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@types/react-native-sqlite-storage/-/react-native-sqlite-storage-5.0.2.tgz#eefcc9ea6ff73043bb2945023fa8ee721683b61b" @@ -6648,11 +6631,6 @@ react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-native-background-timer@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/react-native-background-timer/-/react-native-background-timer-2.4.1.tgz#a3bc1cafa8c1e3aeefd0611de120298b67978a0f" - integrity sha512-TE4Kiy7jUyv+hugxDxitzu38sW1NqjCk4uE5IgU2WevLv7sZacaBc6PZKOShNRPGirLl1NWkaG3LDEkdb9Um5g== - react-native-codegen@^0.69.1: version "0.69.1" resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.69.1.tgz#3632be2f24464e6fad8dd11a25d1b6f3bc2c7d0b" @@ -6698,11 +6676,6 @@ react-native-paper@^4.12.2: color "^3.1.2" react-native-iphone-x-helper "^1.3.1" -react-native-push-notification@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/react-native-push-notification/-/react-native-push-notification-8.1.1.tgz#a41d20c70ea5a7709417e96261b225461f8dc73a" - integrity sha512-XpBtG/w+a6WXTxu6l1dNYyTiHnbgnvjoc3KxPTxYkaIABRmvuJZkFxqruyGvfCw7ELAlZEAJO+dthdTabCe1XA== - react-native-reanimated@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.9.0.tgz#b8236c4e58461a66bdb7202d98a00e9d0db6c706" @@ -6730,11 +6703,6 @@ react-native-screens@^3.14.0: react-freeze "^1.0.0" warn-once "^0.1.0" -react-native-sound@^0.11.2: - version "0.11.2" - resolved "https://registry.yarnpkg.com/react-native-sound/-/react-native-sound-0.11.2.tgz#e542dc5b9e16ab4b3ac7e6eaddb1fc8d98da9038" - integrity sha512-LmGc8lgOK3qecYMVQpyHvww/C+wgT6sWeMpVbOe4NCRGC2yKd4fo4U0KBUo9PO7AqKESO3I/2GZg1/C0+bwiiA== - react-native-sqlite-storage@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/react-native-sqlite-storage/-/react-native-sqlite-storage-6.0.1.tgz#ce6a6b852f07abbea68658d5363818c8bef45dfb"