From e4e9c7b6e1a610e916ff18dfcb54d876d00eddb2 Mon Sep 17 00:00:00 2001 From: Nicholas Assaderaghi Date: Tue, 31 Aug 2021 11:32:55 -0700 Subject: [PATCH 1/2] Added haptics. --- package.json | 3 ++- src/pages/Components/Task.jsx | 2 ++ yarn.lock | 13 +++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f52d6f13..24103543 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@capacitor/browser": "^1.0.2", "@capacitor/core": "^3.1.2", "@capacitor/filesystem": "^1.0.2", + "@capacitor/haptics": "^1.0.2", "@capacitor/ios": "^3.0.2", "@capacitor/storage": "^1.0.2", "@ionic/core": "^5.6.10", @@ -58,7 +59,7 @@ "react-use-gesture": "^9.1.3", "rollup-plugin-typescript2": "^0.30.0", "tcp-port-used": "^1.0.2", - "typescript": "4.3.4" + "typescript": "^4.4.2" }, "scripts": { "electron:run": "cd electron && electron .", diff --git a/src/pages/Components/Task.jsx b/src/pages/Components/Task.jsx index 2e032d85..e55b20a0 100644 --- a/src/pages/Components/Task.jsx +++ b/src/pages/Components/Task.jsx @@ -1,6 +1,7 @@ // A whole lotta imports import { Browser } from '@capacitor/browser'; +import { Haptics, ImpactStyle } from '@capacitor/haptics'; // Ionic components import { IonItem, IonInput, IonContent, IonGrid, IonRow, IonCol, IonSegment, IonLabel, IonButton, IonPopover } from '@ionic/react'; @@ -540,6 +541,7 @@ class Task extends Component { else { this.setState({isComplete: true}, ()=>setTimeout(()=>this.state.taskObj.complete(), 800)); } + Haptics.impact({ style: ImpactStyle.Light }); } }} style={{opacity: this.state.availability?1:0.35}} diff --git a/yarn.lock b/yarn.lock index 89957284..361afd60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1273,6 +1273,11 @@ resolved "https://registry.yarnpkg.com/@capacitor/filesystem/-/filesystem-1.0.2.tgz#5327454addf354de0ad89e9a970443dc5563c646" integrity sha512-cDxNUubS/l1WLt94pviB657l/pA17jIZQ2wQBDyTvXPflOBL0sFC4QR9TT6nuOBX2oVWsgG3HogEdmgwXeGeHA== +"@capacitor/haptics@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@capacitor/haptics/-/haptics-1.0.2.tgz#fea5055e5eac254fbb27d4f650d041f068a5277b" + integrity sha512-ex629YmC439cqJcBX0HRTLtQ5lRc+Grx2/EPDLPEK33aTMcwplOsY8IQdjKL2pmO44AX4BmYtztui14Mf89q/g== + "@capacitor/ios@^3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@capacitor/ios/-/ios-3.0.2.tgz#49b3690ce38911ce4254a74860f6ca9dd0ed0303" @@ -13745,10 +13750,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" - integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== +typescript@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86" + integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ== ua-parser-js@^0.7.18: version "0.7.28" From cd2e1e9197dbb08907e593659341965a4493b36e Mon Sep 17 00:00:00 2001 From: Nicholas Assaderaghi Date: Tue, 31 Aug 2021 13:32:18 -0700 Subject: [PATCH 2/2] Changed haptics to notification. --- src/pages/Components/Task.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Components/Task.jsx b/src/pages/Components/Task.jsx index e55b20a0..8cd29543 100644 --- a/src/pages/Components/Task.jsx +++ b/src/pages/Components/Task.jsx @@ -1,7 +1,7 @@ // A whole lotta imports import { Browser } from '@capacitor/browser'; -import { Haptics, ImpactStyle } from '@capacitor/haptics'; +import { Haptics } from '@capacitor/haptics'; // Ionic components import { IonItem, IonInput, IonContent, IonGrid, IonRow, IonCol, IonSegment, IonLabel, IonButton, IonPopover } from '@ionic/react'; @@ -541,7 +541,7 @@ class Task extends Component { else { this.setState({isComplete: true}, ()=>setTimeout(()=>this.state.taskObj.complete(), 800)); } - Haptics.impact({ style: ImpactStyle.Light }); + Haptics.notification(); } }} style={{opacity: this.state.availability?1:0.35}}