From e45382de7440fcf278e2c94f913a6d2554e92a2f Mon Sep 17 00:00:00 2001 From: jjstnlee Date: Mon, 15 Apr 2024 05:06:00 -0700 Subject: [PATCH] Created Back Button Component --- package-lock.json | 194 ++++++++------- src/app/(tabs)/_layout.tsx | 1 + src/app/(tabs)/author/index.tsx | 8 +- src/app/(tabs)/author/styles.tsx | 1 - src/app/(tabs)/genre/index.tsx | 16 +- src/app/(tabs)/genre/styles.tsx | 1 - src/app/(tabs)/settings/index.tsx | 17 +- src/app/(tabs)/settings/styles.tsx | 11 +- src/app/(tabs)/story/index.tsx | 3 + src/app/(tabs)/story/styles.ts | 2 +- src/app/auth/forgotPassword/index.tsx | 20 +- src/app/auth/forgotPassword/styles.tsx | 16 +- src/app/auth/verify/index.tsx | 86 ++++--- src/app/auth/verify/styles.tsx | 13 +- src/app/settings/index.tsx | 235 ------------------ .../AuthBackButton/AuthBackButton.tsx | 25 -- src/components/AuthBackButton/styles.ts | 19 -- src/components/BackButton/BackButton.tsx | 2 +- 18 files changed, 185 insertions(+), 485 deletions(-) delete mode 100644 src/app/settings/index.tsx delete mode 100644 src/components/AuthBackButton/AuthBackButton.tsx delete mode 100644 src/components/AuthBackButton/styles.ts diff --git a/package-lock.json b/package-lock.json index f83fb7da..d59815e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,12 +102,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -151,13 +151,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.4.tgz", + "integrity": "sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==", "dependencies": { - "@babel/types": "^7.22.15", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -460,22 +460,23 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", + "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -2001,19 +2002,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", - "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", - "debug": "^4.1.0", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -2021,9 +2022,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -3269,9 +3270,9 @@ } }, "node_modules/@expo/metro-runtime": { - "version": "2.2.10", - "resolved": "https://registry.npmjs.org/@expo/metro-runtime/-/metro-runtime-2.2.10.tgz", - "integrity": "sha512-4lEHpOpm7FFwnNsD985eZFtcf32WakD8wSGZmfqc/bkBks076PUb5qIfTgJviGEHF9OAuic+htQi/IcbEdBr9w==", + "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" @@ -4109,13 +4110,13 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -4130,9 +4131,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } @@ -4152,9 +4153,9 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -7274,12 +7275,11 @@ } }, "node_modules/@types/react": { - "version": "18.2.22", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.22.tgz", - "integrity": "sha512-60fLTOLqzarLED2O3UQImc/lsNRgG0jE/a1mPW9KjMemY0LMITWEsbS4VvZ4p6rorEHd5YKxxmMKSDK505GHpA==", + "version": "18.2.78", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.78.tgz", + "integrity": "sha512-qOwdPnnitQY4xKlKayt42q5W5UQrSHjgoXNVEtxeqdITJ99k4VXJOP3vt8Rkm9HmgJpH50UNU+rlqfkfWOqp0A==", "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, @@ -7327,11 +7327,6 @@ "@types/react": "*" } }, - "node_modules/@types/scheduler": { - "version": "0.16.3", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", - "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" - }, "node_modules/@types/semver": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", @@ -8104,11 +8099,11 @@ } }, "node_modules/axios": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", - "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -10319,13 +10314,14 @@ } }, "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "hasInstallScript": true, "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" }, "engines": { @@ -10962,6 +10958,25 @@ "node": ">= 8" } }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esniff/node_modules/type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -11040,6 +11055,15 @@ "node": ">= 0.6" } }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -11162,9 +11186,9 @@ } }, "node_modules/expo-head": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/expo-head/-/expo-head-0.0.14.tgz", - "integrity": "sha512-NvG6dwzi06F2hlYuz1rW/O8B/Us/2lDHTHZv0DJJmSWjAuT3Ja04WtS0QI9Yn5n0bSKKPrEGl4515q1zJ9MI0A==", + "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" }, @@ -11317,17 +11341,17 @@ } }, "node_modules/expo-router": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-2.0.8.tgz", - "integrity": "sha512-hKm15AzEmqASgts1qf1UQzjB4ON6iXrV+KsHVicK7L3lb2rLpI6Cj5ayWjjUAQ7GmTw5O2FR/gdlPYil4hALIQ==", + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-2.0.15.tgz", + "integrity": "sha512-6TZKWG6nVne5kGjTPOInAEsSmWy2K4DxXp96OoNUXKoRbJYIZyB++0VQRhXcUCGQSXZRfUa0z2ud8CusF+axNA==", "dependencies": { "@bacons/react-views": "^1.1.3", - "@expo/metro-runtime": "2.2.10", + "@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.14", + "expo-head": "0.0.20", "expo-splash-screen": "~0.20.2", "query-string": "7.1.3", "react-helmet-async": "^1.3.0", @@ -11337,10 +11361,6 @@ "peerDependencies": { "@react-navigation/drawer": "^6.5.8", "expo": "^49.0.0", - "expo-constants": "*", - "expo-linking": "*", - "expo-status-bar": "*", - "metro": "~0.76.7", "react-native-gesture-handler": "*", "react-native-reanimated": "*", "react-native-safe-area-context": "*", @@ -11691,9 +11711,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -16691,9 +16711,9 @@ } }, "node_modules/react-devtools-core": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.0.tgz", - "integrity": "sha512-E3C3X1skWBdBzwpOUbmXG8SgH6BtsluSMe+s6rRcujNKG1DGi8uIfhdhszkgDpAsMoE55hwqRUzeXCmETDBpTg==", + "version": "4.28.5", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-4.28.5.tgz", + "integrity": "sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==", "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" @@ -18562,16 +18582,16 @@ "integrity": "sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==" }, "node_modules/supabase": { - "version": "1.110.1", - "resolved": "https://registry.npmjs.org/supabase/-/supabase-1.110.1.tgz", - "integrity": "sha512-pQVfbs/n8ZBDuSDv6YJKIH1Uh/QBRxjp6pLW52YkKgjgfwndlKwKuJoPiuWDxBkRG1QXxmCHi3Hk+JeNx9/FRg==", + "version": "1.157.2", + "resolved": "https://registry.npmjs.org/supabase/-/supabase-1.157.2.tgz", + "integrity": "sha512-vmmNNJX7f/gNpCXagdcaPgiKINl2/0IeZSyXd2Jgqal2UlQpeZ5vo6fTzBjZHPZwhKkJecsGoyCxbEKdHPE/yQ==", "dev": true, "hasInstallScript": true, "dependencies": { - "bin-links": "^4.0.1", + "bin-links": "^4.0.3", "https-proxy-agent": "^7.0.2", - "node-fetch": "^3.2.10", - "tar": "6.2.0" + "node-fetch": "^3.3.2", + "tar": "6.2.1" }, "bin": { "supabase": "bin/supabase" @@ -18693,9 +18713,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", diff --git a/src/app/(tabs)/_layout.tsx b/src/app/(tabs)/_layout.tsx index de7b449d..eb7592c6 100644 --- a/src/app/(tabs)/_layout.tsx +++ b/src/app/(tabs)/_layout.tsx @@ -34,6 +34,7 @@ function TabNav() { return ( (); @@ -52,14 +52,14 @@ function AuthorScreen() { return ( {isLoading ? ( ) : ( router.back()} /> @@ -138,7 +138,7 @@ function AuthorScreen() { ))} {/* View so there's space between the tab bar and the stories */} - + )} diff --git a/src/app/(tabs)/author/styles.tsx b/src/app/(tabs)/author/styles.tsx index 213b9e7b..dee04f89 100644 --- a/src/app/(tabs)/author/styles.tsx +++ b/src/app/(tabs)/author/styles.tsx @@ -4,7 +4,6 @@ import colors from '../../../styles/colors'; const styles = StyleSheet.create({ authorCardContainer: { - marginTop: 16, marginBottom: 8, flexDirection: 'row', justifyContent: 'flex-start', diff --git a/src/app/(tabs)/genre/index.tsx b/src/app/(tabs)/genre/index.tsx index 025680e5..81126585 100644 --- a/src/app/(tabs)/genre/index.tsx +++ b/src/app/(tabs)/genre/index.tsx @@ -14,11 +14,11 @@ import { SafeAreaView } from 'react-native-safe-area-context'; import styles from './styles'; import BackButton from '../../../components/BackButton/BackButton'; +import PreviewCard from '../../../components/PreviewCard/PreviewCard'; import { fetchGenreStoryById } from '../../../queries/genres'; import { fetchStoryPreviewByIds } from '../../../queries/stories'; import { StoryPreview, GenreStories } from '../../../queries/types'; import globalStyles from '../../../styles/globalStyles'; -import PreviewCard from '../../../components/PreviewCard/PreviewCard'; function GenreScreen() { const [genreStoryData, setGenreStoryData] = useState(); @@ -47,13 +47,13 @@ function GenreScreen() { useEffect(() => { const checkTopic = (preview: StoryPreview): boolean => { - if (preview == null || preview.topic == null) return false; + if (preview?.topic == null) return false; if (selectedTopicsForFiltering.length == 0) return true; else return selectedTopicsForFiltering.every(t => preview.topic.includes(t)); }; const checkTone = (preview: StoryPreview): boolean => { - if (preview == null || preview.tone == null) return false; + if (preview?.tone == null) return false; if (selectedTonesForFiltering.length == 0) return true; else return selectedTonesForFiltering.every(t => preview.tone.includes(t)); @@ -202,7 +202,7 @@ function GenreScreen() { const renderGenreHeading = () => { return ( - + {selectedSubgenre === 'All' ? mainGenre : selectedSubgenre} {/* */} @@ -296,13 +296,7 @@ function GenreScreen() { > - - router.push({ - pathname: '/search', - }) - } - /> + router.back()} /> {useMemo(renderGenreHeading, [selectedSubgenre, mainGenre])} {useMemo(renderGenreScrollSelector, [subgenres, selectedSubgenre])} diff --git a/src/app/(tabs)/genre/styles.tsx b/src/app/(tabs)/genre/styles.tsx index 1869ac12..8d69590b 100644 --- a/src/app/(tabs)/genre/styles.tsx +++ b/src/app/(tabs)/genre/styles.tsx @@ -10,7 +10,6 @@ const styles = StyleSheet.create({ container: { paddingHorizontal: 24, width: '100%', - marginTop: 24, flex: 1, }, diff --git a/src/app/(tabs)/settings/index.tsx b/src/app/(tabs)/settings/index.tsx index 0434bc6e..5bbc0009 100644 --- a/src/app/(tabs)/settings/index.tsx +++ b/src/app/(tabs)/settings/index.tsx @@ -8,19 +8,20 @@ import { Pressable, Appearance, } from 'react-native'; +import { Icon } from 'react-native-elements'; import { ScrollView } from 'react-native-gesture-handler'; +import DateTimePickerModal from 'react-native-modal-datetime-picker'; import { SafeAreaView } from 'react-native-safe-area-context'; -import { Icon } from 'react-native-elements'; import styles from './styles'; -import colors from '../../../styles/colors'; import AccountDataDisplay from '../../../components/AccountDataDisplay/AccountDataDisplay'; +import BackButton from '../../../components/BackButton/BackButton'; import StyledButton from '../../../components/StyledButton/StyledButton'; import UserSelectorInput from '../../../components/UserSelectorInput/UserSelectorInput'; +import colors from '../../../styles/colors'; import globalStyles from '../../../styles/globalStyles'; import { useSession } from '../../../utils/AuthContext'; import supabase from '../../../utils/supabase'; -import DateTimePickerModal from 'react-native-modal-datetime-picker'; function SettingsScreen() { const { session, signOut } = useSession(); @@ -180,16 +181,12 @@ function SettingsScreen() { edges={['right', 'left', 'top', 'bottom']} > - - - {' - + router.back()} /> + /> diff --git a/src/app/(tabs)/settings/styles.tsx b/src/app/(tabs)/settings/styles.tsx index cded918b..f9476b36 100644 --- a/src/app/(tabs)/settings/styles.tsx +++ b/src/app/(tabs)/settings/styles.tsx @@ -1,4 +1,5 @@ import { StyleSheet } from 'react-native'; + import colors from '../../../styles/colors'; export default StyleSheet.create({ @@ -27,16 +28,6 @@ export default StyleSheet.create({ heading: { paddingBottom: 20, }, - back: { - paddingTop: 30, - paddingBottom: 16, - color: '#797979', - fontSize: 12, - fontWeight: '400', - }, - backText: { - color: colors.darkGrey, - }, staticData: { flexDirection: 'row', flexWrap: 'wrap', diff --git a/src/app/(tabs)/story/index.tsx b/src/app/(tabs)/story/index.tsx index 2387f2f1..3829e698 100644 --- a/src/app/(tabs)/story/index.tsx +++ b/src/app/(tabs)/story/index.tsx @@ -16,6 +16,7 @@ import { RenderHTML } from 'react-native-render-html'; import { SafeAreaView } from 'react-native-safe-area-context'; import styles from './styles'; +import BackButton from '../../../components/BackButton/BackButton'; import { fetchStory } from '../../../queries/stories'; import { Story } from '../../../queries/types'; import colors from '../../../styles/colors'; @@ -74,6 +75,8 @@ function StoryScreen() { ref={scrollRef} showsVerticalScrollIndicator={false} > + router.back()} /> + {story?.title} - - {' - + + router.back()} /> @@ -106,7 +106,7 @@ function ForgotPasswordScreen() { /> - + ); } diff --git a/src/app/auth/forgotPassword/styles.tsx b/src/app/auth/forgotPassword/styles.tsx index c6ccb6b3..83889bff 100644 --- a/src/app/auth/forgotPassword/styles.tsx +++ b/src/app/auth/forgotPassword/styles.tsx @@ -1,12 +1,11 @@ import { StyleSheet } from 'react-native'; + import colors from '../../../styles/colors'; export default StyleSheet.create({ container: { flex: 1, - paddingVertical: 32, - paddingLeft: 30, - paddingRight: 30, + marginHorizontal: 42, }, heading: { paddingBottom: 8, @@ -14,7 +13,6 @@ export default StyleSheet.create({ body: { flex: 1, justifyContent: 'space-between', - paddingHorizontal: 12, }, button: { paddingBottom: 40, @@ -23,14 +21,4 @@ export default StyleSheet.create({ paddingVertical: 18, color: colors.darkGrey, }, - back: { - paddingTop: 30, - paddingBottom: 16, - color: colors.darkGrey, - fontSize: 12, - fontWeight: '400', - }, - backText: { - color: colors.darkGrey, - }, }); diff --git a/src/app/auth/verify/index.tsx b/src/app/auth/verify/index.tsx index e0b81ecb..a9b128ae 100644 --- a/src/app/auth/verify/index.tsx +++ b/src/app/auth/verify/index.tsx @@ -1,16 +1,16 @@ import { Link, Redirect, router, useLocalSearchParams } from 'expo-router'; import { useState, useRef, useEffect } from 'react'; import { View, Text } from 'react-native'; +import { Icon } from 'react-native-elements'; import OTPTextInput from 'react-native-otp-textinput'; import { SafeAreaView } from 'react-native-safe-area-context'; +import Toast, { BaseToast, BaseToastProps } from 'react-native-toast-message'; import styles from './styles'; +import BackButton from '../../../components/BackButton/BackButton'; import colors from '../../../styles/colors'; import globalStyles from '../../../styles/globalStyles'; import { useSession } from '../../../utils/AuthContext'; -import Toast, { BaseToast, BaseToastProps } from 'react-native-toast-message'; -import { Icon } from 'react-native-elements'; -import AuthBackButton from '../../../components/AuthBackButton/AuthBackButton'; function VerificationScreen() { const { user, verifyOtp, resendVerification } = useSession(); @@ -87,50 +87,48 @@ function VerificationScreen() { return ( - router.back()} /> - - - - Enter Verification Code{' '} + router.back()} /> + + + Enter Verification Code{' '} + + + + We have sent the verification code to {renderBlurredEmail()} + + + + + + Didn't receive a code? + + Resend Code - - - We have sent the verification code to {renderBlurredEmail()} - - - - - - Didn't receive a code? - - Resend Code + + {errorMessage && ( + + {showX && x} + + {errorMessage} - {errorMessage && ( - - {showX && x} - - {errorMessage} - - - )} - + )} ); } diff --git a/src/app/auth/verify/styles.tsx b/src/app/auth/verify/styles.tsx index 2204f3d4..4ca7af1c 100644 --- a/src/app/auth/verify/styles.tsx +++ b/src/app/auth/verify/styles.tsx @@ -4,16 +4,12 @@ import colors from '../../../styles/colors'; import globalStyles from '../../../styles/globalStyles'; export default StyleSheet.create({ - marginHorizontal: { - marginHorizontal: 38, - }, errorContainer: { paddingTop: 12, flexDirection: 'row', }, title: { lineHeight: 32, - paddingTop: 16, }, sent: { paddingTop: 20, @@ -40,14 +36,7 @@ export default StyleSheet.create({ }, container: { justifyContent: 'flex-start', - marginHorizontal: 0, - }, - back: { - paddingTop: 30, - paddingLeft: 22, - color: '#797979', - fontSize: 12, - fontWeight: '400', + marginHorizontal: 42, }, resendButton: { marginLeft: 8, diff --git a/src/app/settings/index.tsx b/src/app/settings/index.tsx deleted file mode 100644 index f32983ab..00000000 --- a/src/app/settings/index.tsx +++ /dev/null @@ -1,235 +0,0 @@ -import DateTimePicker from '@react-native-community/datetimepicker'; -import { Redirect, router, Link } from 'expo-router'; -import { useEffect, useState } from 'react'; -import { Text, View, Alert, Platform } from 'react-native'; -import { Button } from 'react-native-elements'; -import { ScrollView } from 'react-native-gesture-handler'; -import { SafeAreaView } from 'react-native-safe-area-context'; - -import styles from './styles'; -import AccountDataDisplay from '../../components/AccountDataDisplay/AccountDataDisplay'; -import StyledButton from '../../components/StyledButton/StyledButton'; -import UserSelectorInput from '../../components/UserSelectorInput/UserSelectorInput'; -import globalStyles from '../../styles/globalStyles'; -import { useSession } from '../../utils/AuthContext'; -import supabase from '../../utils/supabase'; -import BackButton from '../../components/BackButton/BackButton'; - -function SettingsScreen() { - const { session, signOut } = useSession(); - const [loading, setLoading] = useState(true); - const [firstName, setFirstName] = useState(''); - const [username, setUsername] = useState(''); - const [lastName, setLastName] = useState(''); - const [pronouns, setPronouns] = useState(''); - const [birthday, setBirthday] = useState(new Date()); - const [gender, setGender] = useState(''); - const [raceEthnicity, setRaceEthnicity] = useState(''); - - const [showSaveEdits, setShowSaveEdits] = useState(false); - const [showDatePicker, setShowDatePicker] = useState(Platform.OS === 'ios'); - - const wrapInDetectChange = (onChange: (_: any) => any) => { - return (value: any) => { - setShowSaveEdits(true); - return onChange(value); - }; - }; - - const getProfile = async () => { - try { - setLoading(true); - if (!session?.user) throw new Error('No user on the session!'); - - const { data, error, status } = await supabase - .from('profiles') - .select( - `first_name, last_name, username, birthday, gender, race_ethnicity`, - ) - .eq('user_id', session?.user.id) - .single(); - - if (error && status !== 406 && error instanceof Error) { - throw error; - } - - if (data) { - setFirstName(data.first_name || firstName); - setLastName(data.last_name || lastName); - setUsername(data.username || username); - - if (data.birthday) { - setBirthday(new Date(data.birthday)); - setShowDatePicker(false); - } else { - setShowDatePicker(true); - } - - setGender(data.gender || gender); - // setPronouns(data.pronouns || pronouns); - setRaceEthnicity(data.race_ethnicity || raceEthnicity); - } - } catch (error) { - if (error instanceof Error) { - Alert.alert(`Get profile error: ${error.message}`); - } - } finally { - setLoading(false); - } - }; - - const resetAndPushToRouter = (path: string) => { - while (router.canGoBack()) { - router.back(); - } - router.replace(path); - }; - - useEffect(() => { - if (session) getProfile(); - }, [session]); - - useEffect(() => { - if (!session) resetAndPushToRouter('/auth/login'); - }, [session]); - - const updateProfile = async () => { - try { - setLoading(true); - if (!session?.user) throw new Error('No user on the session!'); - - // Only update values that are not blank - const updates = { - ...(firstName && { first_name: firstName }), - ...(lastName && { last_name: lastName }), - ...(gender && { gender }), - ...(pronouns && { pronouns }), - ...(raceEthnicity && { race_ethnicity: raceEthnicity }), - ...(birthday && { birthday }), - }; - - // Check if user exists - const { count } = await supabase - .from('profiles') - .select(`*`, { count: 'exact' }) - .eq('user_id', session?.user.id); - - if (count && count >= 1) { - // Update user if they exist - const { error } = await supabase - .from('profiles') - .update(updates) - .eq('user_id', session?.user.id) - .select('*'); - - if (error && error instanceof Error) throw error; - } else { - // Create user if they don't exist - const { error } = await supabase.from('profiles').insert(updates); - - if (error && error instanceof Error) throw error; - } - } catch (error) { - if (error instanceof Error) { - Alert.alert(error.message); - } - } finally { - setLoading(false); - setShowSaveEdits(false); - } - }; - - if (!session) { - return ; - } - - return ( - - router.back()} /> - - - - Settings - Account - - - - - - - { - setShowDatePicker(Platform.OS === 'ios'); - if (date.nativeEvent.timestamp) { - setBirthday(new Date(date.nativeEvent.timestamp)); - } - }} - /> - {Platform.OS !== 'ios' && ( -