From d760f989756de86919184985e50ea1956cd5b881 Mon Sep 17 00:00:00 2001 From: art1505 Date: Sun, 26 Nov 2023 13:00:56 -0300 Subject: [PATCH 01/14] =?UTF-8?q?(#199)=20Adiciona=20vers=C3=A3o=20inicial?= =?UTF-8?q?=20de=20componente=20ToggleButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/ToggleButton.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/app/components/ToggleButton.tsx diff --git a/src/app/components/ToggleButton.tsx b/src/app/components/ToggleButton.tsx new file mode 100644 index 00000000..8d475898 --- /dev/null +++ b/src/app/components/ToggleButton.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { TouchableOpacity, View, Text, StyleSheet } from 'react-native'; + +interface ToggleButtonProps { + onPress: () => void; + active: boolean; +} + +const ToggleButton: React.FC = ({ onPress, active }) => { + return ( + + + Ativar + + + ); +}; + +const styles = StyleSheet.create({ + toggleButton: { + padding: 10, + borderRadius: 5, + alignItems: 'center', + justifyContent: 'center', + marginVertical: 10, + }, +}); + +export default ToggleButton; From b7079d40e25835e1718403c64a42a2ee1a3d34a9 Mon Sep 17 00:00:00 2001 From: art1505 Date: Sun, 26 Nov 2023 14:32:08 -0300 Subject: [PATCH 02/14] =?UTF-8?q?(#199)=20Corrije=20ToggleButton=20de=20no?= =?UTF-8?q?tifica=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gabryelns --- .../components/ToggleButtonNotification.tsx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/app/components/ToggleButtonNotification.tsx diff --git a/src/app/components/ToggleButtonNotification.tsx b/src/app/components/ToggleButtonNotification.tsx new file mode 100644 index 00000000..b94e1748 --- /dev/null +++ b/src/app/components/ToggleButtonNotification.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { View, Text, StyleSheet, Switch } from 'react-native'; + +interface ToggleButtonProps { + onPress: () => void; + active: boolean; +} + +const ToggleButton: React.FC = ({ onPress, active }) => { + return ( + + + Ativar notificação + + ); +}; + +const styles = StyleSheet.create({ + toggleButtonContainer: { + flexDirection: 'row', + alignItems: 'flex-start', + marginTop: 10, + }, + + toggleButtonText: { + marginLeft: 10, + color: 'black', + fontSize: 17, + }, +}); + +export default ToggleButton; + + + From 37094d21d7c44cdf6b8f55aafdba86690119caee Mon Sep 17 00:00:00 2001 From: art1505 Date: Sun, 26 Nov 2023 14:38:26 -0300 Subject: [PATCH 03/14] =?UTF-8?q?(#199)=20Adiciona=20bot=C3=A3o=20de=20not?= =?UTF-8?q?ifica=C3=A7=C3=A3o=20=C3=A0=20editarRotina.tsx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gabryelns --- src/app/private/pages/editarRotina.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/private/pages/editarRotina.tsx b/src/app/private/pages/editarRotina.tsx index 3947b377..895b38ac 100644 --- a/src/app/private/pages/editarRotina.tsx +++ b/src/app/private/pages/editarRotina.tsx @@ -22,6 +22,7 @@ import Toast from "react-native-toast-message"; import AsyncStorage from "@react-native-async-storage/async-storage"; import ErrorMessage from "../../components/ErrorMessage"; import ModalConfirmation from "../../components/ModalConfirmation"; +import ToggleButton from "../../components/ToggleButtonNotification"; import { IIdoso } from "../../interfaces/idoso.interface"; interface IErrors { @@ -33,6 +34,7 @@ interface IErrors { } export default function EditarRotina() { + const [isToggleActive, setIsToggleActive] = useState(false); const params = useLocalSearchParams() as unknown as IRotina & { dias: string; }; @@ -277,6 +279,10 @@ export default function EditarRotina() { /> + + + setIsToggleActive(!isToggleActive)} active={isToggleActive} /> + @@ -457,4 +463,10 @@ const styles = StyleSheet.create({ marginBottom: 25, alignItems: "center", }, + toggleButtonContainer: { + flexDirection: 'row', + justifyContent: 'flex-start', + marginTop: 10, + marginLeft: 20, + }, }); From c2f9e2576f7971c617a7877f37f78f4da2e833dd Mon Sep 17 00:00:00 2001 From: art1505 Date: Sun, 26 Nov 2023 16:18:24 -0300 Subject: [PATCH 04/14] =?UTF-8?q?(#199)=20Adiciona=20bot=C3=A3o=20de=20not?= =?UTF-8?q?ifica=C3=A7=C3=A3o=20p/=20cadastrar=20rotina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/private/pages/cadastrarRotina.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/private/pages/cadastrarRotina.tsx b/src/app/private/pages/cadastrarRotina.tsx index 50bd1da9..59e0e9f1 100644 --- a/src/app/private/pages/cadastrarRotina.tsx +++ b/src/app/private/pages/cadastrarRotina.tsx @@ -20,6 +20,7 @@ import MaskHour from "../../components/MaskHour"; import { postRotina } from "../../services/rotina.service"; import Toast from "react-native-toast-message"; import AsyncStorage from "@react-native-async-storage/async-storage"; +import ToggleButton from "../../components/ToggleButtonNotification"; import { IIdoso } from "../../interfaces/idoso.interface"; import ErrorMessage from "../../components/ErrorMessage"; @@ -32,6 +33,7 @@ interface IErrors { } export default function CadastrarRotina() { + const [isToggleActive, setIsToggleActive] = useState(false); const getInitialDateTime = (isData = true) => { const today = new Date(); const formattedDate = today.toLocaleDateString("pt-BR", { @@ -262,6 +264,10 @@ export default function CadastrarRotina() { /> + + + setIsToggleActive(!isToggleActive)} active={isToggleActive} /> + @@ -416,4 +422,10 @@ const styles = StyleSheet.create({ marginBottom: 15, alignSelf: "flex-start", }, + toggleButtonContainer: { + flexDirection: 'row', + justifyContent: 'flex-start', + marginTop: 10, + marginLeft: 20, + }, }); From a7098d6d9c136977b2df8dbae3e881276180d021 Mon Sep 17 00:00:00 2001 From: art1505 Date: Mon, 27 Nov 2023 23:19:46 -0300 Subject: [PATCH 05/14] (#199) Altera componente do toggle para sanar bug --- src/app/components/ToggleButtonNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/ToggleButtonNotification.tsx b/src/app/components/ToggleButtonNotification.tsx index b94e1748..c39ac3d0 100644 --- a/src/app/components/ToggleButtonNotification.tsx +++ b/src/app/components/ToggleButtonNotification.tsx @@ -11,7 +11,7 @@ const ToggleButton: React.FC = ({ onPress, active }) => { Date: Mon, 27 Nov 2023 23:24:41 -0300 Subject: [PATCH 06/14] remove componente inutilizado --- src/app/components/ToggleButton.tsx | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/app/components/ToggleButton.tsx diff --git a/src/app/components/ToggleButton.tsx b/src/app/components/ToggleButton.tsx deleted file mode 100644 index 8d475898..00000000 --- a/src/app/components/ToggleButton.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { TouchableOpacity, View, Text, StyleSheet } from 'react-native'; - -interface ToggleButtonProps { - onPress: () => void; - active: boolean; -} - -const ToggleButton: React.FC = ({ onPress, active }) => { - return ( - - - Ativar - - - ); -}; - -const styles = StyleSheet.create({ - toggleButton: { - padding: 10, - borderRadius: 5, - alignItems: 'center', - justifyContent: 'center', - marginVertical: 10, - }, -}); - -export default ToggleButton; From b3274a112f29e21919f2394eca24dc7b3214a348 Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Tue, 5 Dec 2023 18:21:00 -0300 Subject: [PATCH 07/14] (#199) adiciona dependencias --- .gitignore | 4 + app.json | 2 +- package-lock.json | 532 ++++++++++++++++++++++++++++++++++++++++++---- package.json | 8 +- 4 files changed, 504 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index b278e7bf..9a80df8d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ yarn-error.* *.tsbuildinfo /coverage + +ios + +android diff --git a/app.json b/app.json index c18e3fdc..975c2b42 100644 --- a/app.json +++ b/app.json @@ -50,4 +50,4 @@ }, "owner": "gerocuidado" } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5ef738c2..169ba331 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,11 +18,14 @@ "expo": "^49.0.0", "expo-constants": "~14.4.2", "expo-dev-client": "~2.4.12", + "expo-device": "~5.4.0", "expo-image": "^1.5.1", "expo-image-picker": "~14.3.2", "expo-jwt": "^1.6.5", "expo-linking": "~5.0.2", + "expo-notifications": "~0.20.1", "expo-router": "^2.0.4", + "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", "expo-updates": "~0.18.17", "jest": "^29.2.1", @@ -30,6 +33,7 @@ "jest-mock-extended": "^3.0.5", "jest-sonar": "^0.2.16", "jest-sonar-reporter": "^2.0.0", + "native-notify": "^3.2.4", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.72.6", @@ -2284,9 +2288,9 @@ } }, "node_modules/@expo/cli": { - "version": "0.10.14", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.10.14.tgz", - "integrity": "sha512-IIZ9mYYHpNkK9XJAWLPtwTwZmasDq/NJsHLPjLtw5la4ANjWWwKYUcl3XKBECKovSDn9WHEQHGsBz6cyKS88Mg==", + "version": "0.10.16", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.10.16.tgz", + "integrity": "sha512-EwgnRN5AMElg0JJjFLJTPk5hYkVXxnNMLIvZBiTfGoCq+rDw6u7Mg5l2Bbm/geSHOoplaHyPZ/Wr23FAuZWehA==", "dependencies": { "@babel/runtime": "^7.20.0", "@expo/code-signing-certificates": "0.0.5", @@ -3183,9 +3187,9 @@ } }, "node_modules/@expo/metro-runtime": { - "version": "2.2.13", - "resolved": "https://registry.npmjs.org/@expo/metro-runtime/-/metro-runtime-2.2.13.tgz", - "integrity": "sha512-DRmaRS2M0XSaofcpkpXNUbnNyFjx2v6Em4alBvL4bDqRB52Aoe5TBxIITtDLoP+SzfzxcFoupXWzvf10FB70ww==", + "version": "2.2.16", + "resolved": "https://registry.npmjs.org/@expo/metro-runtime/-/metro-runtime-2.2.16.tgz", + "integrity": "sha512-WOUe7ByZsQpFRifyh9WgsjMYrCGHirWA8VvtR5fs+vi0za3yFIaC89wYMvEZILyvn+RIe7Ysln8nzF4xgtnKFg==", "dependencies": { "@bacons/react-views": "^1.1.3", "qs": "^6.10.3" @@ -3787,6 +3791,11 @@ "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, + "node_modules/@ide/backoff": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@ide/backoff/-/backoff-1.0.0.tgz", + "integrity": "sha512-F0YfUDjvT+Mtt/R4xdl2X0EYCHMMiJqNLdxHD++jDT5ydEFIyqbCHh51Qx2E211dgZprPKhV7sHmnXKpLuvc5g==" + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -8140,6 +8149,18 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, "node_modules/ast-types": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", @@ -8195,7 +8216,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -8562,6 +8582,11 @@ "@babel/core": "^7.0.0" } }, + "node_modules/badgin": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/badgin/-/badgin-1.2.3.tgz", + "integrity": "sha512-NQGA7LcfCpSzIbGRbkgjgdWkjy7HI+Th5VLxTJfW5EeaAf3fnS+xWQaQOCYiny+q6QSvxqoSO04vCx+4u++EJw==" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -9350,9 +9375,12 @@ "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==" }, "node_modules/component-type": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-type/-/component-type-1.2.1.tgz", - "integrity": "sha512-Kgy+2+Uwr75vAi6ChWXgHuLvd+QLD7ssgpaRq2zCvt80ptvAfMc/hijcJxXkBa2wMlEZcJvC2H8Ubo+A9ATHIg==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/component-type/-/component-type-1.2.2.tgz", + "integrity": "sha512-99VUHREHiN5cLeHm3YLq312p6v+HUEcwtLCAtelvUDI6+SH5g5Cr85oNR2S1o6ywzL0ykMbuwLzM2ANocjEOIA==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/compressible": { "version": "2.0.18", @@ -10440,7 +10468,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -11706,12 +11733,12 @@ } }, "node_modules/expo": { - "version": "49.0.16", - "resolved": "https://registry.npmjs.org/expo/-/expo-49.0.16.tgz", - "integrity": "sha512-1TcpWUEpzCQ7FjtwO1j+l/UvNgrEDZWfQm4kOo9eVZVDNKavYo+KL4XXHeljSAOOGhI/plmpD3bvhfYoywOAFQ==", + "version": "49.0.21", + "resolved": "https://registry.npmjs.org/expo/-/expo-49.0.21.tgz", + "integrity": "sha512-JpHL6V0yt8/fzsmkAdPdtsah+lU6Si4ac7MDklLYvzEil7HAFEsN/pf06wQ21ax4C+BL27hI6JJoD34tzXUCJA==", "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "0.10.14", + "@expo/cli": "0.10.16", "@expo/config": "8.1.2", "@expo/config-plugins": "7.2.5", "@expo/vector-icons": "^13.0.0", @@ -11719,11 +11746,11 @@ "expo-application": "~5.3.0", "expo-asset": "~8.10.1", "expo-constants": "~14.4.2", - "expo-file-system": "~15.4.4", + "expo-file-system": "~15.4.5", "expo-font": "~11.4.0", "expo-keep-awake": "~12.3.0", "expo-modules-autolinking": "1.5.1", - "expo-modules-core": "1.5.11", + "expo-modules-core": "1.5.12", "fbemitter": "^3.0.0", "invariant": "^2.2.4", "md5-file": "^3.2.3", @@ -11877,15 +11904,48 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/expo-device": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/expo-device/-/expo-device-5.4.0.tgz", + "integrity": "sha512-TQxSVPrC6njCbzZ9Cqpc1lGLIjPmO1zBIbqW7CTqBPD1dOIMrgQvt7lZZhkHh3pWzoZznH283sSYqCvy3XcURw==", + "dependencies": { + "ua-parser-js": "^0.7.33" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-device/node_modules/ua-parser-js": { + "version": "0.7.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz", + "integrity": "sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "engines": { + "node": "*" + } + }, "node_modules/expo-eas-client": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/expo-eas-client/-/expo-eas-client-0.6.0.tgz", "integrity": "sha512-FSPy0ThcJBvzEzOZVhpOrYyHgQ8U1jJ4v7u7tr1x0KOVRqyf25APEQZFxxRPn3zAYW0tQ+uDTCbrwNymFqhQfw==" }, "node_modules/expo-file-system": { - "version": "15.4.4", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-15.4.4.tgz", - "integrity": "sha512-F0xS88D85F7qVQ61r0qBnzh6VW/s6iIl+VaQEEi2nAIOQHw1JIEj4yCXPLTtbyn5VmArbe2dSL3KYz1V+BLkKA==", + "version": "15.4.5", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-15.4.5.tgz", + "integrity": "sha512-xy61KaTaDgXhT/dllwYDHm3ch026EyO8j4eC6wSVr/yE12MMMxAC09yGwy4f7kkOs6ztGVQF5j7ldRzNLN4l0Q==", "dependencies": { "uuid": "^3.4.0" }, @@ -11905,9 +11965,9 @@ } }, "node_modules/expo-head": { - "version": "0.0.17", - "resolved": "https://registry.npmjs.org/expo-head/-/expo-head-0.0.17.tgz", - "integrity": "sha512-N8UMN+uxQdp+tXVgSblKnd7EyMRa09EgS9dyCDxU5Sj7BpXOzt5R2p8/msBx1vWx6c0Afd5vp0BDnobUf2nAOg==", + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/expo-head/-/expo-head-0.0.20.tgz", + "integrity": "sha512-K0ETFOp/I+Td1T40D8k+Nlk8zCtvUFKTVYiwUhLoCCPf4dGC0zXv/noJLgyZ8jZ+5FJLlrSTpk2Gm9bxJfqkLw==", "dependencies": { "react-helmet-async": "^1.3.0" }, @@ -12099,14 +12159,66 @@ } }, "node_modules/expo-modules-core": { - "version": "1.5.11", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-1.5.11.tgz", - "integrity": "sha512-1Dj2t74nVjxq6xEQf2b9WFfAMhPzVnR0thY0PfRFgob4STyj3sq1U4PIHVWvKQBtDKIa227DrNRb+Hu+LqKWQg==", + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-1.5.12.tgz", + "integrity": "sha512-mY4wTDU458dhwk7IVxLNkePlYXjs9BTgk4NQHBUXf0LapXsvr+i711qPZaFNO4egf5qq6fQV+Yfd/KUguHstnQ==", "dependencies": { "compare-versions": "^3.4.0", "invariant": "^2.2.4" } }, + "node_modules/expo-notifications": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/expo-notifications/-/expo-notifications-0.20.1.tgz", + "integrity": "sha512-Y4Y8IWYj/cSWCP/P167z3GRg//5ZlsznfMXi4ABdWOOpF0RGNpd5N17TxioNivtt7tMhZ/o1vmzFxulhy0nBWg==", + "dependencies": { + "@expo/image-utils": "^0.3.18", + "@ide/backoff": "^1.0.0", + "abort-controller": "^3.0.0", + "assert": "^2.0.0", + "badgin": "^1.1.5", + "expo-application": "~5.3.0", + "expo-constants": "~14.4.2", + "fs-extra": "^9.1.0", + "uuid": "^3.4.0" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-notifications/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/expo-notifications/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/expo-notifications/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/expo-pwa": { "version": "0.0.127", "resolved": "https://registry.npmjs.org/expo-pwa/-/expo-pwa-0.0.127.tgz", @@ -12312,17 +12424,17 @@ } }, "node_modules/expo-router": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-2.0.11.tgz", - "integrity": "sha512-LKGWeOzrmyPAPmPCQB7dZLqf55kP9RWORp/y+BnPQ3wi2OMInK6Wl4UI/EUlpU6BWClsbg7YeifdbzBmPHICUw==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-2.0.14.tgz", + "integrity": "sha512-F5dP4WMe+zQLzlGSbC+NT9/67FGgwmUCJuPGD4BkK0eRt0uga+y53vQ59m5MCOebqE0N9Ukr/Jz8Num16iGqZA==", "dependencies": { "@bacons/react-views": "^1.1.3", - "@expo/metro-runtime": "2.2.13", + "@expo/metro-runtime": "2.2.16", "@radix-ui/react-slot": "1.0.1", "@react-navigation/bottom-tabs": "~6.5.7", "@react-navigation/native": "~6.1.6", "@react-navigation/native-stack": "~6.9.12", - "expo-head": "0.0.17", + "expo-head": "0.0.20", "expo-splash-screen": "~0.20.2", "query-string": "7.1.3", "react-helmet-async": "^1.3.0", @@ -13097,7 +13209,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -13493,7 +13604,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -14028,6 +14138,21 @@ "node": ">= 0.10" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -14110,7 +14235,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -14206,7 +14330,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -14308,6 +14431,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -14484,7 +14622,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -18603,6 +18740,299 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/native-notify": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/native-notify/-/native-notify-3.2.4.tgz", + "integrity": "sha512-PeQmmeUXedClHhEwbPra0u0itmpvfZORzNvye8wXcehIOPWFzK8LNnGczdyNumxHQn59w/7AlzjVZ8eEb2iPag==", + "dependencies": { + "axios": "^1.5.1", + "expo-device": "~5.6.0", + "expo-notifications": "~0.18.1" + } + }, + "node_modules/native-notify/node_modules/@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/native-notify/node_modules/@expo/config": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-8.0.5.tgz", + "integrity": "sha512-3CnLmtAQUWqLZwTRliS23QoFwdyhg4AWtp6gZ0qfcXthR84RvlZKcCDQQIyPiRUgu8dZa+gQDcdRJtgE+GM5XQ==", + "dependencies": { + "@babel/code-frame": "~7.10.4", + "@expo/config-plugins": "~6.0.0", + "@expo/config-types": "^48.0.0", + "@expo/json-file": "^8.2.37", + "getenv": "^1.0.0", + "glob": "7.1.6", + "require-from-string": "^2.0.2", + "resolve-from": "^5.0.0", + "semver": "7.3.2", + "slugify": "^1.3.4", + "sucrase": "^3.20.0" + } + }, + "node_modules/native-notify/node_modules/@expo/config-plugins": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-6.0.2.tgz", + "integrity": "sha512-Cn01fXMHwjU042EgO9oO3Mna0o/UCrW91MQLMbJa4pXM41CYGjNgVy1EVXiuRRx/upegHhvltBw5D+JaUm8aZQ==", + "dependencies": { + "@expo/config-types": "^48.0.0", + "@expo/json-file": "~8.2.37", + "@expo/plist": "^0.0.20", + "@expo/sdk-runtime-versions": "^1.0.0", + "@react-native/normalize-color": "^2.0.0", + "chalk": "^4.1.2", + "debug": "^4.3.1", + "find-up": "~5.0.0", + "getenv": "^1.0.0", + "glob": "7.1.6", + "resolve-from": "^5.0.0", + "semver": "^7.3.5", + "slash": "^3.0.0", + "xcode": "^3.0.1", + "xml2js": "0.4.23" + } + }, + "node_modules/native-notify/node_modules/@expo/config-plugins/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/native-notify/node_modules/@expo/config-types": { + "version": "48.0.0", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-48.0.0.tgz", + "integrity": "sha512-DwyV4jTy/+cLzXGAo1xftS6mVlSiLIWZjl9DjTCLPFVgNYQxnh7htPilRv4rBhiNs7KaznWqKU70+4zQoKVT9A==" + }, + "node_modules/native-notify/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/native-notify/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/native-notify/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/native-notify/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/native-notify/node_modules/expo-application": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/expo-application/-/expo-application-5.1.1.tgz", + "integrity": "sha512-aDatTcTTCdTbHw8h4/Tq2ilc6InM5ntF9xWCJdOcnUEcglxxGphVI/lzJKBaBF6mJECA8mEOjpVg2EGxOctTwg==", + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/native-notify/node_modules/expo-constants": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-14.2.1.tgz", + "integrity": "sha512-DD5u4QmBds2U7uYo409apV7nX+XjudARcgqe7S9aRFJ/6kyftmuxvk1DpaU4X42Av8z/tfKwEpuxl+vl7HHx/Q==", + "dependencies": { + "@expo/config": "~8.0.0", + "uuid": "^3.3.2" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/native-notify/node_modules/expo-device": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/expo-device/-/expo-device-5.6.0.tgz", + "integrity": "sha512-tWERUBJQ7LbBqQOr1dNyG+63iSYSYhhqhbIlA44sgRwlhUjLGPj6pfNUrniPFiggATDtIacaS5Nx5kTI69tuGg==", + "dependencies": { + "ua-parser-js": "^0.7.33" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/native-notify/node_modules/expo-notifications": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/expo-notifications/-/expo-notifications-0.18.1.tgz", + "integrity": "sha512-lOEiuPE6ubkS5u7Nj/57gkmUGD/MxsRTC6bg9SGJqXIitBQZk3Tmv9y8bjTrn71n7DsrH8K7xCZTbVwr+kLQGg==", + "dependencies": { + "@expo/image-utils": "^0.3.18", + "@ide/backoff": "^1.0.0", + "abort-controller": "^3.0.0", + "assert": "^2.0.0", + "badgin": "^1.1.5", + "expo-application": "~5.1.0", + "expo-constants": "~14.2.0", + "fs-extra": "^9.1.0", + "uuid": "^3.4.0" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/native-notify/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/native-notify/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/native-notify/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/native-notify/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/native-notify/node_modules/semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/native-notify/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/native-notify/node_modules/ua-parser-js": { + "version": "0.7.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.37.tgz", + "integrity": "sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "engines": { + "node": "*" + } + }, + "node_modules/native-notify/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/native-notify/node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/native-notify/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/native-notify/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -18863,11 +19293,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -18876,7 +19320,6 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -23360,6 +23803,18 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -24050,7 +24505,6 @@ "version": "1.1.13", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.4", diff --git a/package.json b/package.json index 5808f9d1..f1766436 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "expo-jwt": "^1.6.5", "expo-linking": "~5.0.2", "expo-router": "^2.0.4", + "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", "expo-updates": "~0.18.17", "jest": "^29.2.1", @@ -35,6 +36,7 @@ "jest-mock-extended": "^3.0.5", "jest-sonar": "^0.2.16", "jest-sonar-reporter": "^2.0.0", + "native-notify": "^3.2.4", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.72.6", @@ -50,7 +52,9 @@ "react-native-toast-message": "^2.1.7", "react-native-vector-icons": "^10.0.0", "react-native-web": "~0.19.6", - "ts-jest": "^29.1.1" + "ts-jest": "^29.1.1", + "expo-device": "~5.4.0", + "expo-notifications": "~0.20.1" }, "devDependencies": { "@babel/core": "^7.20.0", @@ -95,4 +99,4 @@ ] ] } -} +} \ No newline at end of file From dc290751f6fc36d713b4a94f2d6f3799a6510c48 Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Tue, 5 Dec 2023 18:21:19 -0300 Subject: [PATCH 08/14] (#199) adiciona recuperacao do token --- src/app/_layout.tsx | 43 ++++++++++++++ src/app/interfaces/rotina.interface.ts | 6 +- src/app/private/pages/cadastrarRotina.tsx | 71 ++++++++++++++++++++++- 3 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 src/app/_layout.tsx diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx new file mode 100644 index 00000000..b783bc7e --- /dev/null +++ b/src/app/_layout.tsx @@ -0,0 +1,43 @@ +import React, { useEffect, useRef } from "react"; +import { Stack } from "expo-router"; +import * as Notifications from "expo-notifications"; + +Notifications.setNotificationHandler({ + handleNotification: async () => ({ + shouldShowAlert: true, + shouldPlaySound: false, + shouldSetBadge: false, + }), +}); + +export default function AppLayout() { + const notificationListener = useRef(); + const responseListener = useRef(); + + useEffect(() => { + notificationListener.current = + Notifications.addNotificationReceivedListener((notification) => { + console.log(notification); + }); + + responseListener.current = + Notifications.addNotificationResponseReceivedListener((response) => { + console.log(response); + }); + + return () => { + Notifications.removeNotificationSubscription( + notificationListener.current as Notifications.Subscription, + ); + Notifications.removeNotificationSubscription( + responseListener.current as Notifications.Subscription, + ); + }; + }, []); + + return ( + <> + + + ); +} diff --git a/src/app/interfaces/rotina.interface.ts b/src/app/interfaces/rotina.interface.ts index 571b0450..e25b9a87 100644 --- a/src/app/interfaces/rotina.interface.ts +++ b/src/app/interfaces/rotina.interface.ts @@ -10,6 +10,8 @@ export interface IRotinaBody { idIdoso: number; categoria?: ECategoriaRotina | null; descricao?: string; + notificacao: boolean; + token?: string; dataHoraConcluidos: string[]; dataHora: Date | string; dias: EDiasSemana[]; @@ -35,6 +37,6 @@ export enum EDiasSemana { } export interface IOrder { - column: string, - dir: "ASC", + column: string; + dir: "ASC"; } diff --git a/src/app/private/pages/cadastrarRotina.tsx b/src/app/private/pages/cadastrarRotina.tsx index 7a0446af..25f769d0 100644 --- a/src/app/private/pages/cadastrarRotina.tsx +++ b/src/app/private/pages/cadastrarRotina.tsx @@ -5,6 +5,7 @@ import { View, TextInput, Platform, + Switch, } from "react-native"; import React, { useEffect, useState } from "react"; import { ScrollView } from "react-native-gesture-handler"; @@ -22,6 +23,7 @@ import Toast from "react-native-toast-message"; import AsyncStorage from "@react-native-async-storage/async-storage"; import { IIdoso } from "../../interfaces/idoso.interface"; import ErrorMessage from "../../components/ErrorMessage"; +import * as Notifications from "expo-notifications"; interface IErrors { titulo?: string; @@ -46,6 +48,8 @@ export default function CadastrarRotina() { const [titulo, setTitulo] = useState(""); const [data, setData] = useState(getInitialDateTime()); const [hora, setHora] = useState(getInitialDateTime(false)); + const [notificacao, setNotificacao] = useState(false); + const [expoToken, setExpoToken] = useState(""); const [descricao, setDescricao] = useState(""); const [categoria, setCategoria] = useState(null); const [showLoading, setShowLoading] = useState(false); @@ -53,7 +57,6 @@ export default function CadastrarRotina() { const [showErrors, setShowErrors] = useState(false); const [token, setToken] = useState(""); const [dias, setDias] = useState([]); - const [dataHoraConcluidos, setDataHoraConcluidos] = useState([]); const getToken = () => { AsyncStorage.getItem("token").then((response) => { @@ -129,8 +132,10 @@ export default function CadastrarRotina() { dataHora: getDateIsoString(data, hora), categoria: categoria as ECategoriaRotina, dias: dias, + token: expoToken, + notificacao, descricao, - dataHoraConcluidos, + dataHoraConcluidos: [], }; try { @@ -178,10 +183,48 @@ export default function CadastrarRotina() { } }; + const handleNotificacao = async () => { + if (!notificacao) return; + + if (Platform.OS === "android") { + Notifications.setNotificationChannelAsync("default", { + name: "default", + importance: Notifications.AndroidImportance.MAX, + vibrationPattern: [0, 250, 250, 250], + lightColor: "#FF231F7C", + }); + } + + const { status: existingStatus } = + await Notifications.getPermissionsAsync(); + + let finalStatus = existingStatus; + + if (existingStatus !== "granted") { + const { status } = await Notifications.requestPermissionsAsync(); + finalStatus = status; + } + + if (finalStatus !== "granted") { + alert("É necessário permitir as notificações!"); + setNotificacao(false); + return; + } + + const response = await Notifications.getExpoPushTokenAsync({ + projectId: "7028a81c-adee-41de-91a7-b7e80535a448", + }); + + setExpoToken(response.data); + }; + useEffect(() => getIdoso(), []); useEffect(() => getToken(), []); useEffect(() => setSuggestedTitle(), [categoria]); useEffect(() => handleErrors(), [titulo, data, hora, categoria, descricao]); + useEffect(() => { + handleNotificacao(); + }, [notificacao]); return ( @@ -274,6 +317,15 @@ export default function CadastrarRotina() { + + + Ativar notificação + + Date: Tue, 5 Dec 2023 19:30:33 -0300 Subject: [PATCH 09/14] (#199) ajuste lint e layouts --- src/app/__tests__/CadastrarRotina.spec.tsx | 237 ++++++++++++--------- src/app/_layout.tsx | 11 +- src/app/components/CardRotina.tsx | 4 +- src/app/private/pages/_layout.tsx | 15 -- src/app/private/pages/cadastrarRotina.tsx | 4 +- src/app/private/tabs/_layout.tsx | 8 +- src/app/public/_layout.tsx | 15 -- src/app/services/rotina.service.ts | 7 +- 8 files changed, 152 insertions(+), 149 deletions(-) delete mode 100644 src/app/private/pages/_layout.tsx delete mode 100644 src/app/public/_layout.tsx diff --git a/src/app/__tests__/CadastrarRotina.spec.tsx b/src/app/__tests__/CadastrarRotina.spec.tsx index 9a11708a..ce9f856c 100644 --- a/src/app/__tests__/CadastrarRotina.spec.tsx +++ b/src/app/__tests__/CadastrarRotina.spec.tsx @@ -1,111 +1,136 @@ -import React from 'react'; -import { render, fireEvent, waitFor, act } from '@testing-library/react-native'; -import CadastrarRotina from '../private/pages/cadastrarRotina'; - - -describe('CadastrarRotina Component', () => { - it('Salvar sem titulo', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const titulo = getByPlaceholderText('Adicionar título'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(titulo, ''); - fireEvent.press(salvar); - }); - const erroTitulo = getByTestId('Erro-titulo'); - - expect(erroTitulo.props.children.props.text).toBe('Campo obrigatório!'); +import React from "react"; +import { render, fireEvent, waitFor, act } from "@testing-library/react-native"; +import CadastrarRotina from "../private/pages/cadastrarRotina"; + +describe("CadastrarRotina Component", () => { + it("Salvar sem titulo", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const titulo = getByPlaceholderText("Adicionar título"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText(titulo, ""); + fireEvent.press(salvar); + }); + const erroTitulo = getByTestId("Erro-titulo"); + + expect(erroTitulo.props.children.props.text).toBe("Campo obrigatório!"); + }); + + it("Salvar com titulo muito grande", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const titulo = getByPlaceholderText("Adicionar título"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText( + titulo, + "Por que o livro de matemática está sempre triste? Porque tem muitos problemas! hahahahahahhahahahahhahahaahahahahahahhahahahahahahahahahahahhahaahahahahahahahahah", + ); + fireEvent.press(salvar); }); + const erroTitulo = getByText("O título deve ter no máximo 100 caracteres."); + + expect(erroTitulo).toBeTruthy(); + }); + + it("Salvar sem data", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const data = getByPlaceholderText("Data da rotina"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText(data, ""); + fireEvent.press(salvar); + }); + const erroData = getByTestId("Erro-data"); + + expect(erroData.props.children.props.text).toBe("Campo obrigatório"); + }); + + it("Salvar data com formato errado", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const data = getByPlaceholderText("Data da rotina"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText(data, "2010"); + fireEvent.press(salvar); + }); + const erroData = getByTestId("Erro-data"); + + expect(erroData.props.children.props.text).toBe( + "Data deve ser no formato dd/mm/yyyy!", + ); + }); + + it("Salvar sem hora", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const hora = getByPlaceholderText("Horário de início"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText(hora, ""); + fireEvent.press(salvar); + }); + const erroHora = getByTestId("Erro-hora"); + + expect(erroHora.props.children.props.text).toBe("Campo obrigatório"); + }); + + it("Salvar hora com formato errado", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const hora = getByPlaceholderText("Horário de início"); + const salvar = getByText("Salvar"); + + act(() => { + fireEvent.changeText(hora, "201"); + fireEvent.press(salvar); + }); + const erroHora = getByTestId("Erro-hora"); + + expect(erroHora.props.children.props.text).toBe( + "Hora deve ser no formato hh:mm!", + ); + }); + + it("Salvar com descrição muito grande", async () => { + const { getByText, getByPlaceholderText, getByTestId } = render( + , + ); + + const descricao = getByPlaceholderText("Descrição"); + const salvar = getByText("Salvar"); - it('Salvar com titulo muito grande', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const titulo = getByPlaceholderText('Adicionar título'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(titulo, 'Por que o livro de matemática está sempre triste? Porque tem muitos problemas! hahahahahahhahahahahhahahaahahahahahahhahahahahahahahahahahahhahaahahahahahahahahah'); - fireEvent.press(salvar); - }); - const erroTitulo = getByText('O título deve ter no máximo 100 caracteres.'); - - expect(erroTitulo).toBeTruthy(); + act(() => { + fireEvent.changeText( + descricao, + "Chapeuzinho Vermelho, uma garotinha de capa vermelha, foi mandada pela mãe para levar doces à vovó doente. No caminho, encontrou o lobo, que a enganou perguntando sobre o destino. O lobo, mais rápido, chegou à casa da vovó primeiro, a engoliu e se disfarçou. Quando Chapeuzinho chegou, notou algo estranho na vovó. O lobo tentou enganá-la, mas Chapeuzinho percebeu. O caçador apareceu, salvou-as, cortou a barriga do lobo, libertando vovó e Chapeuzinho. Moral: cuidado com estranhos, até mesmo disfarçados de vovó!", + ); + fireEvent.press(salvar); }); + const erroDescricao = getByTestId("Erro-descricao"); - it('Salvar sem data', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const data = getByPlaceholderText('Data da rotina'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(data, ''); - fireEvent.press(salvar); - }); - const erroData = getByTestId('Erro-data'); - - expect(erroData.props.children.props.text).toBe('Campo obrigatório'); - }); - - it('Salvar data com formato errado', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const data = getByPlaceholderText('Data da rotina'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(data, '2010'); - fireEvent.press(salvar); - }); - const erroData = getByTestId('Erro-data'); - - expect(erroData.props.children.props.text).toBe('Data deve ser no formato dd/mm/yyyy!'); - }); - - it('Salvar sem hora', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const hora = getByPlaceholderText('Horário de início'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(hora, ''); - fireEvent.press(salvar); - }); - const erroHora = getByTestId('Erro-hora'); - - expect(erroHora.props.children.props.text).toBe('Campo obrigatório'); - }); - - it('Salvar hora com formato errado', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const hora = getByPlaceholderText('Horário de início'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(hora, '201'); - fireEvent.press(salvar); - }); - const erroHora = getByTestId('Erro-hora'); - - expect(erroHora.props.children.props.text).toBe('Hora deve ser no formato hh:mm!'); - }); - - it('Salvar com descrição muito grande', async () => { - const { getByText, getByPlaceholderText, getByTestId } = render(); - - const descricao = getByPlaceholderText('Descrição'); - const salvar = getByText('Salvar'); - - act(() => { - fireEvent.changeText(descricao, 'Chapeuzinho Vermelho, uma garotinha de capa vermelha, foi mandada pela mãe para levar doces à vovó doente. No caminho, encontrou o lobo, que a enganou perguntando sobre o destino. O lobo, mais rápido, chegou à casa da vovó primeiro, a engoliu e se disfarçou. Quando Chapeuzinho chegou, notou algo estranho na vovó. O lobo tentou enganá-la, mas Chapeuzinho percebeu. O caçador apareceu, salvou-as, cortou a barriga do lobo, libertando vovó e Chapeuzinho. Moral: cuidado com estranhos, até mesmo disfarçados de vovó!'); - fireEvent.press(salvar); - }); - const erroDescricao = getByTestId('Erro-descricao'); - - expect(erroDescricao.props.children.props.text).toBe('A descrição deve ter no máximo 300 caracteres.'); - }); + expect(erroDescricao.props.children.props.text).toBe( + "A descrição deve ter no máximo 300 caracteres.", + ); + }); }); diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index b783bc7e..db6283c1 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -1,6 +1,8 @@ import React, { useEffect, useRef } from "react"; import { Stack } from "expo-router"; import * as Notifications from "expo-notifications"; +import { View } from "react-native"; +import Toast from "react-native-toast-message"; Notifications.setNotificationHandler({ handleNotification: async () => ({ @@ -37,7 +39,14 @@ export default function AppLayout() { return ( <> - + + + + , + }} + /> ); } diff --git a/src/app/components/CardRotina.tsx b/src/app/components/CardRotina.tsx index a64585c8..8f09fe3d 100644 --- a/src/app/components/CardRotina.tsx +++ b/src/app/components/CardRotina.tsx @@ -78,9 +78,9 @@ export default function CardRotina({ item, index, date }: IProps) { }; function ajustaHoraTexto() { - let dataHora = new Date(item.dataHora).toISOString(); + const dataHora = new Date(item.dataHora).toISOString(); if (dataHora[23] == "Z") { - let dataHoraSemUltimo = dataHora.slice(0, -1); + const dataHoraSemUltimo = dataHora.slice(0, -1); console.log(dataHoraSemUltimo); item.dataHora = dataHoraSemUltimo; } diff --git a/src/app/private/pages/_layout.tsx b/src/app/private/pages/_layout.tsx deleted file mode 100644 index 7a0231a2..00000000 --- a/src/app/private/pages/_layout.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from "react"; -import { Stack } from "expo-router"; -import Toast from "react-native-toast-message"; -import { View } from "react-native"; - -export default function PrivateLayout() { - return ( - <> - - - - - - ); -} diff --git a/src/app/private/pages/cadastrarRotina.tsx b/src/app/private/pages/cadastrarRotina.tsx index 25f769d0..3c70cf23 100644 --- a/src/app/private/pages/cadastrarRotina.tsx +++ b/src/app/private/pages/cadastrarRotina.tsx @@ -114,7 +114,7 @@ export default function CadastrarRotina() { { key: ECategoriaRotina.EXERCICIOS, value: ECategoriaRotina.EXERCICIOS }, ]; - const getDateIsoString = (data: string, hora: string) => { + const getDateIsoString = () => { const dateArray = data.split("/"); return `${dateArray[2]}-${dateArray[1]}-${dateArray[0]}T${hora}:00.000`; @@ -129,7 +129,7 @@ export default function CadastrarRotina() { const body = { idIdoso: Number(idoso?.id), titulo, - dataHora: getDateIsoString(data, hora), + dataHora: getDateIsoString(), categoria: categoria as ECategoriaRotina, dias: dias, token: expoToken, diff --git a/src/app/private/tabs/_layout.tsx b/src/app/private/tabs/_layout.tsx index 3b0f1350..d4aee530 100644 --- a/src/app/private/tabs/_layout.tsx +++ b/src/app/private/tabs/_layout.tsx @@ -1,9 +1,8 @@ -import { Platform, StyleSheet, View } from "react-native"; +import { Platform, StyleSheet } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import React from "react"; import { Tabs } from "expo-router"; -import Toast from "react-native-toast-message"; export default function TabsLayout() { const iconComponent = (focused: boolean, size: number, iconName: string) => ( @@ -16,9 +15,6 @@ export default function TabsLayout() { return ( <> - - - - + - - - - - - ); -} diff --git a/src/app/services/rotina.service.ts b/src/app/services/rotina.service.ts index 9eb0ffba..99e4fb5d 100644 --- a/src/app/services/rotina.service.ts +++ b/src/app/services/rotina.service.ts @@ -34,9 +34,12 @@ export const postRotina = async ( }; export const getAllRotina = async ( - filter: IRotinaFilter, order: IOrder, + filter: IRotinaFilter, + order: IOrder, ): Promise> => { - const params = `limit=20&offset=0&filter=${JSON.stringify(filter)}&order=${JSON.stringify(order)}`; + const params = `limit=20&offset=0&filter=${JSON.stringify( + filter, + )}&order=${JSON.stringify(order)}`; const response = await fetch(`${BASE_URL}?${params}`, { method: "GET", headers: { From 363c95f4a12c570428731bd4e20dd7d260a6b52b Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Tue, 5 Dec 2023 19:51:46 -0300 Subject: [PATCH 10/14] (#199) correcoes data rotina --- src/app/_layout.tsx | 2 +- src/app/components/CardRotina.tsx | 33 +++++++++++++------------- src/app/private/pages/editarRotina.tsx | 21 +++++++++------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index db6283c1..a4f012b1 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -44,7 +44,7 @@ export default function AppLayout() { , + header: () => , }} /> diff --git a/src/app/components/CardRotina.tsx b/src/app/components/CardRotina.tsx index 8f09fe3d..49fa3fea 100644 --- a/src/app/components/CardRotina.tsx +++ b/src/app/components/CardRotina.tsx @@ -17,9 +17,8 @@ export default function CardRotina({ item, index, date }: IProps) { const dateString = date.toISOString().split("T")[0]; const [nameIcon, setnameIcon] = useState("view-grid-outline"); - const [check, setCheck] = useState( - item.dataHoraConcluidos.includes(dateString), - ); + const [check, setCheck] = useState(false); + const [time, setTime] = useState(""); const [token, setToken] = useState(""); const [timer, setTimer] = useState(null); @@ -77,25 +76,27 @@ export default function CardRotina({ item, index, date }: IProps) { }); }; - function ajustaHoraTexto() { - const dataHora = new Date(item.dataHora).toISOString(); - if (dataHora[23] == "Z") { - const dataHoraSemUltimo = dataHora.slice(0, -1); - console.log(dataHoraSemUltimo); - item.dataHora = dataHoraSemUltimo; - } - } + const handleDataHora = () => { + const dateString = new Date(item.dataHora).toLocaleString("pt-BR", { + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }); + + const [data, hora] = dateString.split(" "); + setCheck(item.dataHoraConcluidos.includes(data)); + setTime(hora); + }; useEffect(() => handleIcon()); useEffect(() => getToken()); - useEffect(() => ajustaHoraTexto(), []); + useEffect(() => handleDataHora()); return ( <> - - {new Date(item.dataHora).getHours().toString().padStart(2, "0")}: - {new Date(item.dataHora).getMinutes().toString().padStart(2, "0")} - + {time} { - const value = params.dataHora as string; - const valueFinal = value.split("T"); - const separaData = valueFinal[0].split("-"); - setData(`${separaData[2]}/${separaData[1]}/${separaData[0]}`); - const separaHora = valueFinal[1].split(":"); - setHora(`${separaHora[0]}:${separaHora[1]}`); + const handleDataHora = () => { + const dateString = new Date(params.dataHora).toLocaleString("pt-BR", { + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }); + + const [data, hora] = dateString.split(" "); + setData(data); + setHora(hora); }; const handleErrors = () => { @@ -186,7 +191,7 @@ export default function EditarRotina() { useEffect(() => getIdoso(), []); useEffect(() => getToken(), []); useEffect(() => handleErrors(), [titulo, data, hora, categoria, descricao]); - useEffect(() => separaDataHora(), []); + useEffect(() => handleDataHora(), []); const confirmation = () => { setModalVisible(!modalVisible); From 86a2dbcd0b7eed7aebaa15610198afe9390f2ce1 Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Tue, 5 Dec 2023 20:30:32 -0300 Subject: [PATCH 11/14] (#199) footer --- src/app/_layout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index a4f012b1..1be19ecc 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -47,6 +47,7 @@ export default function AppLayout() { header: () => , }} /> + ); } From 62f435e0feb7d785134c0d0fa818ccc8661f7fbf Mon Sep 17 00:00:00 2001 From: Henrique Melo Date: Tue, 5 Dec 2023 21:13:11 -0300 Subject: [PATCH 12/14] (#199) corrige checkbox --- src/app/components/CardRotina.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/app/components/CardRotina.tsx b/src/app/components/CardRotina.tsx index 49fa3fea..5276d9db 100644 --- a/src/app/components/CardRotina.tsx +++ b/src/app/components/CardRotina.tsx @@ -14,7 +14,11 @@ interface IProps { } export default function CardRotina({ item, index, date }: IProps) { - const dateString = date.toISOString().split("T")[0]; + const dateString = date.toLocaleString("pt-BR", { + year: "numeric", + month: "2-digit", + day: "2-digit", + }); const [nameIcon, setnameIcon] = useState("view-grid-outline"); const [check, setCheck] = useState(false); @@ -29,12 +33,13 @@ export default function CardRotina({ item, index, date }: IProps) { }; const handleIcon = () => { - if (item.categoria == ECategoriaRotina.ALIMENTACAO) + if (item.categoria == ECategoriaRotina.ALIMENTACAO) { setnameIcon("food-apple-outline"); - else if (item.categoria == ECategoriaRotina.EXERCICIOS) + } else if (item.categoria == ECategoriaRotina.EXERCICIOS) { setnameIcon("dumbbell"); - else if (item.categoria == ECategoriaRotina.MEDICAMENTO) + } else if (item.categoria == ECategoriaRotina.MEDICAMENTO) { setnameIcon("medical-bag"); + } }; const debounceConcluido = (concluido: boolean) => { @@ -90,9 +95,9 @@ export default function CardRotina({ item, index, date }: IProps) { setTime(hora); }; - useEffect(() => handleIcon()); - useEffect(() => getToken()); - useEffect(() => handleDataHora()); + useEffect(() => handleIcon(), []); + useEffect(() => getToken(), []); + useEffect(() => handleDataHora(), []); return ( <> From d88e2757d775646cab43ee88f4b4e2e11713099e Mon Sep 17 00:00:00 2001 From: Pedro Cella Date: Wed, 6 Dec 2023 00:22:54 -0300 Subject: [PATCH 13/14] (#199) Remove testes com defeito --- .../__snapshots__/layoutPages.spec.tsx.snap | 221 ------------------ src/app/__tests__/layoutPages.spec.tsx | 21 -- 2 files changed, 242 deletions(-) delete mode 100644 src/app/__tests__/__snapshots__/layoutPages.spec.tsx.snap delete mode 100644 src/app/__tests__/layoutPages.spec.tsx diff --git a/src/app/__tests__/__snapshots__/layoutPages.spec.tsx.snap b/src/app/__tests__/__snapshots__/layoutPages.spec.tsx.snap deleted file mode 100644 index 228aa991..00000000 --- a/src/app/__tests__/__snapshots__/layoutPages.spec.tsx.snap +++ /dev/null @@ -1,221 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Layouts renders PrivateLayout correctly 1`] = ` - - - - - - - -`; - -exports[`Layouts renders PublicLayout correctly 1`] = ` - - - - - - - -`; diff --git a/src/app/__tests__/layoutPages.spec.tsx b/src/app/__tests__/layoutPages.spec.tsx deleted file mode 100644 index 9b83116e..00000000 --- a/src/app/__tests__/layoutPages.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import { render } from "@testing-library/react-native"; -import PublicLayout from "../public/_layout"; -import PrivateLayout from "../private/pages/_layout"; - -// Mock expo-router -jest.mock("expo-router", () => ({ - Stack: ({ children }: { children: React.ReactNode }) => <>{children}, -})); - -describe("Layouts", () => { - it("renders PublicLayout correctly", () => { - const { toJSON } = render(); - expect(toJSON()).toMatchSnapshot(); - }); - - it("renders PrivateLayout correctly", () => { - const { toJSON } = render(); - expect(toJSON()).toMatchSnapshot(); - }); -}); From ac4f5e27d9151d1aa3ebbf917db3b4a73fcb4857 Mon Sep 17 00:00:00 2001 From: Pedro Cella Date: Wed, 6 Dec 2023 01:01:11 -0300 Subject: [PATCH 14/14] (#199) Remove duplicacao --- .../components/ToggleButtonNotification.tsx | 41 ------------------- src/app/private/pages/cadastrarRotina.tsx | 12 ------ src/app/private/pages/editarRotina.tsx | 12 ------ 3 files changed, 65 deletions(-) delete mode 100644 src/app/components/ToggleButtonNotification.tsx diff --git a/src/app/components/ToggleButtonNotification.tsx b/src/app/components/ToggleButtonNotification.tsx deleted file mode 100644 index c39ac3d0..00000000 --- a/src/app/components/ToggleButtonNotification.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import { View, Text, StyleSheet, Switch } from 'react-native'; - -interface ToggleButtonProps { - onPress: () => void; - active: boolean; -} - -const ToggleButton: React.FC = ({ onPress, active }) => { - return ( - - - Ativar notificação - - ); -}; - -const styles = StyleSheet.create({ - toggleButtonContainer: { - flexDirection: 'row', - alignItems: 'flex-start', - marginTop: 10, - }, - - toggleButtonText: { - marginLeft: 10, - color: 'black', - fontSize: 17, - }, -}); - -export default ToggleButton; - - - diff --git a/src/app/private/pages/cadastrarRotina.tsx b/src/app/private/pages/cadastrarRotina.tsx index 69f9437e..3c70cf23 100644 --- a/src/app/private/pages/cadastrarRotina.tsx +++ b/src/app/private/pages/cadastrarRotina.tsx @@ -21,7 +21,6 @@ import MaskHour from "../../components/MaskHour"; import { postRotina } from "../../services/rotina.service"; import Toast from "react-native-toast-message"; import AsyncStorage from "@react-native-async-storage/async-storage"; -import ToggleButton from "../../components/ToggleButtonNotification"; import { IIdoso } from "../../interfaces/idoso.interface"; import ErrorMessage from "../../components/ErrorMessage"; import * as Notifications from "expo-notifications"; @@ -35,7 +34,6 @@ interface IErrors { } export default function CadastrarRotina() { - const [isToggleActive, setIsToggleActive] = useState(false); const getInitialDateTime = (isData = true) => { const today = new Date(); const formattedDate = today.toLocaleDateString("pt-BR", { @@ -309,10 +307,6 @@ export default function CadastrarRotina() { /> - - - setIsToggleActive(!isToggleActive)} active={isToggleActive} /> - @@ -489,10 +483,4 @@ const styles = StyleSheet.create({ marginBottom: 15, alignSelf: "flex-start", }, - toggleButtonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - marginTop: 10, - marginLeft: 20, - }, }); diff --git a/src/app/private/pages/editarRotina.tsx b/src/app/private/pages/editarRotina.tsx index 0fa4755f..a1293453 100644 --- a/src/app/private/pages/editarRotina.tsx +++ b/src/app/private/pages/editarRotina.tsx @@ -22,7 +22,6 @@ import Toast from "react-native-toast-message"; import AsyncStorage from "@react-native-async-storage/async-storage"; import ErrorMessage from "../../components/ErrorMessage"; import ModalConfirmation from "../../components/ModalConfirmation"; -import ToggleButton from "../../components/ToggleButtonNotification"; import { IIdoso } from "../../interfaces/idoso.interface"; interface IErrors { @@ -34,7 +33,6 @@ interface IErrors { } export default function EditarRotina() { - const [isToggleActive, setIsToggleActive] = useState(false); const params = useLocalSearchParams() as unknown as IRotina & { dias: string; }; @@ -286,10 +284,6 @@ export default function EditarRotina() { /> - - - setIsToggleActive(!isToggleActive)} active={isToggleActive} /> - @@ -470,10 +464,4 @@ const styles = StyleSheet.create({ marginBottom: 25, alignItems: "center", }, - toggleButtonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - marginTop: 10, - marginLeft: 20, - }, });