From bb9f2bdf13fce26cfe5d39162458a186d2f4186d Mon Sep 17 00:00:00 2001 From: nathandolbir <75330713+nathandolbir@users.noreply.github.com> Date: Mon, 27 Feb 2023 01:40:06 -0500 Subject: [PATCH 1/2] added changes to get apk working (other than swiping to settings page) --- app.json | 10 +- package-lock.json | 457 +++++++++++++++++++++++++++++++++++++--------- package.json | 9 +- 3 files changed, 374 insertions(+), 102 deletions(-) diff --git a/app.json b/app.json index d1f1e82..10feba0 100644 --- a/app.json +++ b/app.json @@ -14,9 +14,7 @@ "updates": { "fallbackToCacheTimeout": 0 }, - "assetBundlePatterns": [ - "**/*" - ], + "assetBundlePatterns": ["**/*"], "ios": { "supportsTablet": true, "bundleIdentifier": "com.jewzydee.gymbit" @@ -31,12 +29,10 @@ "web": { "favicon": "./assets/favicon.png" }, - "plugins": [ - "@config-plugins/detox" - ], + "plugins": ["@config-plugins/detox"], "extra": { "eas": { - "projectId": "e6de7d41-c1c1-4bb4-9b50-d1af6afb2587" + "projectId": "0777130d-6706-4342-aa9d-630e787674cd" } }, "owner": "jewzydee" diff --git a/package-lock.json b/package-lock.json index 353a4a4..44c985a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,15 +8,15 @@ "name": "nunchuckducks", "version": "1.0.0", "dependencies": { - "@aws-amplify/cli": "^10.6.2", - "@aws-amplify/core": "5.0.11", - "@aws-amplify/datastore": "4.0.11", - "@aws-amplify/storage": "5.1.1", + "@aws-amplify/cli": "10.6.2", + "@aws-amplify/core": "5.0.12", + "@aws-amplify/datastore": "4.0.12", + "@aws-amplify/storage": "5.1.2", "@aws-sdk/client-s3": "^3.245.0", "@aws-sdk/eventstream-codec": "^3.208.0", "@babel/preset-env": "^7.20.2", "@react-native-async-storage/async-storage": "^1.17.11", - "@react-native-community/netinfo": "^9.3.7", + "@react-native-community/netinfo": "9.3.5", "@react-native-picker/picker": "^2.4.8", "@react-navigation/material-top-tabs": "^6.5.2", "@react-navigation/native": "^6.0.13", @@ -25,8 +25,9 @@ "aws-amplify": "5.0.12", "aws-amplify-react-native": "7.0.2", "expo": "~47.0.12", - "expo-dev-client": "^2.0.1", + "expo-dev-client": "~2.0.1", "expo-image-picker": "~14.0.2", + "expo-modules-autolinking": "^0.8.1", "expo-splash-screen": "~0.17.5", "expo-status-bar": "~1.4.2", "graphql": "^15.8.0", @@ -36,11 +37,12 @@ "react-native-fs": "^2.20.0", "react-native-get-random-values": "^1.8.0", "react-native-pager-view": "6.0.1", - "react-native-safe-area-context": "^4.5.0", - "react-native-screens": "^3.19.0", + "react-native-safe-area-context": "4.4.1", + "react-native-screens": "~3.18.0", "react-native-tab-view": "^3.3.4", "react-native-url-polyfill": "^1.3.0", - "react-navigation": "^4.4.4" + "react-navigation": "^4.4.4", + "toggle-switch-react-native": "^3.3.0" }, "devDependencies": { "@babel/core": "^7.12.9", @@ -15727,9 +15729,9 @@ } }, "node_modules/@react-native-community/netinfo": { - "version": "9.3.7", - "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-9.3.7.tgz", - "integrity": "sha512-+taWmE5WpBp0uS6kf+bouCx/sn89G9EpR4s2M/ReLvctVIFL2Qh8WnWfBxqK9qwgmFha/uqjSr2Gq03OOtiDcw==", + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-9.3.5.tgz", + "integrity": "sha512-Mqbh/J8YCfc+EqSjq5OJn2USmcD8On4048pKEfyCsCDty3lQs1SNcmHqJdu9idNU2v//aM73T8F+re59cf78Ig==", "peerDependencies": { "react-native": ">=0.59" } @@ -18732,26 +18734,26 @@ } }, "node_modules/expo-dev-client": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.1.3.tgz", - "integrity": "sha512-hKfnSkHV5zdzzI26jHBcmRpkd4Olu3T7t3E1zGQicEPNCoX7wMxIQWqUpYwHhvIMZXdJ8dsTG3pMeqUMQdV+Jw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.0.1.tgz", + "integrity": "sha512-+OXXZKKo/CplqklpaZasHAX7qaRrzC83biqXTFa1z5NiFW41uqtAqTFx6gmPi4kx3YgwtD+ep6R3SRrKjdCukg==", "dependencies": { - "expo-dev-launcher": "2.1.3", - "expo-dev-menu": "2.1.3", - "expo-dev-menu-interface": "1.1.1", - "expo-manifests": "~0.5.0", - "expo-updates-interface": "~0.9.0" + "expo-dev-launcher": "2.0.2", + "expo-dev-menu": "2.0.2", + "expo-dev-menu-interface": "1.0.0", + "expo-manifests": "~0.4.0", + "expo-updates-interface": "~0.8.0" }, "peerDependencies": { "expo": "*" } }, "node_modules/expo-dev-launcher": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.1.3.tgz", - "integrity": "sha512-Wssr3ArC34pKNJQNQtZ7PQUmKz8PnBGrJTUTUfkiPGPPB1yP+oiDas7DftOMOzkLvw61UoB6aXc8rdxcC8+6NA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.0.2.tgz", + "integrity": "sha512-MQT7VSOHJQrEs3YAv5BQLYs3Uk7P1dNqBw6kKrj3jKBq0z92k2LLg1aCk7nP8OGJVDvrb2jTXBka8VXVqF0ECg==", "dependencies": { - "expo-dev-menu": "2.1.3", + "expo-dev-menu": "2.0.2", "resolve-from": "^5.0.0", "semver": "^7.3.5" }, @@ -18790,11 +18792,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/expo-dev-menu": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-2.1.3.tgz", - "integrity": "sha512-meQ3irhGNGyx6jKEpHy18WDS7on0iAJSmDnhT3+Jx55Ya+hdIvebF+aHDd4TrE/C5/Hlsn9/Fpm8bFAgmC1xpw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-2.0.2.tgz", + "integrity": "sha512-SxR5riXgm+VVKsDKC/bOLuOJ0CKutW07G+OqJ9eYfxwGfxa8omLJHwagbCsd8FwUPGkzvzgfRJRGLo5J6REMow==", "dependencies": { - "expo-dev-menu-interface": "1.1.1", + "expo-dev-menu-interface": "1.0.0", "semver": "^7.3.5" }, "peerDependencies": { @@ -18802,9 +18804,9 @@ } }, "node_modules/expo-dev-menu-interface": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/expo-dev-menu-interface/-/expo-dev-menu-interface-1.1.1.tgz", - "integrity": "sha512-doT+7WrSBnxCcTGZw9QIEZoL+43U4RywbG8XZwbhkcsFWGsh9scp0y/bv3ieFHxRtIdImxbxOoYh7fy1O6g28w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/expo-dev-menu-interface/-/expo-dev-menu-interface-1.0.0.tgz", + "integrity": "sha512-4lsVofTwV9oBM+zo7XhtmvbfiXD4I7I3Rqns6U0i6IOnH7OGBDpKvGZ5YikWPFGn6NOu8loqqd8S7inFIaxC0A==", "peerDependencies": { "expo": "*" } @@ -18890,9 +18892,9 @@ } }, "node_modules/expo-json-utils": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.5.1.tgz", - "integrity": "sha512-Y5boshyf40vPjwxNnOIfacZPNkOymecZRQ1k+TSXlq6gnw5XRsnM5hnP0VLVYhdv8x+9CX6E1fDsDUNvsK38Dg==" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.4.0.tgz", + "integrity": "sha512-lK6gjea72XTYafpKNNJaMrBK5dYAX8LFLXrp/M1MKJU4Zy7EHd2rKrLwop3GZts8VdwLHeVcMko79SAbhe3i5Q==" }, "node_modules/expo-keep-awake": { "version": "11.0.1", @@ -18903,17 +18905,17 @@ } }, "node_modules/expo-manifests": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.5.2.tgz", - "integrity": "sha512-WnsTlE2le3pV/B/AJPKTOSjb2K9AT1mPDCfQxTQ/KMCwF95saoXYt2OPF3hxZNaMAV6VIAhXgd5Y6wpcH9ruPQ==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.4.0.tgz", + "integrity": "sha512-IdZjIYDxx4nH0Gb3X4T4/2YknmR/jSLxymAS0m7SfJ9V7Vlu/y0p3lNwUys9/JzihxX9PDIuOi/Y4/uqL6TlXg==", "dependencies": { - "expo-json-utils": "~0.5.0" + "expo-json-utils": "~0.4.0" } }, "node_modules/expo-modules-autolinking": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.0.2.tgz", - "integrity": "sha512-skAUXERKw1gtSw8xsvft9DE0KVhBvw4dujAtgCZoG2l513fN7ds+B5+30ZVgZATMC+EjtlmjKXzhp5QS44DCFA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-0.8.1.tgz", + "integrity": "sha512-S8qfaXCv//7tQWV9M+JKx3CF7ypYhDdSUbkUQdaVO/r8D76/aRTArY/aRw1yEfaAOzyK8C8diDToV1itl51DfQ==", "dependencies": { "chalk": "^4.1.0", "commander": "^7.2.0", @@ -19100,13 +19102,58 @@ "integrity": "sha512-5DV0hIEWgatSC3UgQuAZBoQeaS9CqeWRZ3vzBR9R/+IUD87Adbi4FGhU10nymRqFXOizGsureButGZIXPs7zEA==" }, "node_modules/expo-updates-interface": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.9.1.tgz", - "integrity": "sha512-wk88LLhseQ7LJvxdN7BTKiryyqALxnrvr+lyHK3/prg76Yy0EGi2Q/oE/rtFyyZ1JmQDRbO/5pdX0EE6QqVQXQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.8.1.tgz", + "integrity": "sha512-1TPFCTQFHMZbltFGnxig3PbN/b6nO4T0RyL8XqdmYvQY0ElOCprZXQQ8vNDqeLYHgausG1lD4OyJwFzh2SNBSA==", "peerDependencies": { "expo": "*" } }, + "node_modules/expo/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/expo/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/expo/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/expo/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/expo/node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -19122,6 +19169,105 @@ "node": ">=4.8" } }, + "node_modules/expo/node_modules/expo-modules-autolinking": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.0.2.tgz", + "integrity": "sha512-skAUXERKw1gtSw8xsvft9DE0KVhBvw4dujAtgCZoG2l513fN7ds+B5+30ZVgZATMC+EjtlmjKXzhp5QS44DCFA==", + "dependencies": { + "chalk": "^4.1.0", + "commander": "^7.2.0", + "fast-glob": "^3.2.5", + "find-up": "^5.0.0", + "fs-extra": "^9.1.0" + }, + "bin": { + "expo-modules-autolinking": "bin/expo-modules-autolinking.js" + } + }, + "node_modules/expo/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo/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/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/expo/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/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, "node_modules/expo/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -19130,6 +19276,25 @@ "semver": "bin/semver" } }, + "node_modules/expo/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/expo/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -26262,9 +26427,9 @@ } }, "node_modules/react-native-safe-area-context": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.5.0.tgz", - "integrity": "sha512-0WORnk9SkREGUg2V7jHZbuN5x4vcxj/1B0QOcXJjdYWrzZHgLcUzYWWIUecUPJh747Mwjt/42RZDOaFn3L8kPQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz", + "integrity": "sha512-N9XTjiuD73ZpVlejHrUWIFZc+6Z14co1K/p1IFMkImU7+avD69F3y+lhkqA2hN/+vljdZrBSiOwXPkuo43nFQA==", "peerDependencies": { "react": "*", "react-native": "*" @@ -26288,9 +26453,9 @@ "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" }, "node_modules/react-native-screens": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.20.0.tgz", - "integrity": "sha512-joWUKWAVHxymP3mL9gYApFHAsbd9L6ZcmpoZa6Sl3W/82bvvNVMqcfP7MeNqVCg73qZ8yL4fW+J/syusHleUgg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.18.2.tgz", + "integrity": "sha512-ANUEuvMUlsYJ1QKukEhzhfrvOUO9BVH9Nzg+6eWxpn3cfD/O83yPBOF8Mx6x5H/2+sMy+VS5x/chWOOo/U7QJw==", "dependencies": { "react-freeze": "^1.0.0", "warn-once": "^0.1.0" @@ -41888,9 +42053,9 @@ } }, "@react-native-community/netinfo": { - "version": "9.3.7", - "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-9.3.7.tgz", - "integrity": "sha512-+taWmE5WpBp0uS6kf+bouCx/sn89G9EpR4s2M/ReLvctVIFL2Qh8WnWfBxqK9qwgmFha/uqjSr2Gq03OOtiDcw==", + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-9.3.5.tgz", + "integrity": "sha512-Mqbh/J8YCfc+EqSjq5OJn2USmcD8On4048pKEfyCsCDty3lQs1SNcmHqJdu9idNU2v//aM73T8F+re59cf78Ig==", "requires": {} }, "@react-native-picker/picker": { @@ -44212,6 +44377,36 @@ "uuid": "^3.4.0" }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "requires": { + "color-name": "~1.1.4" + } + }, + "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==" + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -44224,10 +44419,90 @@ "which": "^1.2.9" } }, + "expo-modules-autolinking": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.0.2.tgz", + "integrity": "sha512-skAUXERKw1gtSw8xsvft9DE0KVhBvw4dujAtgCZoG2l513fN7ds+B5+30ZVgZATMC+EjtlmjKXzhp5QS44DCFA==", + "requires": { + "chalk": "^4.1.0", + "commander": "^7.2.0", + "fast-glob": "^3.2.5", + "find-up": "^5.0.0", + "fs-extra": "^9.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "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==", + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "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==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" } } }, @@ -44261,23 +44536,23 @@ } }, "expo-dev-client": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.1.3.tgz", - "integrity": "sha512-hKfnSkHV5zdzzI26jHBcmRpkd4Olu3T7t3E1zGQicEPNCoX7wMxIQWqUpYwHhvIMZXdJ8dsTG3pMeqUMQdV+Jw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/expo-dev-client/-/expo-dev-client-2.0.1.tgz", + "integrity": "sha512-+OXXZKKo/CplqklpaZasHAX7qaRrzC83biqXTFa1z5NiFW41uqtAqTFx6gmPi4kx3YgwtD+ep6R3SRrKjdCukg==", "requires": { - "expo-dev-launcher": "2.1.3", - "expo-dev-menu": "2.1.3", - "expo-dev-menu-interface": "1.1.1", - "expo-manifests": "~0.5.0", - "expo-updates-interface": "~0.9.0" + "expo-dev-launcher": "2.0.2", + "expo-dev-menu": "2.0.2", + "expo-dev-menu-interface": "1.0.0", + "expo-manifests": "~0.4.0", + "expo-updates-interface": "~0.8.0" } }, "expo-dev-launcher": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.1.3.tgz", - "integrity": "sha512-Wssr3ArC34pKNJQNQtZ7PQUmKz8PnBGrJTUTUfkiPGPPB1yP+oiDas7DftOMOzkLvw61UoB6aXc8rdxcC8+6NA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expo-dev-launcher/-/expo-dev-launcher-2.0.2.tgz", + "integrity": "sha512-MQT7VSOHJQrEs3YAv5BQLYs3Uk7P1dNqBw6kKrj3jKBq0z92k2LLg1aCk7nP8OGJVDvrb2jTXBka8VXVqF0ECg==", "requires": { - "expo-dev-menu": "2.1.3", + "expo-dev-menu": "2.0.2", "resolve-from": "^5.0.0", "semver": "^7.3.5" }, @@ -44306,11 +44581,11 @@ } }, "expo-dev-menu": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-2.1.3.tgz", - "integrity": "sha512-meQ3irhGNGyx6jKEpHy18WDS7on0iAJSmDnhT3+Jx55Ya+hdIvebF+aHDd4TrE/C5/Hlsn9/Fpm8bFAgmC1xpw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expo-dev-menu/-/expo-dev-menu-2.0.2.tgz", + "integrity": "sha512-SxR5riXgm+VVKsDKC/bOLuOJ0CKutW07G+OqJ9eYfxwGfxa8omLJHwagbCsd8FwUPGkzvzgfRJRGLo5J6REMow==", "requires": { - "expo-dev-menu-interface": "1.1.1", + "expo-dev-menu-interface": "1.0.0", "semver": "^7.3.5" }, "dependencies": { @@ -44338,9 +44613,9 @@ } }, "expo-dev-menu-interface": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/expo-dev-menu-interface/-/expo-dev-menu-interface-1.1.1.tgz", - "integrity": "sha512-doT+7WrSBnxCcTGZw9QIEZoL+43U4RywbG8XZwbhkcsFWGsh9scp0y/bv3ieFHxRtIdImxbxOoYh7fy1O6g28w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/expo-dev-menu-interface/-/expo-dev-menu-interface-1.0.0.tgz", + "integrity": "sha512-4lsVofTwV9oBM+zo7XhtmvbfiXD4I7I3Rqns6U0i6IOnH7OGBDpKvGZ5YikWPFGn6NOu8loqqd8S7inFIaxC0A==", "requires": {} }, "expo-error-recovery": { @@ -44381,9 +44656,9 @@ } }, "expo-json-utils": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.5.1.tgz", - "integrity": "sha512-Y5boshyf40vPjwxNnOIfacZPNkOymecZRQ1k+TSXlq6gnw5XRsnM5hnP0VLVYhdv8x+9CX6E1fDsDUNvsK38Dg==" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.4.0.tgz", + "integrity": "sha512-lK6gjea72XTYafpKNNJaMrBK5dYAX8LFLXrp/M1MKJU4Zy7EHd2rKrLwop3GZts8VdwLHeVcMko79SAbhe3i5Q==" }, "expo-keep-awake": { "version": "11.0.1", @@ -44392,17 +44667,17 @@ "requires": {} }, "expo-manifests": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.5.2.tgz", - "integrity": "sha512-WnsTlE2le3pV/B/AJPKTOSjb2K9AT1mPDCfQxTQ/KMCwF95saoXYt2OPF3hxZNaMAV6VIAhXgd5Y6wpcH9ruPQ==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.4.0.tgz", + "integrity": "sha512-IdZjIYDxx4nH0Gb3X4T4/2YknmR/jSLxymAS0m7SfJ9V7Vlu/y0p3lNwUys9/JzihxX9PDIuOi/Y4/uqL6TlXg==", "requires": { - "expo-json-utils": "~0.5.0" + "expo-json-utils": "~0.4.0" } }, "expo-modules-autolinking": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.0.2.tgz", - "integrity": "sha512-skAUXERKw1gtSw8xsvft9DE0KVhBvw4dujAtgCZoG2l513fN7ds+B5+30ZVgZATMC+EjtlmjKXzhp5QS44DCFA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-0.8.1.tgz", + "integrity": "sha512-S8qfaXCv//7tQWV9M+JKx3CF7ypYhDdSUbkUQdaVO/r8D76/aRTArY/aRw1yEfaAOzyK8C8diDToV1itl51DfQ==", "requires": { "chalk": "^4.1.0", "commander": "^7.2.0", @@ -44535,9 +44810,9 @@ "integrity": "sha512-5DV0hIEWgatSC3UgQuAZBoQeaS9CqeWRZ3vzBR9R/+IUD87Adbi4FGhU10nymRqFXOizGsureButGZIXPs7zEA==" }, "expo-updates-interface": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.9.1.tgz", - "integrity": "sha512-wk88LLhseQ7LJvxdN7BTKiryyqALxnrvr+lyHK3/prg76Yy0EGi2Q/oE/rtFyyZ1JmQDRbO/5pdX0EE6QqVQXQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.8.1.tgz", + "integrity": "sha512-1TPFCTQFHMZbltFGnxig3PbN/b6nO4T0RyL8XqdmYvQY0ElOCprZXQQ8vNDqeLYHgausG1lD4OyJwFzh2SNBSA==", "requires": {} }, "extend-shallow": { @@ -50011,9 +50286,9 @@ "requires": {} }, "react-native-safe-area-context": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.5.0.tgz", - "integrity": "sha512-0WORnk9SkREGUg2V7jHZbuN5x4vcxj/1B0QOcXJjdYWrzZHgLcUzYWWIUecUPJh747Mwjt/42RZDOaFn3L8kPQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz", + "integrity": "sha512-N9XTjiuD73ZpVlejHrUWIFZc+6Z14co1K/p1IFMkImU7+avD69F3y+lhkqA2hN/+vljdZrBSiOwXPkuo43nFQA==", "requires": {} }, "react-native-safe-area-view": { @@ -50032,9 +50307,9 @@ } }, "react-native-screens": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.20.0.tgz", - "integrity": "sha512-joWUKWAVHxymP3mL9gYApFHAsbd9L6ZcmpoZa6Sl3W/82bvvNVMqcfP7MeNqVCg73qZ8yL4fW+J/syusHleUgg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.18.2.tgz", + "integrity": "sha512-ANUEuvMUlsYJ1QKukEhzhfrvOUO9BVH9Nzg+6eWxpn3cfD/O83yPBOF8Mx6x5H/2+sMy+VS5x/chWOOo/U7QJw==", "requires": { "react-freeze": "^1.0.0", "warn-once": "^0.1.0" diff --git a/package.json b/package.json index 5fafdb0..72ad140 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@aws-sdk/eventstream-codec": "^3.208.0", "@babel/preset-env": "^7.20.2", "@react-native-async-storage/async-storage": "^1.17.11", - "@react-native-community/netinfo": "^9.3.7", + "@react-native-community/netinfo": "9.3.5", "@react-native-picker/picker": "^2.4.8", "@react-navigation/material-top-tabs": "^6.5.2", "@react-navigation/native": "^6.0.13", @@ -28,8 +28,9 @@ "aws-amplify": "5.0.12", "aws-amplify-react-native": "7.0.2", "expo": "~47.0.12", - "expo-dev-client": "^2.0.1", + "expo-dev-client": "~2.0.1", "expo-image-picker": "~14.0.2", + "expo-modules-autolinking": "^0.8.1", "expo-splash-screen": "~0.17.5", "expo-status-bar": "~1.4.2", "graphql": "^15.8.0", @@ -39,8 +40,8 @@ "react-native-fs": "^2.20.0", "react-native-get-random-values": "^1.8.0", "react-native-pager-view": "6.0.1", - "react-native-safe-area-context": "^4.5.0", - "react-native-screens": "^3.19.0", + "react-native-safe-area-context": "4.4.1", + "react-native-screens": "~3.18.0", "react-native-tab-view": "^3.3.4", "react-native-url-polyfill": "^1.3.0", "react-navigation": "^4.4.4", From bcff4da18bf7ca3f1f0601e19ca829d547fd7978 Mon Sep 17 00:00:00 2001 From: nathandolbir <75330713+nathandolbir@users.noreply.github.com> Date: Mon, 27 Feb 2023 02:46:13 -0500 Subject: [PATCH 2/2] pain. pain and suffering --- App.js | 2 +- src/components/Navbar/Navbar.js | 31 +- src/crud/PostOperations.js | 1 + src/models/schema.js | 1315 ++++++++++++++++--------------- src/screens/SettingsScreen.js | 45 +- 5 files changed, 723 insertions(+), 671 deletions(-) diff --git a/App.js b/App.js index cdc3a81..b76c8dc 100644 --- a/App.js +++ b/App.js @@ -60,7 +60,7 @@ const app = () => { initialRouteName="Mutuals" tabBarPosition="bottom" > - + {/**/} {/* */} diff --git a/src/components/Navbar/Navbar.js b/src/components/Navbar/Navbar.js index 93edfcb..857f82f 100644 --- a/src/components/Navbar/Navbar.js +++ b/src/components/Navbar/Navbar.js @@ -32,13 +32,8 @@ const Navbar = () => { const [clickedElement, setClickedElement] = useState("Mutuals"); return ( - - + {/* { navigation.navigate("Settings"); @@ -50,7 +45,7 @@ const Navbar = () => { ]} > Settings - + */} {/* { @@ -70,10 +65,7 @@ const Navbar = () => { navigation.navigate("Mutuals"); setClickedElement("Mutuals"); }} - style={[ - clickedElement == "Mutuals" ? styles.currentNavbarElement : {}, - styles.navbarElement, - ]} + style={[clickedElement == "Mutuals" ? styles.currentNavbarElement : {}, styles.navbarElement]} > Mutuals @@ -82,10 +74,7 @@ const Navbar = () => { navigation.navigate("Profile"); setClickedElement("Profile"); }} - style={[ - clickedElement == "Profile" ? styles.currentNavbarElement : {}, - styles.navbarElement, - ]} + style={[clickedElement == "Profile" ? styles.currentNavbarElement : {}, styles.navbarElement]} > Profile @@ -106,10 +95,7 @@ const Navbar = () => { navigation.navigate("Goals"); setClickedElement("Goals"); }} - style={[ - clickedElement == "Goals" ? styles.currentNavbarElement : {}, - styles.navbarElement, - ]} + style={[clickedElement == "Goals" ? styles.currentNavbarElement : {}, styles.navbarElement]} > Goals @@ -118,10 +104,7 @@ const Navbar = () => { navigation.navigate("Followers"); setClickedElement("Followers"); }} - style={[ - clickedElement == "Followers" ? styles.currentNavbarElement : {}, - styles.navbarElement, - ]} + style={[clickedElement == "Followers" ? styles.currentNavbarElement : {}, styles.navbarElement]} > Followers diff --git a/src/crud/PostOperations.js b/src/crud/PostOperations.js index f70d644..abc3a3d 100644 --- a/src/crud/PostOperations.js +++ b/src/crud/PostOperations.js @@ -1,5 +1,6 @@ import { processCompositeKeys } from "@aws-amplify/datastore/lib-esm/util"; import { Int64 } from "@aws-sdk/eventstream-codec"; +import { getCurrentUser } from "./CacheOperations"; import { DataStore, SortDirection } from "aws-amplify"; import { Post, Follows, User } from "../models"; import { getUserId } from "./UserOperations"; diff --git a/src/models/schema.js b/src/models/schema.js index 213e5b4..aaf33f8 100644 --- a/src/models/schema.js +++ b/src/models/schema.js @@ -1,624 +1,697 @@ export const schema = { - models: { - FollowedBy: { - name: "FollowedBy", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - userID: { - name: "userID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "FollowedBies", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byUser", - fields: ["userID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Follows: { - name: "Follows", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - userID: { - name: "userID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Follows", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byUser", - fields: ["userID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Reaction: { - name: "Reaction", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - reactionType: { - name: "reactionType", - isArray: false, - type: { - enum: "ReactionType", - }, - isRequired: true, - attributes: [], - }, - postID: { - name: "postID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Reactions", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byPost", - fields: ["postID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Comment: { - name: "Comment", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - content: { - name: "content", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - postID: { - name: "postID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - reply: { - name: "reply", - isArray: false, - type: "ID", - isRequired: false, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Comments", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byPost", - fields: ["postID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Goal: { - name: "Goal", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - date: { - name: "date", - isArray: false, - type: "AWSDate", - isRequired: false, - attributes: [], - }, - content: { - name: "content", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - userID: { - name: "userID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Goals", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byUser", - fields: ["userID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - User: { - name: "User", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - profilePicture: { - name: "profilePicture", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - bio: { - name: "bio", - isArray: false, - type: "String", - isRequired: false, - attributes: [], - }, - Goals: { - name: "Goals", - isArray: true, - type: { - model: "Goal", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "userID", - }, - }, - Posts: { - name: "Posts", - isArray: true, - type: { - model: "Post", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "userID", - }, - }, - Follows: { - name: "Follows", - isArray: true, - type: { - model: "Follows", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "userID", - }, - }, - FollowedBies: { - name: "FollowedBies", - isArray: true, - type: { - model: "FollowedBy", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "userID", - }, - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Users", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], - }, - Post: { - name: "Post", - fields: { - id: { - name: "id", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - caption: { - name: "caption", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - photo: { - name: "photo", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - username: { - name: "username", - isArray: false, - type: "String", - isRequired: true, - attributes: [], - }, - Comments: { - name: "Comments", - isArray: true, - type: { - model: "Comment", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "postID", - }, - }, - Reactions: { - name: "Reactions", - isArray: true, - type: { - model: "Reaction", - }, - isRequired: false, - attributes: [], - isArrayNullable: true, - association: { - connectionType: "HAS_MANY", - associatedWith: "postID", - }, - }, - userID: { - name: "userID", - isArray: false, - type: "ID", - isRequired: true, - attributes: [], - }, - createdAt: { - name: "createdAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - updatedAt: { - name: "updatedAt", - isArray: false, - type: "AWSDateTime", - isRequired: false, - attributes: [], - isReadOnly: true, - }, - }, - syncable: true, - pluralName: "Posts", - attributes: [ - { - type: "model", - properties: {}, - }, - { - type: "key", - properties: { - name: "byUser", - fields: ["userID"], - }, - }, - { - type: "auth", - properties: { - rules: [ - { - allow: "public", - operations: ["create", "update", "delete", "read"], - }, - ], - }, - }, - ], + "models": { + "FollowedBy": { + "name": "FollowedBy", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "userID": { + "name": "userID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "FollowedBies", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byUser", + "fields": [ + "userID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Follows": { + "name": "Follows", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "userID": { + "name": "userID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Follows", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byUser", + "fields": [ + "userID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Reaction": { + "name": "Reaction", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "reactionType": { + "name": "reactionType", + "isArray": false, + "type": { + "enum": "ReactionType" + }, + "isRequired": true, + "attributes": [] + }, + "postID": { + "name": "postID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Reactions", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byPost", + "fields": [ + "postID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Comment": { + "name": "Comment", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "content": { + "name": "content", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "postID": { + "name": "postID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "reply": { + "name": "reply", + "isArray": false, + "type": "ID", + "isRequired": false, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Comments", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byPost", + "fields": [ + "postID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Goal": { + "name": "Goal", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "date": { + "name": "date", + "isArray": false, + "type": "AWSDate", + "isRequired": false, + "attributes": [] + }, + "content": { + "name": "content", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "userID": { + "name": "userID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "isCompleted": { + "name": "isCompleted", + "isArray": false, + "type": "Boolean", + "isRequired": false, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Goals", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byUser", + "fields": [ + "userID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "User": { + "name": "User", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "profilePicture": { + "name": "profilePicture", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "bio": { + "name": "bio", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "Goals": { + "name": "Goals", + "isArray": true, + "type": { + "model": "Goal" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "userID" + } + }, + "Posts": { + "name": "Posts", + "isArray": true, + "type": { + "model": "Post" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "userID" + } + }, + "Follows": { + "name": "Follows", + "isArray": true, + "type": { + "model": "Follows" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "userID" + } + }, + "FollowedBies": { + "name": "FollowedBies", + "isArray": true, + "type": { + "model": "FollowedBy" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "userID" + } + }, + "expoToken": { + "name": "expoToken", + "isArray": false, + "type": "String", + "isRequired": false, + "attributes": [] + }, + "isPrivate": { + "name": "isPrivate", + "isArray": false, + "type": "Boolean", + "isRequired": false, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Users", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + }, + "Post": { + "name": "Post", + "fields": { + "id": { + "name": "id", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "caption": { + "name": "caption", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "photo": { + "name": "photo", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "username": { + "name": "username", + "isArray": false, + "type": "String", + "isRequired": true, + "attributes": [] + }, + "Comments": { + "name": "Comments", + "isArray": true, + "type": { + "model": "Comment" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "postID" + } + }, + "Reactions": { + "name": "Reactions", + "isArray": true, + "type": { + "model": "Reaction" + }, + "isRequired": false, + "attributes": [], + "isArrayNullable": true, + "association": { + "connectionType": "HAS_MANY", + "associatedWith": "postID" + } + }, + "userID": { + "name": "userID", + "isArray": false, + "type": "ID", + "isRequired": true, + "attributes": [] + }, + "createdAt": { + "name": "createdAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + }, + "updatedAt": { + "name": "updatedAt", + "isArray": false, + "type": "AWSDateTime", + "isRequired": false, + "attributes": [], + "isReadOnly": true + } + }, + "syncable": true, + "pluralName": "Posts", + "attributes": [ + { + "type": "model", + "properties": {} + }, + { + "type": "key", + "properties": { + "name": "byUser", + "fields": [ + "userID" + ] + } + }, + { + "type": "auth", + "properties": { + "rules": [ + { + "allow": "public", + "operations": [ + "create", + "update", + "delete", + "read" + ] + } + ] + } + } + ] + } }, - }, - enums: { - ReactionType: { - name: "ReactionType", - values: ["LIKE", "LOVE", "FLEX", "CLAP"], + "enums": { + "ReactionType": { + "name": "ReactionType", + "values": [ + "LIKE", + "LOVE", + "FLEX", + "CLAP" + ] + } }, - }, - nonModels: {}, - codegenVersion: "3.3.4", - version: "b627478f22e21843a41acbcb61147121", -}; + "nonModels": {}, + "codegenVersion": "3.3.5", + "version": "4eb4253a58e2a25652b8f8b361474fb6" +}; \ No newline at end of file diff --git a/src/screens/SettingsScreen.js b/src/screens/SettingsScreen.js index b57fbd5..0a424ab 100644 --- a/src/screens/SettingsScreen.js +++ b/src/screens/SettingsScreen.js @@ -1,16 +1,14 @@ import { View, Text, TouchableOpacity, StyleSheet, Switch } from "react-native"; import Header from "../components/Header/Header"; -import { BackButton } from "../components/BackButton"; -import { getPostsThatShouldBeCached, getAllCachedFiles, deleteCachedFile, getCachedCurrUser } from "../crud/CacheOperations"; - -import { setPrivate, setPublic, isUserPrivate, togglePrivacy } from "../crud/UserOperations"; +import { getPostsThatShouldBeCached, getAllCachedFiles, deleteCachedFile } from "../crud/CacheOperations"; +import { isUserPrivate, togglePrivacy } from "../crud/UserOperations"; import { getCurrentAuthenticatedUser } from "../library/GetAuthenticatedUser"; import { useEffect, useState } from "react"; import { useNavigation } from "@react-navigation/core"; export function SettingsScreen({ navigation }) { async function deleteOldCache() { - let postNames = await getPostsThatShouldBeCached(); + /*let postNames = await getPostsThatShouldBeCached(); if (postNames === null) { console.log("No posts in cache, so there is no need to delete old cache"); } @@ -26,7 +24,7 @@ export function SettingsScreen({ navigation }) { await deleteCachedFile(curr); console.log("Deleted file", curr); } - } + }*/ } const styles = StyleSheet.create({ @@ -47,39 +45,36 @@ export function SettingsScreen({ navigation }) { left: 20, }, switch: { - right: 175 + right: 175, }, }); - const [username, setUsername] = useState(""); const [isEnabled, setIsEnabled] = useState(false); const [userPrivacy, setUserPrivacy] = useState(null); const nav = useNavigation(); - + /* const toggleSwitch = () => { if (userPrivacy === true) { togglePrivacy(username, false); - setIsEnabled(previousState => false); + setIsEnabled((previousState) => false); setUserPrivacy(false); - } - else { + } else { togglePrivacy(username, true); - setIsEnabled(previousState => true); + setIsEnabled((previousState) => true); setUserPrivacy(true); } - } + }; useEffect(() => { - getUser(); + /*getUser(); getPrivacy(); if (userPrivacy === true) { setIsEnabled(true); - } - else { + } else { setIsEnabled(false); } - },[nav]); + }, [nav]); async function getUser() { const Username = await getCurrentAuthenticatedUser(); @@ -91,24 +86,24 @@ export function SettingsScreen({ navigation }) { setUserPrivacy(Privacy); console.log("got"); } - +*/ return (
- deleteOldCache()}> + {/* + ""}> Delete old cache - - Toggle privacy - + Toggle privacy + */} ); }