From 6ff5650d35e23ab318a9d7b6011f262833d7c765 Mon Sep 17 00:00:00 2001 From: Quinten Date: Sat, 4 Jun 2022 19:43:47 +0200 Subject: [PATCH 01/10] Helpscreen refactor --- package.json | 1 + src/screens/HelpScreen.tsx | 125 +++++++++++++++++++++++++++++-------- yarn.lock | 46 +++++++++++++- 3 files changed, 143 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 7983ad9..bc8a0b6 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@react-native-async-storage/async-storage": "^1.17.4", "@react-native-community/hooks": "^2.8.1", "@react-native-community/netinfo": "^8.3.0", + "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.8", "@react-navigation/native-stack": "^6.5.2", "@types/react-native-vector-icons": "^6.4.10", diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 7f06010..f092dd9 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -1,9 +1,48 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { Image, Linking, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; -import MasterContainer from '../components/generic/MasterContainer'; +import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import FONTS from '../assets/fonts'; import COLORS from '../assets/colors'; import ACC_STRS from '../assets/accessibilityStrings'; +import { NavigationContainer, useFocusEffect } from '@react-navigation/native'; +import ParticipantCode from '../data/localStorage/ParticipantCode'; + +const HelpScreen = () => { + const [hasCode, setHasCode] = useState(false); + + useFocusEffect( + React.useCallback(() => { + checkParticipantCodeAvailable(); + }, []) + ); + + const checkParticipantCodeAvailable = async () => { + const code = await ParticipantCode.loadCurrentParticipantCodeFromLocalStorage(); + if (!code) setHasCode(false); + else setHasCode(true); + }; + + // if code entered, show tab screen. + if (hasCode) { + return ( + + + ({ + headerShown: false, + headerStatusBarHeight: 0, + })} > + + + + + + ); + } else { + return AccessibilityScreen(); + } + +}; + const createText = () => { return data.map((element, index) => { @@ -28,9 +67,10 @@ const phoneCall = () => { Linking.openURL(phoneNumber); }; -const HelpScreen = () => { + +function AccessibilityScreen() { return ( - + { {ACC_STRS.contactExtraInfo} - + ); -}; +} + +function OptionalCompanyHelp() { + return ( + + + + {ACC_STRS.contactTitle} + {/*Creating text elements based on data*/} + + {createText()} + + + + { + Linking.openURL(`mailto: ${ACC_STRS.contactEmail}`); + }} + > + + {ACC_STRS.contactSendEmail} + + + + + + {ACC_STRS.contactCallPhone} + + + + + ); +} + +const Tab = createBottomTabNavigator(); + const styles = StyleSheet.create({ + main:{ + flex: 1, + }, + tabScreen: { + flex: 1, + }, logo: { width: '100%', height: 100, resizeMode: 'contain', + marginTop: 0, }, h1: { fontFamily: FONTS.semiBold, @@ -105,7 +196,7 @@ const styles = StyleSheet.create({ }, contactInfo: { position: 'relative', - left: -30, + left: -20, backgroundColor: COLORS.gray, paddingLeft: 10, padding: 20, @@ -143,10 +234,6 @@ const styles = StyleSheet.create({ }); const data = [ - // { - // text: ACC_STRS.contactSubtitle, - // style: styles.contactTitle, - // }, { text: ACC_STRS.contactStreet, style: styles.contactText, @@ -155,22 +242,6 @@ const data = [ text: `${ACC_STRS.contactPostalCode} ${ACC_STRS.contactCity}`, style: styles.contactText, }, - // { - // text: ACC_STRS.phone, - // style: styles.contactTitle, - // }, - // { - // text: ACC_STRS.contactPhone, - // style: styles.contactText, - // }, - // { - // text: ACC_STRS.email, - // style: styles.contactTitle, - // }, - // { - // text: ACC_STRS.contactEmail, - // style: styles.contactText, - // }, ]; export default HelpScreen; diff --git a/yarn.lock b/yarn.lock index d3caa08..dbed596 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1544,6 +1544,15 @@ resolved "https://registry.npmjs.org/@react-native/polyfills/-/polyfills-2.0.0.tgz" integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ== +"@react-navigation/bottom-tabs@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.3.1.tgz#1552ccdb789b6c9fc05af0877f8f3a50ab28870c" + integrity sha512-sL9F4WMhhR6I9bE7bpsPVHnK1cN9doaFHAuy5YmD+Sw6OyO0TAmNgQFx4xZWqboA5ZwSkN0tWcRCr6wGXaRRag== + dependencies: + "@react-navigation/elements" "^1.3.3" + color "^3.1.3" + warn-once "^0.1.0" + "@react-navigation/core@^6.1.1": version "6.1.1" resolved "https://registry.npmjs.org/@react-navigation/core/-/core-6.1.1.tgz" @@ -1560,6 +1569,11 @@ resolved "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.1.tgz" integrity sha512-jIDRJaG8YPIinl4hZXJu/W3TnhDe8hLYmGSEdL1mxZ1aoNMiApCBYkgTy11oq0EfK/koZd3DPSkJNbzBAQmPJw== +"@react-navigation/elements@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.3.tgz#9f56b650a9a1a8263a271628be7342c8121d1788" + integrity sha512-Lv2lR7si5gNME8dRsqz57d54m4FJtrwHRjNQLOyQO546ZxO+g864cSvoLC6hQedQU0+IJnPTsZiEI2hHqfpEpw== + "@react-navigation/native-stack@^6.5.2": version "6.5.2" resolved "https://registry.npmjs.org/@react-navigation/native-stack/-/native-stack-6.5.2.tgz" @@ -2651,7 +2665,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0: +color-convert@^1.9.0, color-convert@^1.9.3: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -2670,11 +2684,27 @@ color-name@1.1.3: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-name@~1.1.4: +color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-string@^1.6.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" + integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== + dependencies: + color-name "^1.0.0" + simple-swizzle "^0.2.2" + +color@^3.1.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" + integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== + dependencies: + color-convert "^1.9.3" + color-string "^1.6.0" + colorette@^1.0.7: version "1.4.0" resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz" @@ -4034,6 +4064,11 @@ is-arrayish@^0.2.1: resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= +is-arrayish@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" @@ -6733,6 +6768,13 @@ simple-plist@^1.0.0: bplist-parser "0.3.1" plist "^3.0.5" +simple-swizzle@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= + dependencies: + is-arrayish "^0.3.1" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" From 5cbd736b20bd187319671efcbe85bdafc8494d79 Mon Sep 17 00:00:00 2001 From: Quinten Date: Mon, 6 Jun 2022 19:00:52 +0200 Subject: [PATCH 02/10] Loading and component ready --- App.tsx | 2 +- package.json | 2 + src/assets/animations/loading.json | 1 + src/components/question/QuestionList.tsx | 1 + src/components/utility/FetchQuestionnaire.tsx | 2 + src/data/localStorage/ParticipantCode.ts | 13 ++- src/data/localStorage/Queue.ts | 4 + src/screens/HelpScreen.tsx | 97 +++++++++---------- src/screens/HomeScreen.tsx | 3 + yarn.lock | 27 +++++- 10 files changed, 100 insertions(+), 52 deletions(-) create mode 100644 src/assets/animations/loading.json diff --git a/App.tsx b/App.tsx index d7ff6bb..17b25b7 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter']); +LogBox.ignoreLogs(['new NativeEventEmitter', "Possible Unhandled Promise Rejection"]); const Stack = createNativeStackNavigator(); diff --git a/package.json b/package.json index bc8a0b6..fdcfb46 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,13 @@ "@react-navigation/native-stack": "^6.5.2", "@types/react-native-vector-icons": "^6.4.10", "axios": "^0.26.1", + "lottie-react-native": "^5.1.3", "react": "17.0.2", "react-native": "0.67.3", "react-native-audio-recorder-player": "^3.4.0", "react-native-bootsplash": "^4.1.5", "react-native-config": "^1.4.5", + "react-native-fade-loading": "^0.1.3", "react-native-fast-image": "^8.5.11", "react-native-image-modal": "^2.0.4", "react-native-image-picker": "^4.7.3", diff --git a/src/assets/animations/loading.json b/src/assets/animations/loading.json new file mode 100644 index 0000000..225cb90 --- /dev/null +++ b/src/assets/animations/loading.json @@ -0,0 +1 @@ +{"v":"5.8.1","fr":30,"ip":0,"op":60,"w":300,"h":300,"nm":"loading_6","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[360]}],"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.22745098039215686,0.6627450980392157,0.8627450980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":60,"s":[99]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[1]},{"t":50,"s":[100]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[3]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":30,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.6666666666666666,0.8431372549019608,0.9215686274509803,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/src/components/question/QuestionList.tsx b/src/components/question/QuestionList.tsx index c021bb8..e7f1688 100644 --- a/src/components/question/QuestionList.tsx +++ b/src/components/question/QuestionList.tsx @@ -12,6 +12,7 @@ const QuestionList = (props: { questions: Question[] }) => { const questions: Question[] = props.questions; const navigation = useNavigation(); const isFocused = useIsFocused(); + return ( <> {questions?.length === 0 && ( diff --git a/src/components/utility/FetchQuestionnaire.tsx b/src/components/utility/FetchQuestionnaire.tsx index b085dfc..df28af0 100644 --- a/src/components/utility/FetchQuestionnaire.tsx +++ b/src/components/utility/FetchQuestionnaire.tsx @@ -18,6 +18,8 @@ export async function fetchQuestionnaire(code: string, navigation: any) { name: questionnaire.title, }), ]); + + await ParticipantCode.setCurrentQuestionaire(questionnaire.title); // @ts-ignore next-line navigation.navigate('Questionnaire', { title: questionnaire.title, diff --git a/src/data/localStorage/ParticipantCode.ts b/src/data/localStorage/ParticipantCode.ts index b3fd1f3..fc18a7d 100644 --- a/src/data/localStorage/ParticipantCode.ts +++ b/src/data/localStorage/ParticipantCode.ts @@ -1,4 +1,5 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; +import { Questionnaire } from '../../models/Questionnaire'; export interface QuestionnaireDisplay { code: string; @@ -6,12 +7,22 @@ export interface QuestionnaireDisplay { } class ParticipantCode { + public static async saveCurrentParticipantCodeToLocalStorage(code: string) { await AsyncStorage.setItem('ParticipantCode', code); } public static async loadCurrentParticipantCodeFromLocalStorage() { - return await AsyncStorage.getItem('ParticipantCode'); + return AsyncStorage.getItem('ParticipantCode'); + } + + public static async setCurrentQuestionaire(title: string){ + await AsyncStorage.setItem('CurrentQuestionaire', title); + } + + public static async getCurrentQuestionaireExtraData(){ + let q = await AsyncStorage.getItem('CurrentQuestionaire'); + return typeof q === 'string' ? JSON.parse(q) : null; // TODO refactor for just HELP } private static questionnaireExists(questionnaires: QuestionnaireDisplay[], code: string) { diff --git a/src/data/localStorage/Queue.ts b/src/data/localStorage/Queue.ts index 885041c..b184731 100644 --- a/src/data/localStorage/Queue.ts +++ b/src/data/localStorage/Queue.ts @@ -27,6 +27,10 @@ class TempStorage { return TempStorage.instance; } + public clearStorage() { + AsyncStorage.clear(); + } + private loadQueueFromLocalStorage() { AsyncStorage.getItem('Queue') .then((result: string | null) => { diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index f092dd9..49de4d6 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -6,43 +6,49 @@ import COLORS from '../assets/colors'; import ACC_STRS from '../assets/accessibilityStrings'; import { NavigationContainer, useFocusEffect } from '@react-navigation/native'; import ParticipantCode from '../data/localStorage/ParticipantCode'; +import LottieView from 'lottie-react-native'; +import loadingScreen from '../assets/animations/loading.json'; const HelpScreen = () => { const [hasCode, setHasCode] = useState(false); + const [loading, setLoading] = useState(false); useFocusEffect( React.useCallback(() => { - checkParticipantCodeAvailable(); - }, []) + setLoading(true); + checkParticipantCodeAvailable().then(() => { + setLoading(false); + }); + }, []), ); const checkParticipantCodeAvailable = async () => { const code = await ParticipantCode.loadCurrentParticipantCodeFromLocalStorage(); - if (!code) setHasCode(false); - else setHasCode(true); + !code ? setHasCode(false) : setHasCode(true); }; - // if code entered, show tab screen. - if (hasCode) { + const LoadingComponent = () => { return ( - - ({ - headerShown: false, - headerStatusBarHeight: 0, - })} > - - - - + ); - } else { - return AccessibilityScreen(); - } + }; -}; + const determineHelpScreen = () => { + if (!loading && hasCode) { + return TabHelp(); + } else if (!loading && !hasCode) { + return AccessibilityScreen(); + } else return LoadingComponent(); + }; + return ( + <> + {determineHelpScreen()} + + ); +}; const createText = () => { return data.map((element, index) => { @@ -54,6 +60,7 @@ const createText = () => { }); }; + // TODO fill phoneNumber based on data of specific cliënt const phoneCall = () => { let phoneNumber = ACC_STRS.contactPhone; @@ -67,6 +74,23 @@ const phoneCall = () => { Linking.openURL(phoneNumber); }; +function TabHelp() { + return ( + + + ({ + headerShown: false, + headerStatusBarHeight: 0, + })} + > + + + + + + ); +} function AccessibilityScreen() { return ( @@ -126,35 +150,8 @@ function OptionalCompanyHelp() { {ACC_STRS.contactTitle} {/*Creating text elements based on data*/} - - {createText()} - + {createText()} - - { - Linking.openURL(`mailto: ${ACC_STRS.contactEmail}`); - }} - > - - {ACC_STRS.contactSendEmail} - - - - - - {ACC_STRS.contactCallPhone} - - ); @@ -162,9 +159,11 @@ function OptionalCompanyHelp() { const Tab = createBottomTabNavigator(); - const styles = StyleSheet.create({ - main:{ + main: { + flex: 1, + }, + fadeloading: { flex: 1, }, tabScreen: { diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 341fe35..3b13e27 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -8,6 +8,7 @@ import CodeInput from '../components/questionnaire/CodeInput'; import QuestionnaireList from '../components/questionnaire/QuestionnaireList'; import ParticipantCode, { QuestionnaireDisplay } from '../data/localStorage/ParticipantCode'; import Queue from '../data/localStorage/Queue'; +import TempStorage from '../data/localStorage/Queue'; const HomeScreen = () => { const [questionnaires, setQuestionnaires] = useState([]); @@ -22,6 +23,8 @@ const HomeScreen = () => { }, []) ); + TempStorage.getInstance().clearStorage(); + const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); if (!result) return setQuestionnaires([]); diff --git a/yarn.lock b/yarn.lock index dbed596..9a1acd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2902,6 +2902,11 @@ decode-uri-component@^0.2.0: resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +dedent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.6.0.tgz#0e6da8f0ce52838ef5cec5c8f9396b0c1b64a3cb" + integrity sha512-cSfRWjXJtZQeRuZGVvDrJroCR5V2UvBNUMHsPCdNYzuAG8b9V8aAy3KUcdQrGQPXs17Y+ojbPh1aOCplg9YR9g== + deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" @@ -4033,7 +4038,7 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -invariant@^2.2.4: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -5080,6 +5085,14 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lottie-react-native@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/lottie-react-native/-/lottie-react-native-5.1.3.tgz#6f5d0867bb762cee1dfc0613845d50c73e138ddd" + integrity sha512-Ho+oM+D3if85I2EBn8c17tcg7pc880Sp/DOeNW5aWiNtlCJKX/kmlhoM19NLqjzkHEm96fTkTcTy82ZwYU3Kbg== + dependencies: + invariant "^2.2.2" + react-native-safe-modules "^1.0.3" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" @@ -6200,6 +6213,11 @@ react-native-config@^1.4.5: resolved "https://registry.npmjs.org/react-native-config/-/react-native-config-1.4.5.tgz" integrity sha512-5oiAsoW88SOYDg/0cleJ2vJDqv98FJUbFQYEnH4sdMtEn3AAT3lb7BkTGW8HO/t3Vk9VOruwxUUnO4tzuxzCsw== +react-native-fade-loading@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/react-native-fade-loading/-/react-native-fade-loading-0.1.3.tgz#2a5e9d3e5d73c68a389a03502f5a17f2107ea1c6" + integrity sha512-EIv4IRrovmLGcdMmXVczyRlfcRVythwyls9yohbqhXtc4n+V8rL9Tb0TM01PV5+opA+bot+yZn3jpv+EKqstHw== + react-native-fast-image@^8.5.11: version "8.5.11" resolved "https://registry.npmjs.org/react-native-fast-image/-/react-native-fast-image-8.5.11.tgz" @@ -6232,6 +6250,13 @@ react-native-safe-area-context@^4.2.4: resolved "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.2.4.tgz" integrity sha512-OOX+W2G4YYufvryonn6Kw6YnyT8ZThkxPHZBD04NLHaZmicUaaDVII/PZ3M5fD1o5N62+T+8K4bCS5Un2ggvkA== +react-native-safe-modules@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/react-native-safe-modules/-/react-native-safe-modules-1.0.3.tgz#f5f29bb9d09d17581193843d4173ad3054f74890" + integrity sha512-DUxti4Z+AgJ/ZsO5U7p3uSCUBko8JT8GvFlCeOXk9bMd+4qjpoDvMYpfbixXKgL88M+HwmU/KI1YFN6gsQZyBA== + dependencies: + dedent "^0.6.0" + react-native-screens@^3.13.1: version "3.13.1" resolved "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.13.1.tgz" From d52ee6a8183ff049f25dd07e803622ec50f6d52d Mon Sep 17 00:00:00 2001 From: Quinten Date: Mon, 6 Jun 2022 19:02:11 +0200 Subject: [PATCH 03/10] Removed leftovers --- App.tsx | 2 +- src/screens/HomeScreen.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/App.tsx b/App.tsx index 17b25b7..d7ff6bb 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter', "Possible Unhandled Promise Rejection"]); +LogBox.ignoreLogs(['new NativeEventEmitter']); const Stack = createNativeStackNavigator(); diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 3b13e27..9d03837 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -23,7 +23,7 @@ const HomeScreen = () => { }, []) ); - TempStorage.getInstance().clearStorage(); + const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); From 3452be9357f6903d7b35e2df4a311ddf846780a4 Mon Sep 17 00:00:00 2001 From: Quinten Date: Mon, 6 Jun 2022 20:57:33 +0200 Subject: [PATCH 04/10] Helpscreen works but is ugly --- App.tsx | 2 +- src/components/utility/FetchQuestionnaire.tsx | 2 +- src/data/localStorage/ParticipantCode.ts | 12 ++++++++--- src/models/Questionnaire.ts | 3 +++ src/screens/HelpScreen.tsx | 20 +++++++++++++++---- src/screens/HomeScreen.tsx | 2 +- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/App.tsx b/App.tsx index d7ff6bb..17b25b7 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter']); +LogBox.ignoreLogs(['new NativeEventEmitter', "Possible Unhandled Promise Rejection"]); const Stack = createNativeStackNavigator(); diff --git a/src/components/utility/FetchQuestionnaire.tsx b/src/components/utility/FetchQuestionnaire.tsx index df28af0..365771f 100644 --- a/src/components/utility/FetchQuestionnaire.tsx +++ b/src/components/utility/FetchQuestionnaire.tsx @@ -19,7 +19,7 @@ export async function fetchQuestionnaire(code: string, navigation: any) { }), ]); - await ParticipantCode.setCurrentQuestionaire(questionnaire.title); + await ParticipantCode.setCurrentQuestionaireHelp(questionnaire.help ? questionnaire.help : ''); // @ts-ignore next-line navigation.navigate('Questionnaire', { title: questionnaire.title, diff --git a/src/data/localStorage/ParticipantCode.ts b/src/data/localStorage/ParticipantCode.ts index fc18a7d..34f0b6b 100644 --- a/src/data/localStorage/ParticipantCode.ts +++ b/src/data/localStorage/ParticipantCode.ts @@ -16,13 +16,17 @@ class ParticipantCode { return AsyncStorage.getItem('ParticipantCode'); } - public static async setCurrentQuestionaire(title: string){ - await AsyncStorage.setItem('CurrentQuestionaire', title); + public static async setCurrentQuestionaireHelp(help: string) { + await AsyncStorage.setItem('CurrentQuestionaireHelp', JSON.stringify(help)); + } + + public static async getCurrentQuestionaireHelp() : Promise { + return AsyncStorage.getItem('CurrentQuestionaireHelp'); } public static async getCurrentQuestionaireExtraData(){ let q = await AsyncStorage.getItem('CurrentQuestionaire'); - return typeof q === 'string' ? JSON.parse(q) : null; // TODO refactor for just HELP + return typeof q === 'string' ? JSON.parse(q) : null; } private static questionnaireExists(questionnaires: QuestionnaireDisplay[], code: string) { @@ -50,6 +54,8 @@ class ParticipantCode { const result = await AsyncStorage.getItem('questionnaires'); return result ? JSON.parse(result) : []; } + + } export default ParticipantCode; diff --git a/src/models/Questionnaire.ts b/src/models/Questionnaire.ts index bfb6b33..d5c9d3c 100644 --- a/src/models/Questionnaire.ts +++ b/src/models/Questionnaire.ts @@ -7,6 +7,7 @@ export class Questionnaire { participantCode: string; description?: string; instructions?: string; + help?: string; teachableMachineLink?: string; sections?: Section[]; @@ -17,6 +18,7 @@ export class Questionnaire { participantCode: string, description?: string, instructions?: string, + help?: string, teachableMachineLink?: string, sections?: Section[] ) { @@ -26,6 +28,7 @@ export class Questionnaire { this.participantCode = participantCode; this.description = description; this.instructions = instructions; + this.help = help; this.teachableMachineLink = teachableMachineLink; this.sections = sections; } diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 49de4d6..6a39ebd 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -9,6 +9,8 @@ import ParticipantCode from '../data/localStorage/ParticipantCode'; import LottieView from 'lottie-react-native'; import loadingScreen from '../assets/animations/loading.json'; +let helptext = ''; + const HelpScreen = () => { const [hasCode, setHasCode] = useState(false); const [loading, setLoading] = useState(false); @@ -17,7 +19,16 @@ const HelpScreen = () => { React.useCallback(() => { setLoading(true); checkParticipantCodeAvailable().then(() => { - setLoading(false); + if (!hasCode) { + setLoading(false); + return; + } + ParticipantCode.getCurrentQuestionaireHelp().then((h) => { + if (h){ + helptext = h; + setLoading(false) + } + }); }); }, []), ); @@ -148,9 +159,10 @@ function OptionalCompanyHelp() { - {ACC_STRS.contactTitle} - {/*Creating text elements based on data*/} - {createText()} + + Hulp + {helptext} + diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 9d03837..26a5968 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -23,7 +23,7 @@ const HomeScreen = () => { }, []) ); - + TempStorage.getInstance().clearStorage(); const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); From 978d5d41dd4fbff8548365ab92e441646d4c474d Mon Sep 17 00:00:00 2001 From: Quinten Date: Mon, 6 Jun 2022 20:58:25 +0200 Subject: [PATCH 05/10] Cleanup --- App.tsx | 2 +- src/screens/HomeScreen.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/App.tsx b/App.tsx index 17b25b7..d7ff6bb 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter', "Possible Unhandled Promise Rejection"]); +LogBox.ignoreLogs(['new NativeEventEmitter']); const Stack = createNativeStackNavigator(); diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 26a5968..8c0cd5b 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -23,8 +23,6 @@ const HomeScreen = () => { }, []) ); - TempStorage.getInstance().clearStorage(); - const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); if (!result) return setQuestionnaires([]); From d8b02c6987e5c51f2ed348c7df9cdd1982e443af Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 7 Jun 2022 13:04:49 +0200 Subject: [PATCH 06/10] Save: refactor to no pcode starts --- App.tsx | 2 +- src/assets/animations/loading.json | 214 +++++++++++++++++- src/components/utility/FetchQuestionnaire.tsx | 5 +- src/data/localStorage/ParticipantCode.ts | 13 +- src/screens/HelpScreen.tsx | 116 +++++----- src/screens/HomeScreen.tsx | 2 + 6 files changed, 291 insertions(+), 61 deletions(-) diff --git a/App.tsx b/App.tsx index d7ff6bb..82d41e4 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter']); +LogBox.ignoreLogs(['new NativeEventEmitter', 'Unhandled Promise Rejection']); const Stack = createNativeStackNavigator(); diff --git a/src/assets/animations/loading.json b/src/assets/animations/loading.json index 225cb90..a39d143 100644 --- a/src/assets/animations/loading.json +++ b/src/assets/animations/loading.json @@ -1 +1,213 @@ -{"v":"5.8.1","fr":30,"ip":0,"op":60,"w":300,"h":300,"nm":"loading_6","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[360]}],"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.22745098039215686,0.6627450980392157,0.8627450980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":60,"s":[99]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[1]},{"t":50,"s":[100]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":60,"s":[3]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":30,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150.00000000000003,150.00000000000003,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[30.000000000000004,30.000000000000004,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.6666666666666666,0.8431372549019608,0.9215686274509803,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":50,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{ + "v": "5.8.1", + "fr": 30, + "ip": 0, + "op": 60, + "w": 300, + "h": 300, + "nm": "loading_6", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "Shape Layer 2", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0] + }, + { "t": 60, "s": [360] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [150.00000000000003, 150.00000000000003, 0], "ix": 2, "l": 2 }, + "a": { "a": 0, "k": [0, 0, 0], "ix": 1, "l": 2 }, + "s": { "a": 0, "k": [30.000000000000004, 30.000000000000004, 100], "ix": 6, "l": 2 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [300, 300], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.22745098039215686, 0.6627450980392157, 0.8627450980392157, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 50, "ix": 5 }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [0, 0], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tm", + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 10, + "s": [0] + }, + { "t": 60, "s": [99] } + ], + "ix": 1 + }, + "e": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 0, + "s": [1] + }, + { "t": 50, "s": [100] } + ], + "ix": 2 + }, + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0] + }, + { "t": 60, "s": [3] } + ], + "ix": 3 + }, + "m": 1, + "ix": 2, + "nm": "Trim Paths 1", + "mn": "ADBE Vector Filter - Trim", + "hd": false + } + ], + "ip": 0, + "op": 300, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "Shape Layer 1", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 30, "ix": 11 }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { "a": 0, "k": [150.00000000000003, 150.00000000000003, 0], "ix": 2, "l": 2 }, + "a": { "a": 0, "k": [0, 0, 0], "ix": 1, "l": 2 }, + "s": { "a": 0, "k": [30.000000000000004, 30.000000000000004, 100], "ix": 6, "l": 2 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [300, 300], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.6666666666666666, 0.8431372549019608, 0.9215686274509803, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 50, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [0, 0], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 300, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/components/utility/FetchQuestionnaire.tsx b/src/components/utility/FetchQuestionnaire.tsx index 365771f..51b2345 100644 --- a/src/components/utility/FetchQuestionnaire.tsx +++ b/src/components/utility/FetchQuestionnaire.tsx @@ -19,7 +19,10 @@ export async function fetchQuestionnaire(code: string, navigation: any) { }), ]); - await ParticipantCode.setCurrentQuestionaireHelp(questionnaire.help ? questionnaire.help : ''); + await ParticipantCode.setCurrentQuestionaireTitle(questionnaire.title); + await ParticipantCode.setCurrentQuestionaireHelp( + questionnaire.help ? questionnaire.help : '' + ); // @ts-ignore next-line navigation.navigate('Questionnaire', { title: questionnaire.title, diff --git a/src/data/localStorage/ParticipantCode.ts b/src/data/localStorage/ParticipantCode.ts index 34f0b6b..96046b6 100644 --- a/src/data/localStorage/ParticipantCode.ts +++ b/src/data/localStorage/ParticipantCode.ts @@ -7,7 +7,6 @@ export interface QuestionnaireDisplay { } class ParticipantCode { - public static async saveCurrentParticipantCodeToLocalStorage(code: string) { await AsyncStorage.setItem('ParticipantCode', code); } @@ -20,11 +19,19 @@ class ParticipantCode { await AsyncStorage.setItem('CurrentQuestionaireHelp', JSON.stringify(help)); } - public static async getCurrentQuestionaireHelp() : Promise { + public static async getCurrentQuestionaireHelp(): Promise { return AsyncStorage.getItem('CurrentQuestionaireHelp'); } - public static async getCurrentQuestionaireExtraData(){ + static async setCurrentQuestionaireTitle(title: string) { + await AsyncStorage.setItem('CurrentQuestionaireTitle', JSON.stringify(title)); + } + + static async getCurrentQuestionaireTitle() : Promise { + return AsyncStorage.getItem('CurrentQuestionaireTitle'); + } + + public static async getCurrentQuestionaireExtraData() { let q = await AsyncStorage.getItem('CurrentQuestionaire'); return typeof q === 'string' ? JSON.parse(q) : null; } diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 6a39ebd..2f2e58c 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Image, Linking, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { Image, Linking, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import FONTS from '../assets/fonts'; import COLORS from '../assets/colors'; @@ -9,7 +9,8 @@ import ParticipantCode from '../data/localStorage/ParticipantCode'; import LottieView from 'lottie-react-native'; import loadingScreen from '../assets/animations/loading.json'; -let helptext = ''; +let helptext: string = ""; +let customTitle: string = ""; const HelpScreen = () => { const [hasCode, setHasCode] = useState(false); @@ -20,15 +21,27 @@ const HelpScreen = () => { setLoading(true); checkParticipantCodeAvailable().then(() => { if (!hasCode) { + console.log('not hascode'); + setHasCode(false); setLoading(false); - return; + } else { + console.log('has code'); + Promise.all([ + ParticipantCode.getCurrentQuestionaireTitle().then(title => { + if (title) { + console.log(`ontvangen title: ${title}`); + customTitle = title.slice(title.indexOf('"') + 1, title.lastIndexOf('"')); + } + }), + ParticipantCode.getCurrentQuestionaireHelp().then((h) => { + if (h) { + console.log(`ontvangen help: ${h}`); + if (h == '' || h == '""') h = 'Geen helptekst beschikbaar.'; + helptext = h.slice(h.indexOf('"') + 1, h.lastIndexOf('"')); + } + }), + ]).then(() => setLoading(false)).catch(c => console.log(c)); } - ParticipantCode.getCurrentQuestionaireHelp().then((h) => { - if (h){ - helptext = h; - setLoading(false) - } - }); }); }, []), ); @@ -38,27 +51,17 @@ const HelpScreen = () => { !code ? setHasCode(false) : setHasCode(true); }; - const LoadingComponent = () => { - return ( - - - - ); - }; - const determineHelpScreen = () => { if (!loading && hasCode) { - return TabHelp(); + return HelpPage(); } else if (!loading && !hasCode) { - return AccessibilityScreen(); - } else return LoadingComponent(); + return AccessibilityScreen(true); + } else { + return LoadingComponent(); + } }; - return ( - <> - {determineHelpScreen()} - - ); + return <>{determineHelpScreen()}; }; const createText = () => { @@ -71,8 +74,6 @@ const createText = () => { }); }; - -// TODO fill phoneNumber based on data of specific cliënt const phoneCall = () => { let phoneNumber = ACC_STRS.contactPhone; @@ -85,31 +86,33 @@ const phoneCall = () => { Linking.openURL(phoneNumber); }; -function TabHelp() { +const LoadingComponent = () => { return ( - - ({ - headerShown: false, - headerStatusBarHeight: 0, - })} - > - - - - + ); +}; + +function HelpPage() { + return ( + + {OptionalCompanyHelp()} + {AccessibilityScreen(false)} + + ); } -function AccessibilityScreen() { +function AccessibilityScreen(image: boolean) { return ( - - + {image && ( + + /> + )} {ACC_STRS.contactTitle} @@ -156,16 +159,13 @@ function AccessibilityScreen() { function OptionalCompanyHelp() { return ( - - - - - Hulp - {helptext} - - + <> + + {customTitle} + {helptext} - + + ); } @@ -175,17 +175,23 @@ const styles = StyleSheet.create({ main: { flex: 1, }, - fadeloading: { - flex: 1, + empty: { + padding: 20, }, tabScreen: { flex: 1, + marginTop: 20, + paddingBottom: 20, + }, + accessibilityScreen: { + flex: 2, }, logo: { + margin: 0, + padding: 0, width: '100%', height: 100, resizeMode: 'contain', - marginTop: 0, }, h1: { fontFamily: FONTS.semiBold, diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 8c0cd5b..cf144cd 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -23,6 +23,8 @@ const HomeScreen = () => { }, []) ); + // TempStorage.getInstance().clearStorage(); + const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); if (!result) return setQuestionnaires([]); From f026c5d45ac062ee447e56b6bde454abb8f5dd6d Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 7 Jun 2022 13:12:28 +0200 Subject: [PATCH 07/10] Help works, only visuals left. --- App.tsx | 2 +- src/data/localStorage/ParticipantCode.ts | 4 +- src/screens/HelpScreen.tsx | 76 ++++++++++++------------ src/screens/HomeScreen.tsx | 2 - 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/App.tsx b/App.tsx index 82d41e4..d7ff6bb 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { navigationRef } from './src/helpers/rootNavigation'; import SectionScreen from './src/screens/SectionScreen'; import QuestionScreen from './src/screens/QuestionScreen'; import { LogBox } from 'react-native'; -LogBox.ignoreLogs(['new NativeEventEmitter', 'Unhandled Promise Rejection']); +LogBox.ignoreLogs(['new NativeEventEmitter']); const Stack = createNativeStackNavigator(); diff --git a/src/data/localStorage/ParticipantCode.ts b/src/data/localStorage/ParticipantCode.ts index 96046b6..6342b75 100644 --- a/src/data/localStorage/ParticipantCode.ts +++ b/src/data/localStorage/ParticipantCode.ts @@ -27,7 +27,7 @@ class ParticipantCode { await AsyncStorage.setItem('CurrentQuestionaireTitle', JSON.stringify(title)); } - static async getCurrentQuestionaireTitle() : Promise { + static async getCurrentQuestionaireTitle(): Promise { return AsyncStorage.getItem('CurrentQuestionaireTitle'); } @@ -61,8 +61,6 @@ class ParticipantCode { const result = await AsyncStorage.getItem('questionnaires'); return result ? JSON.parse(result) : []; } - - } export default ParticipantCode; diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 2f2e58c..923cff0 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -1,5 +1,14 @@ import React, { useEffect, useState } from 'react'; -import { Image, Linking, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { + Image, + Linking, + Platform, + ScrollView, + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import FONTS from '../assets/fonts'; import COLORS from '../assets/colors'; @@ -9,52 +18,41 @@ import ParticipantCode from '../data/localStorage/ParticipantCode'; import LottieView from 'lottie-react-native'; import loadingScreen from '../assets/animations/loading.json'; -let helptext: string = ""; -let customTitle: string = ""; +let helptext: string = ''; +let customTitle: string = ''; const HelpScreen = () => { - const [hasCode, setHasCode] = useState(false); + const [hasHelpPage, setHasHelpPage] = useState(false); const [loading, setLoading] = useState(false); useFocusEffect( React.useCallback(() => { setLoading(true); - checkParticipantCodeAvailable().then(() => { - if (!hasCode) { - console.log('not hascode'); - setHasCode(false); - setLoading(false); - } else { - console.log('has code'); - Promise.all([ - ParticipantCode.getCurrentQuestionaireTitle().then(title => { - if (title) { - console.log(`ontvangen title: ${title}`); - customTitle = title.slice(title.indexOf('"') + 1, title.lastIndexOf('"')); - } - }), - ParticipantCode.getCurrentQuestionaireHelp().then((h) => { - if (h) { - console.log(`ontvangen help: ${h}`); - if (h == '' || h == '""') h = 'Geen helptekst beschikbaar.'; - helptext = h.slice(h.indexOf('"') + 1, h.lastIndexOf('"')); - } - }), - ]).then(() => setLoading(false)).catch(c => console.log(c)); - } - }); + Promise.all([ + ParticipantCode.getCurrentQuestionaireTitle().then((title) => { + if (title) { + setHasHelpPage(true); + console.log(`ontvangen title: ${title}`); + customTitle = `Hulp bij ${title.slice(title.indexOf('"') + 1, title.lastIndexOf('"'))}`; + } + }), + ParticipantCode.getCurrentQuestionaireHelp().then((h) => { + if (h) { + console.log(`ontvangen help: ${h}`); + if (h == '' || h == '""') h = 'Geen helptekst beschikbaar.'; + helptext = h.slice(h.indexOf('"') + 1, h.lastIndexOf('"')); + } + }), + ]) + .then(() => setLoading(false)) + .catch((c) => console.log(c)); }, []), ); - const checkParticipantCodeAvailable = async () => { - const code = await ParticipantCode.loadCurrentParticipantCodeFromLocalStorage(); - !code ? setHasCode(false) : setHasCode(true); - }; - const determineHelpScreen = () => { - if (!loading && hasCode) { + if (!loading && hasHelpPage) { return HelpPage(); - } else if (!loading && !hasCode) { + } else if (!loading) { return AccessibilityScreen(true); } else { return LoadingComponent(); @@ -108,11 +106,11 @@ function AccessibilityScreen(image: boolean) { {image && ( - )} + )} {ACC_STRS.contactTitle} diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index cf144cd..8c0cd5b 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -23,8 +23,6 @@ const HomeScreen = () => { }, []) ); - // TempStorage.getInstance().clearStorage(); - const initQuestionnaires = async () => { const result = await ParticipantCode.getQuestionnairesFromLocalStorage(); if (!result) return setQuestionnaires([]); From c45486a4a92a3df6f1bb49646d7445616b3947ee Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 7 Jun 2022 13:35:38 +0200 Subject: [PATCH 08/10] Removed unused packages, yarn format. --- package.json | 1 - src/assets/accessibilityStrings.ts | 2 +- src/screens/HelpScreen.tsx | 9 +++------ src/screens/HomeScreen.tsx | 1 - 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index fdcfb46..bdff88b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@react-native-async-storage/async-storage": "^1.17.4", "@react-native-community/hooks": "^2.8.1", "@react-native-community/netinfo": "^8.3.0", - "@react-navigation/bottom-tabs": "^6.3.1", "@react-navigation/native": "^6.0.8", "@react-navigation/native-stack": "^6.5.2", "@types/react-native-vector-icons": "^6.4.10", diff --git a/src/assets/accessibilityStrings.ts b/src/assets/accessibilityStrings.ts index ae482e2..618c756 100644 --- a/src/assets/accessibilityStrings.ts +++ b/src/assets/accessibilityStrings.ts @@ -12,7 +12,7 @@ const ACCESSIBILITY_STRINGS = { helpButtonHint: 'Naar de helppagina', helpTitle: 'Helppagina', - contactTitle: 'Contactgegevens', + contactTitle: 'Contactgegevens Stichting Accessibility', contactSubtitle: 'Bezoek- en postadres', contactExtraInfo: 'Stichting Accessibility is gevestigd in het bedrijfsverzamelgebouw de Krammstate op een paar minuten lopen van Station Utrecht Overvecht.', diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 923cff0..0daf6cb 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { Image, Linking, @@ -9,11 +9,10 @@ import { TouchableOpacity, View, } from 'react-native'; -import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import FONTS from '../assets/fonts'; import COLORS from '../assets/colors'; import ACC_STRS from '../assets/accessibilityStrings'; -import { NavigationContainer, useFocusEffect } from '@react-navigation/native'; +import { useFocusEffect } from '@react-navigation/native'; import ParticipantCode from '../data/localStorage/ParticipantCode'; import LottieView from 'lottie-react-native'; import loadingScreen from '../assets/animations/loading.json'; @@ -46,7 +45,7 @@ const HelpScreen = () => { ]) .then(() => setLoading(false)) .catch((c) => console.log(c)); - }, []), + }, []) ); const determineHelpScreen = () => { @@ -167,8 +166,6 @@ function OptionalCompanyHelp() { ); } -const Tab = createBottomTabNavigator(); - const styles = StyleSheet.create({ main: { flex: 1, diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 8c0cd5b..341fe35 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -8,7 +8,6 @@ import CodeInput from '../components/questionnaire/CodeInput'; import QuestionnaireList from '../components/questionnaire/QuestionnaireList'; import ParticipantCode, { QuestionnaireDisplay } from '../data/localStorage/ParticipantCode'; import Queue from '../data/localStorage/Queue'; -import TempStorage from '../data/localStorage/Queue'; const HomeScreen = () => { const [questionnaires, setQuestionnaires] = useState([]); From fab08afab20a4046471859bc4fe5c92546c56aa5 Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 7 Jun 2022 14:00:25 +0200 Subject: [PATCH 09/10] Accessibility changes --- src/assets/accessibilityStrings.ts | 10 ++----- src/screens/HelpScreen.tsx | 17 ++++++----- yarn.lock | 46 ++---------------------------- 3 files changed, 13 insertions(+), 60 deletions(-) diff --git a/src/assets/accessibilityStrings.ts b/src/assets/accessibilityStrings.ts index 618c756..30f5984 100644 --- a/src/assets/accessibilityStrings.ts +++ b/src/assets/accessibilityStrings.ts @@ -12,10 +12,7 @@ const ACCESSIBILITY_STRINGS = { helpButtonHint: 'Naar de helppagina', helpTitle: 'Helppagina', - contactTitle: 'Contactgegevens Stichting Accessibility', contactSubtitle: 'Bezoek- en postadres', - contactExtraInfo: - 'Stichting Accessibility is gevestigd in het bedrijfsverzamelgebouw de Krammstate op een paar minuten lopen van Station Utrecht Overvecht.', contactExtraInfoLabel: 'Extra informatie voor bezoek aan Stichting Accessibility: Stichting Accessibility is gevestigd in het bedrijfsverzamelgebouw de Krammstate op een paar minuten lopen van Station Utrecht Overvecht.', contactStreet: 'Christiaan Krammlaan 2', @@ -23,11 +20,10 @@ const ACCESSIBILITY_STRINGS = { contactCity: 'Utrecht', contactPhone: '+31 30 239 82 70', contactEmail: 'info@accessibility.nl', - contactSendEmail: 'Stuur een e-mail', - contactSendEmailHint: + contactSendEmailLabel: 'Stuur een e-mail naar Stichting Accessibility via een beschikbare mail app', - contactCallPhone: 'Bellen', - contactCallPhoneHint: 'Bel naar het bedrijf', + contactCallPhoneLabel: 'Bel naar het bedrijf', + contactLogo: "Logo van Stichting Accessibility", backButton: 'Terug knop', backButtonHint: 'Terug naar', diff --git a/src/screens/HelpScreen.tsx b/src/screens/HelpScreen.tsx index 0daf6cb..5dd0da4 100644 --- a/src/screens/HelpScreen.tsx +++ b/src/screens/HelpScreen.tsx @@ -31,13 +31,11 @@ const HelpScreen = () => { ParticipantCode.getCurrentQuestionaireTitle().then((title) => { if (title) { setHasHelpPage(true); - console.log(`ontvangen title: ${title}`); customTitle = `Hulp bij ${title.slice(title.indexOf('"') + 1, title.lastIndexOf('"'))}`; } }), ParticipantCode.getCurrentQuestionaireHelp().then((h) => { if (h) { - console.log(`ontvangen help: ${h}`); if (h == '' || h == '""') h = 'Geen helptekst beschikbaar.'; helptext = h.slice(h.indexOf('"') + 1, h.lastIndexOf('"')); } @@ -105,6 +103,8 @@ function AccessibilityScreen(image: boolean) { {image && ( - {ACC_STRS.contactTitle} - {/*Creating text elements based on data*/} + Contactgegevens Stichting Accessibility {createText()} - {ACC_STRS.contactSendEmail} + Stuur een e-mail - {ACC_STRS.contactCallPhone} + Bellen @@ -147,7 +146,7 @@ function AccessibilityScreen(image: boolean) { accessibilityLabel={ACC_STRS.contactExtraInfoLabel} style={styles.contactText} > - {ACC_STRS.contactExtraInfo} + Stichting Accessibility is gevestigd in het bedrijfsverzamelgebouw de Krammstate op een paar minuten lopen van Station Utrecht Overvecht. diff --git a/yarn.lock b/yarn.lock index b7ab940..094ed78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1544,15 +1544,6 @@ resolved "https://registry.npmjs.org/@react-native/polyfills/-/polyfills-2.0.0.tgz" integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ== -"@react-navigation/bottom-tabs@^6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.3.1.tgz#1552ccdb789b6c9fc05af0877f8f3a50ab28870c" - integrity sha512-sL9F4WMhhR6I9bE7bpsPVHnK1cN9doaFHAuy5YmD+Sw6OyO0TAmNgQFx4xZWqboA5ZwSkN0tWcRCr6wGXaRRag== - dependencies: - "@react-navigation/elements" "^1.3.3" - color "^3.1.3" - warn-once "^0.1.0" - "@react-navigation/core@^6.1.1": version "6.1.1" resolved "https://registry.npmjs.org/@react-navigation/core/-/core-6.1.1.tgz" @@ -1569,11 +1560,6 @@ resolved "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.1.tgz" integrity sha512-jIDRJaG8YPIinl4hZXJu/W3TnhDe8hLYmGSEdL1mxZ1aoNMiApCBYkgTy11oq0EfK/koZd3DPSkJNbzBAQmPJw== -"@react-navigation/elements@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.3.tgz#9f56b650a9a1a8263a271628be7342c8121d1788" - integrity sha512-Lv2lR7si5gNME8dRsqz57d54m4FJtrwHRjNQLOyQO546ZxO+g864cSvoLC6hQedQU0+IJnPTsZiEI2hHqfpEpw== - "@react-navigation/native-stack@^6.5.2": version "6.5.2" resolved "https://registry.npmjs.org/@react-navigation/native-stack/-/native-stack-6.5.2.tgz" @@ -2665,7 +2651,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.3: +color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -2684,27 +2670,11 @@ color-name@1.1.3: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-name@^1.0.0, color-name@~1.1.4: +color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.6.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" - integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - -color@^3.1.3: - version "3.2.1" - resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" - integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== - dependencies: - color-convert "^1.9.3" - color-string "^1.6.0" - colorette@^1.0.7: version "1.4.0" resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz" @@ -4074,11 +4044,6 @@ is-arrayish@^0.2.1: resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" @@ -6819,13 +6784,6 @@ simple-plist@^1.0.0: bplist-parser "0.3.1" plist "^3.0.5" -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= - dependencies: - is-arrayish "^0.3.1" - sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" From 4eb34e85bf330ba239876b0eb7baf21f34975bd0 Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 7 Jun 2022 14:02:51 +0200 Subject: [PATCH 10/10] Removed unused import from particpantcode --- src/data/localStorage/ParticipantCode.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/localStorage/ParticipantCode.ts b/src/data/localStorage/ParticipantCode.ts index 6342b75..69e2693 100644 --- a/src/data/localStorage/ParticipantCode.ts +++ b/src/data/localStorage/ParticipantCode.ts @@ -1,5 +1,4 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; -import { Questionnaire } from '../../models/Questionnaire'; export interface QuestionnaireDisplay { code: string;