diff --git a/.gitignore b/.gitignore index 9fa449d..3cc56af 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ yarn-error.log android/** ios/** + +.env.local diff --git a/App.js b/App.js index 7697b7c..2d1e278 100644 --- a/App.js +++ b/App.js @@ -1,4 +1,5 @@ import { ApolloProvider } from "@apollo/client"; +import * as Sentry from '@sentry/react-native'; import "expo-asset"; import 'expo-dev-client'; import "intl"; @@ -11,6 +12,25 @@ import { client } from "./graphql/client"; import { persistor, store } from "./redux/store"; import "./translations/i18n"; +Sentry.init({ + dsn: 'https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.us.sentry.io/5558869', + + // Adds more context data to events (IP address, cookies, user, etc.) + // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/ + sendDefaultPii: true, + + // Enable Logs + enableLogs: true, + + // Configure Session Replay + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1, + integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()], + ignoreErrors: [/.*Network Error.*/i] + // uncomment the line below to enable Spotlight (https://spotlightjs.com) + // spotlight: __DEV__, +}); + // Sentry.init({ // dsn: "https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.sentry.io/5558869", // enableInExpoDevelopment: true, @@ -39,4 +59,4 @@ const App = () => { ); } -export default App; +export default Sentry.wrap(App); \ No newline at end of file diff --git a/app.json b/app.json index 88207eb..1a75de3 100644 --- a/app.json +++ b/app.json @@ -14,7 +14,10 @@ "runtimeVersion": "appVersion", "orientation": "default", "icon": "./assets/ImEXlogo192noa.png", - "platforms": ["ios", "android"], + "platforms": [ + "ios", + "android" + ], "ios": { "supportsTablet": true, "bundleIdentifier": "com.imex.imexmobile", @@ -48,7 +51,9 @@ "fallbackToCacheTimeout": 0, "url": "https://u.expo.dev/ffe01f3a-d507-4698-82cd-da1f1cad450b" }, - "assetBundlePatterns": ["**/*"], + "assetBundlePatterns": [ + "**/*" + ], "web": { "favicon": "./assets/ImEXlogo192noa.png", "config": { @@ -89,7 +94,15 @@ "expo-localization", "expo-font", "expo-router", - "expo-notifications" + "expo-notifications", + [ + "@sentry/react-native/expo", + { + "url": "https://sentry.io/", + "project": "imexmobile", + "organization": "imex" + } + ] ] } } diff --git a/components/global-search/global-search.jsx b/components/global-search/global-search.jsx index 0de24db..0647b28 100644 --- a/components/global-search/global-search.jsx +++ b/components/global-search/global-search.jsx @@ -105,7 +105,10 @@ export default function GlobalSearch() { {!loading && ( - {results.length} results found + { + results.length - 1 //Need to subtract for the spacer. + }{" "} + results found )} diff --git a/components/jobs-list/job-list-item.jsx b/components/jobs-list/job-list-item.jsx index e6bab20..87f5fb4 100644 --- a/components/jobs-list/job-list-item.jsx +++ b/components/jobs-list/job-list-item.jsx @@ -104,7 +104,6 @@ function JobListItemComponent({ openImagePicker, item }) { const styles = StyleSheet.create({ pressable: { - // marginHorizontal: 12, marginVertical: 6, }, outerShadow: { diff --git a/components/settings/settings.jsx b/components/settings/settings.jsx index 1221748..7ff0264 100644 --- a/components/settings/settings.jsx +++ b/components/settings/settings.jsx @@ -16,7 +16,6 @@ import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { ThemeSelector } from "../theme-selector/theme-selector"; import UploadDeleteSwitch from "./upload-delete-switch"; - const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, deleteAfterUpload: selectDeleteAfterUpload, diff --git a/metro.config.js b/metro.config.js new file mode 100644 index 0000000..eddbc90 --- /dev/null +++ b/metro.config.js @@ -0,0 +1,5 @@ +const { getSentryExpoConfig } = require("@sentry/react-native/metro"); + +const config = getSentryExpoConfig(__dirname); + +module.exports = config; diff --git a/package-lock.json b/package-lock.json index abdf8d8..dda3836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@react-navigation/elements": "^2.6.5", "@react-navigation/native": "^7.1.8", "@reduxjs/toolkit": "^2.9.1", + "@sentry/react-native": "^7.4.0", "axios": "^1.12.2", "dinero.js": "^1.9.1", "expo": "54.0.21", @@ -5085,6 +5086,336 @@ "dev": true, "license": "MIT" }, + "node_modules/@sentry-internal/browser-utils": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-10.20.0.tgz", + "integrity": "sha512-9+NybrYs+dEM2iW5uRAYEhKkNK0XhDea5jovtDUXEvdSCMJFcdR88uztkftnCur45/hpvbgSULsGPUdHPb5ITw==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry-internal/feedback": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-10.20.0.tgz", + "integrity": "sha512-R/eGLKl7WDccLKBorEbyTsy5b99w/k4v80SntE8HL2rsO7DCDXma8TGmtHd+iZnw8dUci+EVrw7LbeGSgf3QzA==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry-internal/replay": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-10.20.0.tgz", + "integrity": "sha512-+XPYp0CuJnf+c36/c+hHrY6wAPHCdnqllZeyU7+9LAiKsdhN8Oo4eF1v5zd097qDZBg1NrKhU44ScJIzz+vygw==", + "license": "MIT", + "dependencies": { + "@sentry-internal/browser-utils": "10.20.0", + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry-internal/replay-canvas": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-10.20.0.tgz", + "integrity": "sha512-8DBawFi4F4e2Cu2ToiitCnYsK8idrDOv66Vq+N6c8e3qFitTTuoPQwOihb2+HY4CB06ABPW3WvfZntJJmsf91w==", + "license": "MIT", + "dependencies": { + "@sentry-internal/replay": "10.20.0", + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/babel-plugin-component-annotate": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-4.4.0.tgz", + "integrity": "sha512-Pzjpn9MZg6yR61ThJgOoD28dLNCj457O0/t8d276K+Bzf8iOZKbrNO4sltp1vUB1yqhV+ulvIZO8xu8ABohtsg==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/@sentry/browser": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-10.20.0.tgz", + "integrity": "sha512-zcf8HwFiRbzjZL9KbLev44eEOf+yl+3svQbs2BlR2KAYGaB10swV5abij0UTTGO7ClnqUZdcGpwiyyfPS6mjHg==", + "license": "MIT", + "dependencies": { + "@sentry-internal/browser-utils": "10.20.0", + "@sentry-internal/feedback": "10.20.0", + "@sentry-internal/replay": "10.20.0", + "@sentry-internal/replay-canvas": "10.20.0", + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/cli": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.56.1.tgz", + "integrity": "sha512-VDAIg+gmjNtJS5VUZQMDSK9RaKC9hYQi3PoXpNa+owNfQNk60bCi8z8jkbWRcKbNGn3V51WqvrQAqLoNAdPc9w==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@sentry/cli-darwin": "2.56.1", + "@sentry/cli-linux-arm": "2.56.1", + "@sentry/cli-linux-arm64": "2.56.1", + "@sentry/cli-linux-i686": "2.56.1", + "@sentry/cli-linux-x64": "2.56.1", + "@sentry/cli-win32-arm64": "2.56.1", + "@sentry/cli-win32-i686": "2.56.1", + "@sentry/cli-win32-x64": "2.56.1" + } + }, + "node_modules/@sentry/cli-darwin": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.56.1.tgz", + "integrity": "sha512-zfhT8MrvB5x/xRdIVGwg+sG0Cx3i0G6RH2zCrdQ/moWn8TfkwsM0O1k/AxpwbpcRfAHCkVb04CU/yKciKwg2KA==", + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.56.1.tgz", + "integrity": "sha512-fNB/Ng11HrkGOSEIDg+fc3zfTCV7q6kJddp6ndK3QlYFsCffRSnclaX1SMp+mqxdWkHqe1kkp85OY8G/x5uAWw==", + "cpu": [ + "arm" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "linux", + "freebsd", + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm64": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.56.1.tgz", + "integrity": "sha512-AypXIwZvOMJb9RgjI/98hTAd06FcOjqjIm6G9IR0OI4pJCOcaAXz9NKXdJqxpZd7phSMJnD+Bx/8iYOUPeY73A==", + "cpu": [ + "arm64" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "linux", + "freebsd", + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-i686": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.56.1.tgz", + "integrity": "sha512-vnH+WJEsUq7Lf7xc9udzE/M4hoDXXsniFFYr/7BvdnXtCQlNNaWFMXHbEDYAql3baIlHkWoG8cEHWuB/YKyniw==", + "cpu": [ + "x86", + "ia32" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "linux", + "freebsd", + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-x64": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.56.1.tgz", + "integrity": "sha512-3/BlKe5Vdnia36MeovghHJD8lbcum5TFIxLp+PSfH2sVb09+5Jo0L95oRTI2JkD8Fs+QNssvTqTxJj5eIo/n+A==", + "cpu": [ + "x64" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "linux", + "freebsd", + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-arm64": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.56.1.tgz", + "integrity": "sha512-Gg8RV7CV7Tz4fiR1EN1Af5AVhJsnEXiZvfvfQXI4lp51MKAhcxZIMtEfg9HaWsn3Dm/wgwYBinyeywfWbTXYDg==", + "cpu": [ + "arm64" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-i686": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.56.1.tgz", + "integrity": "sha512-6u6a060yC3i76Ze1apqgWr5luQSyhuD5ND84eWfh/UbddsEa42UHjoVHOiBwmpZqf/hvNZAtzLnE4NCvU4zOMg==", + "cpu": [ + "x86", + "ia32" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-x64": { + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.56.1.tgz", + "integrity": "sha512-11cdflajBrDWlRZqI9MOu7ok2vnPzFjKmbU3YvBYWQapNE+HHAsWdsRL/u/P1RmU62vj7Y42iSUcj6x1SNrdPw==", + "cpu": [ + "x64" + ], + "license": "BSD-3-Clause", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@sentry/cli/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@sentry/core": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.20.0.tgz", + "integrity": "sha512-S291KihnOIB8i7mVJIJBVHBMcCfIoY/KDJBHEfBoHY9M56g2An4FVhM9+/xR85+IoMkTySdXN08k9LEyQz4FpQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/react": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-10.20.0.tgz", + "integrity": "sha512-8W+gMkMxQhqlGHCW7kjLhcLgBJ/YSHbLhVd36s0GRudxjXh61K8rdCaAXToD8akgZ76DtLbx5PPQ5fLfQCOnpw==", + "license": "MIT", + "dependencies": { + "@sentry/browser": "10.20.0", + "@sentry/core": "10.20.0", + "hoist-non-react-statics": "^3.3.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": "^16.14.0 || 17.x || 18.x || 19.x" + } + }, + "node_modules/@sentry/react-native": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-7.4.0.tgz", + "integrity": "sha512-dDbFEO4DkDjfGlo+gQ5u1JokMMSglZerAQZbuMJO1cBCt+G/+8GZBFVXSHPk/CZLWiPBxQWP27nHhZ7Y06h5hw==", + "license": "MIT", + "dependencies": { + "@sentry/babel-plugin-component-annotate": "4.4.0", + "@sentry/browser": "10.20.0", + "@sentry/cli": "2.56.1", + "@sentry/core": "10.20.0", + "@sentry/react": "10.20.0", + "@sentry/types": "10.20.0" + }, + "bin": { + "sentry-expo-upload-sourcemaps": "scripts/expo-upload-sourcemaps.js" + }, + "peerDependencies": { + "expo": ">=49.0.0", + "react": ">=17.0.0", + "react-native": ">=0.65.0" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + } + } + }, + "node_modules/@sentry/types": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-10.20.0.tgz", + "integrity": "sha512-9pGtoiYBvw0SpHayBlQ6/9F4wP/KwlS8KZg1iBsZSR8h8WjLRGbER/TjKcAdg07HPd0APVajbT2YyL30+9Oi8Q==", + "license": "MIT", + "dependencies": { + "@sentry/core": "10.20.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", diff --git a/package.json b/package.json index 6daed54..4dc7a17 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@react-navigation/elements": "^2.6.5", "@react-navigation/native": "^7.1.8", "@reduxjs/toolkit": "^2.9.1", + "@sentry/react-native": "^7.4.0", "axios": "^1.12.2", "dinero.js": "^1.9.1", "expo": "54.0.21",