diff --git a/app.json b/app.json
index a6f8699..7554977 100644
--- a/app.json
+++ b/app.json
@@ -19,14 +19,14 @@
},
"android": {
"package": "com.aaronshade.bueboka",
- "versionCode": 11,
+ "versionCode": 12,
"adaptiveIcon": {
"foregroundImage": "./assets/images/icon.png",
"backgroundColor": "#FFFFFF"
}
},
"ios": {
- "buildNumber": "1.8.0",
+ "buildNumber": "1.9.0",
"bundleIdentifier": "com.aaronshade.bueboka",
"infoPlist": {
"CFBundleIconName": "./assets/images/ipad.png"
diff --git a/app/(tabs)/siktemerker/components/ConfirmRemoveMarks.tsx b/app/(tabs)/siktemerker/components/ConfirmRemoveMarks.tsx
new file mode 100644
index 0000000..1763a02
--- /dev/null
+++ b/app/(tabs)/siktemerker/components/ConfirmRemoveMarks.tsx
@@ -0,0 +1,58 @@
+import { Modal, StyleSheet, Text, View } from 'react-native';
+import { Button } from '../../../../components/common';
+import { CalculatedMarks } from '../../../../types';
+import { storeLocalStorage } from '../../../../utils';
+
+interface Props {
+ modalVisible: boolean;
+ setBallistics: (ballistics: CalculatedMarks | null) => void;
+ closeModal: () => void;
+}
+
+const ConfirmRemoveMarks = ({ modalVisible, setBallistics, closeModal }: Props) => {
+ function handleRemoveMarks() {
+ storeLocalStorage(null, 'ballistics').then(() => {
+ setBallistics(null);
+ closeModal();
+ });
+ }
+
+ return (
+
+
+ Bekreft fjerning av siktemerker
+
+
+
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ modal: {
+ marginTop: 'auto',
+ marginBottom: '40%',
+ marginLeft: 'auto',
+ marginRight: 'auto',
+ height: 160,
+ width: '80%',
+ justifyContent: 'space-around',
+ alignItems: 'center',
+ shadowColor: 'black',
+ shadowOpacity: 0.25,
+ shadowRadius: 8,
+ shadowOffset: { width: 0, height: 2 },
+ elevation: 5,
+ borderRadius: 8,
+ backgroundColor: 'white',
+ },
+ buttons: {
+ width: '100%',
+ flexDirection: 'row',
+ justifyContent: 'space-around',
+ },
+});
+
+export default ConfirmRemoveMarks;
diff --git a/app/(tabs)/siktemerker/components/MarksForm.tsx b/app/(tabs)/siktemerker/components/MarksForm.tsx
index bd4f231..90d5183 100644
--- a/app/(tabs)/siktemerker/components/MarksForm.tsx
+++ b/app/(tabs)/siktemerker/components/MarksForm.tsx
@@ -4,7 +4,7 @@ import { Keyboard, StyleSheet, View } from 'react-native';
import { Button, Input } from '../../../../components/common';
import { MarkValue } from '../../../../types';
import { formatNumber } from '../../../../utils';
-import { useCalcForm } from '../useCalcForm';
+import { useCalcForm } from './useCalcForm';
interface MarksFormProps {
status: string;
diff --git a/app/(tabs)/siktemerker/components/MarksTable.tsx b/app/(tabs)/siktemerker/components/MarksTable.tsx
index 31af6ec..e7e3049 100644
--- a/app/(tabs)/siktemerker/components/MarksTable.tsx
+++ b/app/(tabs)/siktemerker/components/MarksTable.tsx
@@ -1,6 +1,7 @@
import { faTrash } from '@fortawesome/free-solid-svg-icons/faTrash';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
import { StyleSheet, Text, View } from 'react-native';
+
import Button from '../../../../components/common/Button';
import { CalculatedMarks } from '../../../../types';
@@ -33,7 +34,7 @@ export default function MarksTable({ ballistics, removeMark }: CalculationTableP
return (
- Avstand
+ Avstand
Merke
Beregnet
@@ -75,7 +76,7 @@ const styles = StyleSheet.create({
marginBottom: 8,
},
info: {
- marginTop: 8,
+ margin: 8,
fontSize: 16,
},
});
diff --git a/app/(tabs)/siktemerker/components/SetModal.tsx b/app/(tabs)/siktemerker/components/SetModal.tsx
new file mode 100644
index 0000000..92b2ec6
--- /dev/null
+++ b/app/(tabs)/siktemerker/components/SetModal.tsx
@@ -0,0 +1,75 @@
+import { useState } from 'react';
+import { Modal, View } from 'react-native';
+import { Button, Input } from '../../../../components/common';
+import { CalculatedMarks, MarkSet } from '../../../../types';
+import { getLocalStorage, storeLocalStorage } from '../../../../utils';
+
+interface Props {
+ modalVisible: boolean;
+ closeModal: () => void;
+ setBallistics: (ballistics: CalculatedMarks | null) => void;
+ ballistics: CalculatedMarks | null;
+}
+
+const SetModal = ({ modalVisible, closeModal, setBallistics, ballistics }: Props) => {
+ const [name, setName] = useState('');
+ const [nameError, setNameError] = useState('');
+
+ async function storeMarksWithName(name: string) {
+ if (ballistics) {
+ const setList = await getLocalStorage>('marksSets');
+
+ const marksSet = {
+ name: name,
+ marks: ballistics.given_marks,
+ distances: ballistics.given_distances,
+ };
+
+ if (setList) {
+ const nameExists = setList.some((set) => set.name === name);
+ if (nameExists) {
+ setNameError('Name is already taken');
+ } else {
+ setList.push(marksSet);
+ storeLocalStorage(setList, 'marksSets');
+ setBallistics(null);
+ setNameError('');
+ setName('');
+ closeModal();
+ }
+ } else {
+ const marksSets = Array();
+ marksSets.push(marksSet);
+ storeLocalStorage(marksSets, 'marksSets');
+ setBallistics(null);
+ setName('');
+ setNameError('');
+ closeModal();
+ }
+ }
+ }
+
+ const handleSave = async () => {
+ await storeMarksWithName(name);
+ };
+
+ return (
+
+
+ 0}
+ errorMessage={nameError}
+ onChangeText={setName}
+ value={name}
+ />
+
+
+
+
+
+
+ );
+};
+
+export default SetModal;
diff --git a/app/(tabs)/siktemerker/components/index.ts b/app/(tabs)/siktemerker/components/index.ts
new file mode 100644
index 0000000..b35dd26
--- /dev/null
+++ b/app/(tabs)/siktemerker/components/index.ts
@@ -0,0 +1,5 @@
+export { default as ConfirmRemoveMarks } from './ConfirmRemoveMarks';
+export { default as MarksForm } from './MarksForm';
+export { default as MarksTable } from './MarksTable';
+export { default as SetModal } from './SetModal';
+export { useCalcForm } from './useCalcForm';
diff --git a/app/(tabs)/siktemerker/useCalcForm.ts b/app/(tabs)/siktemerker/components/useCalcForm.ts
similarity index 100%
rename from app/(tabs)/siktemerker/useCalcForm.ts
rename to app/(tabs)/siktemerker/components/useCalcForm.ts
diff --git a/app/(tabs)/siktemerker/index.tsx b/app/(tabs)/siktemerker/index.tsx
index a013fec..e6184ce 100644
--- a/app/(tabs)/siktemerker/index.tsx
+++ b/app/(tabs)/siktemerker/index.tsx
@@ -1,13 +1,15 @@
-import * as Sentry from '@sentry/react-native';
+import { captureException } from '@sentry/react-native';
import { useEffect, useState } from 'react';
import { Keyboard, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
+import { Button } from '../../../components/common';
import { AimDistanceMark, CalculatedMarks, MarkValue } from '../../../types';
import { Ballistics, getLocalStorage, storeLocalStorage, useBallisticsParams } from '../../../utils/';
-import MarksForm from './components/MarksForm';
-import MarksTable from './components/MarksTable';
+import { ConfirmRemoveMarks, MarksForm, MarksTable, SetModal } from './components';
export default function Calculate() {
+ const [modalVisible, setModalVisible] = useState(false);
+ const [conformationModalVisible, setConformationModalVisible] = useState(false);
const [ballistics, setBallistics] = useState(null);
const { error, status, calculateBallisticsParams } = useBallisticsParams();
@@ -19,6 +21,14 @@ export default function Calculate() {
});
}, []);
+ const openModal = () => {
+ setModalVisible(true);
+ };
+
+ const closeModal = () => {
+ setModalVisible(false);
+ };
+
async function sendMarks(newMark: MarkValue) {
const body: AimDistanceMark = {
...Ballistics,
@@ -40,7 +50,7 @@ export default function Calculate() {
});
}
} catch (error) {
- Sentry.captureException(error);
+ captureException(error);
}
}
@@ -55,12 +65,25 @@ export default function Calculate() {
Siktemerker
- {error && (
- <>
- Oisann, noe gikk galt. Prøv igjen senere.
- >
- )}
+ {error && Oisann, noe gikk galt. Prøv igjen!}
+ {ballistics && ballistics.given_marks.length > 0 && (
+
+
+ )}
+
+ setConformationModalVisible(false)}
+ />
);
diff --git a/app/index.tsx b/app/index.tsx
index a45e1e2..c89906c 100644
--- a/app/index.tsx
+++ b/app/index.tsx
@@ -6,6 +6,7 @@ Sentry.init({
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
enableInExpoDevelopment: true,
debug: false,
+ environment: process.env.EXPO_PUBLIC_SENTRY_ENVIRONMENT,
});
const Index = () => {
diff --git a/components/common/Button.test.tsx b/components/common/Button.test.tsx
index c0ef4da..94fbb2b 100644
--- a/components/common/Button.test.tsx
+++ b/components/common/Button.test.tsx
@@ -30,6 +30,6 @@ describe('Button', () => {
test('renders a button with the correct text color when type is outline', () => {
const { getByText } = render();
- expect(getByText('Click me!').props.style[1].color).toBe('blue');
+ expect(getByText('Click me!').props.style[1].color).toBe('#0066b2');
});
});
diff --git a/components/common/Button.tsx b/components/common/Button.tsx
index a724be9..3d61de9 100644
--- a/components/common/Button.tsx
+++ b/components/common/Button.tsx
@@ -23,8 +23,8 @@ const Button: React.FC = ({
loading = false,
...props
}) => {
- const buttonColor = type === 'outline' ? 'transparent' : 'blue';
- const textColor = type === 'outline' ? 'blue' : 'white';
+ const buttonColor = type === 'outline' ? 'transparent' : '#0066b2';
+ const textColor = type === 'outline' ? '#0066b2' : 'white';
return (
= ({
justifyContent: 'center',
alignItems: 'center',
width: width,
+ borderColor: buttonColor,
+ borderWidth: type === 'outline' ? 1 : 0,
paddingVertical: 12,
paddingHorizontal: 24,
- borderRadius: 4,
+ borderRadius: 32,
height: 48,
},
buttonStyle,
diff --git a/components/common/Input.tsx b/components/common/Input.tsx
index 4aa7616..9700d2d 100644
--- a/components/common/Input.tsx
+++ b/components/common/Input.tsx
@@ -15,7 +15,7 @@ const Input = ({ label, error, errorMessage, placeholderText, ...props }: InputP
const textInputColor = editableTextInputColor;
const styles = StyleSheet.create({
- container: { marginBottom: 16, height: 54, marginRight: 8 },
+ container: { marginBottom: 16, height: 54, marginRight: 8, width: '100%' },
label: { color: textInputColor, fontWeight: '500', fontSize: 16, marginBottom: 4 },
input: {
backgroundColor: '#FFF',
diff --git a/jestSetup.ts b/jestSetup.ts
new file mode 100644
index 0000000..9bb3e67
--- /dev/null
+++ b/jestSetup.ts
@@ -0,0 +1,4 @@
+jest.mock('@react-native-async-storage/async-storage', () =>
+ require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
+);
+jest.mock('@sentry/react-native', () => ({ init: () => jest.fn() }));
diff --git a/metro.config.js b/metro.config.js
new file mode 100644
index 0000000..6d04fee
--- /dev/null
+++ b/metro.config.js
@@ -0,0 +1,8 @@
+// eslint-disable-next-line prettier/prettier
+const { getDefaultConfig } = require('expo/metro-config');
+
+const config = getDefaultConfig(__dirname);
+
+config.resolver.blockList = [/(.*.test.ts?)$/];
+
+module.exports = config;
diff --git a/package-lock.json b/package-lock.json
index 427a999..bed6a32 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,7 +14,7 @@
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-native-fontawesome": "^0.3.0",
"@react-native-async-storage/async-storage": "1.18.2",
- "@sentry/react-native": "5.5.0",
+ "@sentry/react-native": "5.10.0",
"@testing-library/react-native": "^12.3.1",
"axios": "^1.6.0",
"expo": "^49.0.18",
@@ -39,7 +39,7 @@
"react-native-screens": "~3.22.1",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6",
- "sentry-expo": "~7.0.0"
+ "sentry-expo": "~7.1.0"
},
"devDependencies": {
"@babel/core": "^7.23.2",
@@ -6543,49 +6543,39 @@
}
},
"node_modules/@sentry-internal/tracing": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.52.0.tgz",
- "integrity": "sha512-o1YPcRGtC9tjeFCvWRJsbgK94zpExhzfxWaldAKvi3PuWEmPeewSdO/Q5pBIY1QonvSI+Q3gysLRcVlLYHhO5A==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.69.0.tgz",
+ "integrity": "sha512-4BgeWZUj9MO6IgfO93C9ocP3+AdngqujF/+zB2rFdUe+y9S6koDyUC7jr9Knds/0Ta72N/0D6PwhgSCpHK8s0Q==",
"dependencies": {
- "@sentry/core": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
- "tslib": "^1.9.3"
+ "@sentry/core": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry-internal/tracing/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/browser": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.52.0.tgz",
- "integrity": "sha512-Sib0T24cQCqqqAhg+nZdfI7qNYGE03jiM3RbY7yG5UoycdnJzWEwrBVSzRTgg3Uya9TRTEGJ+d9vxPIU5TL7TA==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.69.0.tgz",
+ "integrity": "sha512-5ls+zu2PrMhHCIIhclKQsWX5u6WH0Ez5/GgrCMZTtZ1d70ukGSRUvpZG9qGf5Cw1ezS1LY+1HCc3whf8x8lyPw==",
"dependencies": {
- "@sentry-internal/tracing": "7.52.0",
- "@sentry/core": "7.52.0",
- "@sentry/replay": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
- "tslib": "^1.9.3"
+ "@sentry-internal/tracing": "7.69.0",
+ "@sentry/core": "7.69.0",
+ "@sentry/replay": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry/browser/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/cli": {
- "version": "2.17.5",
- "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.17.5.tgz",
- "integrity": "sha512-0tXjLDpaKB46851EMJ6NbP0o9/gdEaDSLAyjEtXxlVO6+RyhUj6x6jDwn0vis8n/7q0AvbIjAcJrot+TbZP+WQ==",
+ "version": "2.20.7",
+ "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.20.7.tgz",
+ "integrity": "sha512-YaHKEUdsFt59nD8yLvuEGCOZ3/ArirL8GZ/66RkZ8wcD2wbpzOFbzo08Kz4te/Eo3OD5/RdW+1dPaOBgGbrXlA==",
"hasInstallScript": true,
"dependencies": {
"https-proxy-agent": "^5.0.0",
@@ -6602,71 +6592,56 @@
}
},
"node_modules/@sentry/core": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.52.0.tgz",
- "integrity": "sha512-BWdG6vCMeUeMhF4ILpxXTmw70JJvT1MGJcnv09oSupWHTmqy6I19YP6YcEyFuBL4jXPN51eCl7luIdLGJrPbOg==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.69.0.tgz",
+ "integrity": "sha512-V6jvK2lS8bhqZDMFUtvwe2XvNstFQf5A+2LMKCNBOV/NN6eSAAd6THwEpginabjet9dHsNRmMk7WNKvrUfQhZw==",
"dependencies": {
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
- "tslib": "^1.9.3"
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry/core/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/hub": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.52.0.tgz",
- "integrity": "sha512-w3d8Pmp3Fx2zbbjz6hAeIbsFEkLyrUs9YTGG2y8oCoTlAtGK+AjdG+Z0H/clAZONflD/je2EmFHCI0EuXE9tEw==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.69.0.tgz",
+ "integrity": "sha512-71TQ7P5de9+cdW1ETGI9wgi2VNqfyWaM3cnUvheXaSjPRBrr6mhwoaSjo+GGsiwx97Ob9DESZEIhdzcLupzkFA==",
"dependencies": {
- "@sentry/core": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
- "tslib": "^1.9.3"
+ "@sentry/core": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry/hub/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/integrations": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.52.0.tgz",
- "integrity": "sha512-tqxYzgc71XdFD8MTCsVMCPef08lPY9jULE5Zi7TzjyV2AItDRJPkixG0qjwjOGwCtN/6KKz0lGPGYU8ZDxvsbg==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.69.0.tgz",
+ "integrity": "sha512-FEFtFqXuCo9+L7bENZxFpEAlIODwHl6FyW/DwLfniy9jOXHU7BhP/oICLrFE5J7rh1gNY7N/8VlaiQr3hCnS/g==",
"dependencies": {
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
"localforage": "^1.8.1",
- "tslib": "^1.9.3"
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry/integrations/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/react": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.52.0.tgz",
- "integrity": "sha512-VQxquyFFlvB81k7UER7tTJxjzbczNI2jqsw6nN1TVDrAIDt8/hT2x7m/M0FlWc88roBKuaMmbvzfNGWaL9abyQ==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.69.0.tgz",
+ "integrity": "sha512-J+DciRRVuruf1nMmBOi2VeJkOLGeCb4vTOFmHzWTvRJNByZ0flyo8E/fyROL7+23kBq1YbcVY6IloUlH73hneQ==",
"dependencies": {
- "@sentry/browser": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0",
+ "@sentry/browser": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0",
"hoist-non-react-statics": "^3.3.2",
- "tslib": "^1.9.3"
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
@@ -6676,67 +6651,57 @@
}
},
"node_modules/@sentry/react-native": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-5.5.0.tgz",
- "integrity": "sha512-xrES+OAIu3HFhoQSuJjd16Hh02/mByuNoKUjF7e4WDGIiTew3aqlqeLjU7x4npmg5Vbt+ND5jR12u/NmdfArwg==",
- "dependencies": {
- "@sentry/browser": "7.52.0",
- "@sentry/cli": "2.17.5",
- "@sentry/core": "7.52.0",
- "@sentry/hub": "7.52.0",
- "@sentry/integrations": "7.52.0",
- "@sentry/react": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0"
+ "version": "5.10.0",
+ "resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-5.10.0.tgz",
+ "integrity": "sha512-YuEZJ3tW5qZlFGFm2FoAZ9vw1fWnjrhMh1IHxo+nUHP3FvVgGkAd/PmSSbgPr2T3YLOIJNiyDdG031Qi7YvtGA==",
+ "dependencies": {
+ "@sentry/browser": "7.69.0",
+ "@sentry/cli": "2.20.7",
+ "@sentry/core": "7.69.0",
+ "@sentry/hub": "7.69.0",
+ "@sentry/integrations": "7.69.0",
+ "@sentry/react": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0"
},
"peerDependencies": {
"react": ">=17.0.0",
"react-native": ">=0.65.0"
}
},
- "node_modules/@sentry/react/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sentry/replay": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.52.0.tgz",
- "integrity": "sha512-RRPALjDST2s7MHiMcUJ7Wo4WW7EWfUDYSG0LuhMT8DNc+ZsxQoFsLYX/yz8b3f0IUSr7xKBXP+aPeIy3jDAS2g==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.69.0.tgz",
+ "integrity": "sha512-oUqWyBPFUgShdVvgJtV65EQH9pVDmoYVQMOu59JI6FHVeL3ald7R5Mvz6GaNLXsirvvhp0yAkcAd2hc5Xi6hDw==",
"dependencies": {
- "@sentry/core": "7.52.0",
- "@sentry/types": "7.52.0",
- "@sentry/utils": "7.52.0"
+ "@sentry/core": "7.69.0",
+ "@sentry/types": "7.69.0",
+ "@sentry/utils": "7.69.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@sentry/types": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.52.0.tgz",
- "integrity": "sha512-XnEWpS6P6UdP1FqbmeqhI96Iowqd2jM5R7zJ97txTdAd5NmdHHH0pODTR9NiQViA1WlsXDut7ZLxgPzC9vIcMA==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.69.0.tgz",
+ "integrity": "sha512-zPyCox0mzitzU6SIa1KIbNoJAInYDdUpdiA+PoUmMn2hFMH1llGU/cS7f4w/mAsssTlbtlBi72RMnWUCy578bw==",
"engines": {
"node": ">=8"
}
},
"node_modules/@sentry/utils": {
- "version": "7.52.0",
- "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.52.0.tgz",
- "integrity": "sha512-X1NHYuqW0qpZfP731YcVe+cn36wJdAeBHPYPIkXCl4o4GePCJfH/CM/+9V9cZykNjyLrs2Xy/TavSAHNCj8j7w==",
+ "version": "7.69.0",
+ "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.69.0.tgz",
+ "integrity": "sha512-4eBixe5Y+0EGVU95R4NxH3jkkjtkE4/CmSZD4In8SCkWGSauogePtq6hyiLsZuP1QHdpPb9Kt0+zYiBb2LouBA==",
"dependencies": {
- "@sentry/types": "7.52.0",
- "tslib": "^1.9.3"
+ "@sentry/types": "7.69.0",
+ "tslib": "^2.4.1 || ^1.9.3"
},
"engines": {
"node": ">=8"
}
},
- "node_modules/@sentry/utils/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/@sideway/address": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",
@@ -18309,15 +18274,15 @@
}
},
"node_modules/sentry-expo": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/sentry-expo/-/sentry-expo-7.0.1.tgz",
- "integrity": "sha512-8vmOy4R+qM1peQA9EP8rDGUMBhgMU1D5FyuWY9kfNGatmWuvEmlZpVgaXoXaNPIhPgf2TMrvQIlbqLHtTkoeSA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/sentry-expo/-/sentry-expo-7.1.1.tgz",
+ "integrity": "sha512-6vxiOKPepblVz12LqJRQu5BQdg0culbHq9y41wguanxwg3KphEzH000S5rUHQ0qdayBAxWYDpbzstQNz+uaf3g==",
"dependencies": {
"@expo/spawn-async": "^1.7.0",
- "@sentry/integrations": "7.52.1",
- "@sentry/react": "7.52.1",
- "@sentry/react-native": "5.5.0",
- "@sentry/types": "7.52.1",
+ "@sentry/integrations": "7.69.0",
+ "@sentry/react": "7.69.0",
+ "@sentry/react-native": "5.10.0",
+ "@sentry/types": "7.69.0",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2"
},
@@ -18339,114 +18304,6 @@
"node": ">=12"
}
},
- "node_modules/sentry-expo/node_modules/@sentry-internal/tracing": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.52.1.tgz",
- "integrity": "sha512-6N99rE+Ek0LgbqSzI/XpsKSLUyJjQ9nychViy+MP60p1x+hllukfTsDbNtUNrPlW0Bx+vqUrWKkAqmTFad94TQ==",
- "dependencies": {
- "@sentry/core": "7.52.1",
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/browser": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.52.1.tgz",
- "integrity": "sha512-HrCOfieX68t+Wj42VIkraLYwx8kN5311SdBkHccevWs2Y2dZU7R9iLbI87+nb5kpOPQ7jVWW7d6QI/yZmliYgQ==",
- "dependencies": {
- "@sentry-internal/tracing": "7.52.1",
- "@sentry/core": "7.52.1",
- "@sentry/replay": "7.52.1",
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/core": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.52.1.tgz",
- "integrity": "sha512-36clugQu5z/9jrit1gzI7KfKbAUimjRab39JeR0mJ6pMuKLTTK7PhbpUAD4AQBs9qVeXN2c7h9SVZiSA0UDvkg==",
- "dependencies": {
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/integrations": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.52.1.tgz",
- "integrity": "sha512-4uejF01723wzEHjcP5AcNcV+Z/6U27b1LyaDu0jY3XDry98MMjhS/ASzecLpaEFxi3dh/jMTUrNp1u7WMj59Lg==",
- "dependencies": {
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1",
- "localforage": "^1.8.1",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/react": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.52.1.tgz",
- "integrity": "sha512-RRH+GJE5TNg5QS86bSjSZuR2snpBTOO5/SU9t4BOqZMknzhMVTClGMm84hffJa9pMPMJPQ2fWQAbhrlD8RcF6w==",
- "dependencies": {
- "@sentry/browser": "7.52.1",
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1",
- "hoist-non-react-statics": "^3.3.2",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- },
- "peerDependencies": {
- "react": "15.x || 16.x || 17.x || 18.x"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/replay": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.52.1.tgz",
- "integrity": "sha512-A+RaUmpU9/yBHnU3ATemc6wAvobGno0yf5R6fZYkAFoo2FCR2YG6AXxkTazymIf8v2DnLGaSDORYDPdhQClU9A==",
- "dependencies": {
- "@sentry/core": "7.52.1",
- "@sentry/types": "7.52.1",
- "@sentry/utils": "7.52.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/types": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.52.1.tgz",
- "integrity": "sha512-OMbGBPrJsw0iEXwZ2bJUYxewI1IEAU2e1aQGc0O6QW5+6hhCh+8HO8Xl4EymqwejjztuwStkl6G1qhK+Q0/Row==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sentry-expo/node_modules/@sentry/utils": {
- "version": "7.52.1",
- "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.52.1.tgz",
- "integrity": "sha512-MPt1Xu/jluulknW8CmZ2naJ53jEdtdwCBSo6fXJvOTI0SDqwIPbXDVrsnqLAhVJuIN7xbkj96nuY/VBR6S5sWg==",
- "dependencies": {
- "@sentry/types": "7.52.1",
- "tslib": "^1.9.3"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/sentry-expo/node_modules/mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
@@ -18472,11 +18329,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/sentry-expo/node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
- },
"node_modules/serialize-error": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-6.0.0.tgz",
diff --git a/package.json b/package.json
index 02e8fa7..ba76d93 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
"@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-native-fontawesome": "^0.3.0",
- "@sentry/react-native": "5.5.0",
+ "@sentry/react-native": "5.10.0",
"@testing-library/react-native": "^12.3.1",
"axios": "^1.6.0",
"expo": "^49.0.18",
@@ -37,7 +37,7 @@
"react-native-screens": "~3.22.1",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6",
- "sentry-expo": "~7.0.0",
+ "sentry-expo": "~7.1.0",
"@react-native-async-storage/async-storage": "1.18.2"
},
"devDependencies": {
@@ -64,7 +64,10 @@
"extends": "universe/native"
},
"jest": {
- "preset": "jest-expo"
+ "preset": "jest-expo",
+ "setupFiles": [
+ "./jestSetup.ts"
+ ]
},
"name": "bueboka",
"version": "1.0.0",
diff --git a/types/MarkSet.ts b/types/MarkSet.ts
new file mode 100644
index 0000000..09f6731
--- /dev/null
+++ b/types/MarkSet.ts
@@ -0,0 +1,5 @@
+export interface MarkSet {
+ name: string;
+ marks: number[];
+ distances: number[];
+}
diff --git a/types/index.ts b/types/index.ts
index d6f5b22..956b61a 100644
--- a/types/index.ts
+++ b/types/index.ts
@@ -1,5 +1,6 @@
-export type { MarkValue } from './MarkValue';
export type { AimDistanceMark } from './AimDistanceMark';
export type { CalculatedMarks } from './CalculatedMarks';
+export type { MarkSet } from './MarkSet';
+export type { MarkValue } from './MarkValue';
export type { SightMarkCalc } from './SightMarkCalc';
export { Status } from './Status';
diff --git a/utils/LocalStorage/getLocalStorage.ts b/utils/LocalStorage/getLocalStorage.ts
index f7b398f..2a87c9a 100644
--- a/utils/LocalStorage/getLocalStorage.ts
+++ b/utils/LocalStorage/getLocalStorage.ts
@@ -1,18 +1,18 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
-import * as Sentry from '@sentry/react-native';
+import { captureException } from '@sentry/react-native';
/**
* Function to retrieve data from local storage on device.
*
* @param key Key to retrieve data from local storage.
- * @returns Data stored under key.
+ * @returns Data stored under key or null if no data is stored under key.
*/
const getLocalStorage = async (key: string): Promise => {
try {
const jsonValue = await AsyncStorage.getItem(key);
return jsonValue != null ? JSON.parse(jsonValue) : null;
} catch (error) {
- Sentry.captureException(error);
+ captureException(error);
return null;
}
};