diff --git a/ComApp/README.md b/ComApp/README.md index 91355f7..33b19c5 100644 --- a/ComApp/README.md +++ b/ComApp/README.md @@ -2,9 +2,13 @@ ## Dependencies - i18n-js - @react-native-community/netinfo +- @react-native-community/slider - axios - lodash - expo +- expo-av +- expo-video-player +- expo-barcode-scanner - react-redux - redux - realm @@ -18,4 +22,7 @@ - react-native-b-crypt-bridge - react-native-animated-tree-view with https://github.com/shariqahmed525/react-native-animated-tree-view/pull/3/ - react-native-pdf -- react-native-blob-util \ No newline at end of file +- react-native-blob-util +- react-native-flash-message +- @react-native-picker/picker +- vcard-parser \ No newline at end of file diff --git a/ComApp/android/app/src/main/AndroidManifest.xml b/ComApp/android/app/src/main/AndroidManifest.xml index 74b5a26..f17cc14 100644 --- a/ComApp/android/app/src/main/AndroidManifest.xml +++ b/ComApp/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ package="com.comapp"> + + diff --git a/ComApp/package-lock.json b/ComApp/package-lock.json index 62e6636..a6d22cf 100644 --- a/ComApp/package-lock.json +++ b/ComApp/package-lock.json @@ -9,10 +9,17 @@ "version": "0.0.1", "dependencies": { "@react-native-community/netinfo": "^9.3.2", + "@react-native-community/slider": "^4.3.2", + "@react-native-picker/picker": "^2.4.6", "@react-navigation/native": "^6.0.13", "@react-navigation/native-stack": "^6.9.0", + "@rneui/base": "^0.0.0-edge.2", + "@rneui/themed": "^0.0.0-edge.2", "axios": "^0.27.2", "expo": "^46.0.13", + "expo-av": "^12.0.4", + "expo-barcode-scanner": "^11.4.0", + "expo-video-player": "^2.2.0", "i18n-js": "^4.1.1", "install": "^0.13.0", "lodash": "^4.17.21", @@ -22,6 +29,7 @@ "react-native-animated-tree-view": "^0.1.4", "react-native-b-crypt-bridge": "file:react-native-b-crypt-bridge-2.0.0.tgz", "react-native-blob-util": "^0.16.2", + "react-native-flash-message": "^0.3.1", "react-native-pdf": "^6.6.2", "react-native-progress": "^5.0.0", "react-native-safe-area-context": "^4.4.1", @@ -30,7 +38,8 @@ "react-native-vector-icons": "^9.2.0", "react-redux": "^8.0.4", "realm": "^11.0.0-rc.2", - "redux": "^4.2.0" + "redux": "^4.2.0", + "vcard-parser": "^1.0.0" }, "devDependencies": { "@babel/core": "^7.12.9", @@ -4070,6 +4079,23 @@ "react-native": ">=0.59" } }, + "node_modules/@react-native-community/slider": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-4.3.2.tgz", + "integrity": "sha512-pKIx+l3yFQAVMcqGsnRcJAqZbVeR69CRbW85nZHhLuR/mOT0NbKWJIAEy7MC+e84DMTw0RJnEflRQO2/j8wcxQ==", + "dependencies": { + "@types/react-test-renderer": "^18.0.0" + } + }, + "node_modules/@react-native-picker/picker": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.4.6.tgz", + "integrity": "sha512-TyrQZKwi7tbGbETxpQpaf0Jld6Fw/RRWVPAShRobTUWwUglveP71mtdLwuNJV+1NXI6PqW/OvCEk9ZmFfGj0fQ==", + "peerDependencies": { + "react": ">=16", + "react-native": ">=0.57" + } + }, "node_modules/@react-native/assets": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@react-native/assets/-/assets-1.0.0.tgz", @@ -4186,6 +4212,62 @@ "resolved": "https://registry.npmjs.org/@realm.io/common/-/common-0.1.5.tgz", "integrity": "sha512-Y+UnICLvsPFpe2WOXWIdJUaV3G2qDocN8al/Yz13mYMkjODXHL4VhyfEKR2hvcAubv+7isdegEyYNdo3zQzbFA==" }, + "node_modules/@rneui/base": { + "version": "0.0.0-edge.2", + "resolved": "https://registry.npmjs.org/@rneui/base/-/base-0.0.0-edge.2.tgz", + "integrity": "sha512-MFyiK0Kz23v5mwOUotZdD8cudREa0t9lFwb2+6MyyG1SN2I8CUyqqsZBBwUMInXbspeOtJGtWOPv61TM/2esFQ==", + "dependencies": { + "@rneui/base-edge": "github:react-native-elements/react-native-elements#base" + } + }, + "node_modules/@rneui/base-edge": { + "name": "@rneui/base", + "version": "4.0.0-rc.6", + "resolved": "git+ssh://git@github.com/react-native-elements/react-native-elements.git#9ab2c462fc905e606bc6372e8f516cdd10f12ceb", + "license": "MIT", + "dependencies": { + "@types/react-native-vector-icons": "^6.4.10", + "color": "^3.2.1", + "deepmerge": "^4.2.2", + "hoist-non-react-statics": "^3.3.2", + "react-native-ratings": "^8.1.0", + "react-native-size-matters": "^0.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/react-native-elements" + }, + "peerDependencies": { + "react-native-safe-area-context": "^3.1.9 || ^4.0.0", + "react-native-vector-icons": ">7.0.0" + } + }, + "node_modules/@rneui/base-edge/node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@rneui/themed": { + "version": "0.0.0-edge.2", + "resolved": "https://registry.npmjs.org/@rneui/themed/-/themed-0.0.0-edge.2.tgz", + "integrity": "sha512-MnsZarge+2V1//ov9jCAxkKzjS5RejZf/eRpE9tVOmvDZeEO1Q/9LIV00ZJxEHnjJHpozs5UvBkwb8KAwFL/0Q==", + "dependencies": { + "@rneui/themed-edge": "github:react-native-elements/react-native-elements#themed" + } + }, + "node_modules/@rneui/themed-edge": { + "name": "@rneui/themed", + "version": "4.0.0-rc.6", + "resolved": "git+ssh://git@github.com/react-native-elements/react-native-elements.git#c6336871730b0624a41c91267f06ad61dc7ea2ca", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/react-native-elements" + } + }, "node_modules/@segment/loosely-validate-event": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz", @@ -4383,6 +4465,31 @@ "csstype": "^3.0.2" } }, + "node_modules/@types/react-native": { + "version": "0.70.4", + "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.70.4.tgz", + "integrity": "sha512-z5tKfblHLG6jts2AQcioDw4N+F2EzflO9n495yNyqyMYRkSIVTLX64MHBeqMp5wfOY5mshy0GsOgnFSXrXKQSg==", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-native-vector-icons": { + "version": "6.4.12", + "resolved": "https://registry.npmjs.org/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.12.tgz", + "integrity": "sha512-gSXtv3NMOsRwSXJ/gvGebm7CNjHbkeFKCse9h/Pvi+x2yjCLOkJR1FBfec06DhaFJpsK7Y8WRQpwOS0eLqx5Rg==", + "dependencies": { + "@types/react": "*", + "@types/react-native": "*" + } + }, + "node_modules/@types/react-test-renderer": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-18.0.0.tgz", + "integrity": "sha512-C7/5FBJ3g3sqUahguGi03O79b8afNeSD6T8/GU50oQrJCU0bVCCGQHaGKUbg2Ce8VQEEqTw8/HiS6lXHHdgkdQ==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/scheduler": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", @@ -6267,6 +6374,15 @@ "node": ">=0.10.0" } }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -6285,6 +6401,28 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, "node_modules/colorette": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", @@ -8058,6 +8196,29 @@ "url-parse": "^1.5.9" } }, + "node_modules/expo-av": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/expo-av/-/expo-av-12.0.4.tgz", + "integrity": "sha512-wq3wx6J1aacZEPZce9TK1+o4YTAOWyb5cJ4CqfsgHcXeUdHyO3qbva/5uecigpEYlCxOlWYFhAz2T0dQ7nWSpQ==", + "dependencies": { + "@expo/config-plugins": "~5.0.0" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-barcode-scanner": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/expo-barcode-scanner/-/expo-barcode-scanner-11.4.0.tgz", + "integrity": "sha512-Q4BreQHY5U1aGF+rfqeGSzcdlayTKnSe/qTIfkXTmXFsL7bu3hMqdh5J/DL00Dfmc7C0IR8EiV75rqRrY4t0nA==", + "dependencies": { + "@expo/config-plugins": "~5.0.0", + "expo-image-loader": "~3.2.0" + }, + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-constants": { "version": "13.2.4", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-13.2.4.tgz", @@ -8120,6 +8281,14 @@ "expo": "*" } }, + "node_modules/expo-image-loader": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/expo-image-loader/-/expo-image-loader-3.2.0.tgz", + "integrity": "sha512-LU3Q2prn64/HxdToDmxgMIRXS1ZvD9Q3iCxRVTZn1fPQNNDciIQFE5okaa74Ogx20DFHs90r6WoUd7w9Af1OGQ==", + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-keep-awake": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-10.2.0.tgz", @@ -8250,6 +8419,19 @@ "invariant": "^2.2.4" } }, + "node_modules/expo-video-player": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/expo-video-player/-/expo-video-player-2.2.0.tgz", + "integrity": "sha512-DDai4zmTF265EHOagnWWA22o/xwP4FI1YVUzhTibN5vB3nLqSL9ABBI+H++I9T0p7sCRgQhgoy4whaWWcN4ZfQ==", + "dependencies": { + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@react-native-community/slider": ">=4.0.0", + "expo": ">=38.0.0", + "expo-av": ">=5.0.2" + } + }, "node_modules/expo/node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -15274,8 +15456,6 @@ }, "node_modules/npm/node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "inBundle": true, "license": "MIT", "dependencies": { @@ -16676,12 +16856,34 @@ "nullthrows": "^1.1.1" } }, + "node_modules/react-native-flash-message": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/react-native-flash-message/-/react-native-flash-message-0.3.1.tgz", + "integrity": "sha512-PswNvDdHBOavmIM7G4loLuEwML3oB8E8wVCuOPQ0Q6hRbExwTaF6gsTJvo5fQkyUsCi27ainSkL/F0ZijIkVig==", + "dependencies": { + "prop-types": "^15.8.1", + "react-native-iphone-x-helper": "^1.3.1" + }, + "peerDependencies": { + "prop-types": "^15.0 || ^16.0", + "react": "*", + "react-native": "*" + } + }, "node_modules/react-native-gradle-plugin": { "version": "0.70.3", "resolved": "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz", "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A==", "license": "MIT" }, + "node_modules/react-native-iphone-x-helper": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz", + "integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==", + "peerDependencies": { + "react-native": ">=0.42.0" + } + }, "node_modules/react-native-pdf": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/react-native-pdf/-/react-native-pdf-6.6.2.tgz", @@ -16702,6 +16904,18 @@ "react-native-svg": "*" } }, + "node_modules/react-native-ratings": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-8.1.0.tgz", + "integrity": "sha512-+QOJ4G3NjVkI1D+tk4EGx1dCvVfbD2nQdkrj9cXrcAoEiwmbep4z4bZbCKmWMpQ5h2dqbxABU8/eBnbDmvAc3g==", + "dependencies": { + "lodash": "^4.17.15" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/react-native-safe-area-context": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz", @@ -16724,6 +16938,14 @@ "react-native": "*" } }, + "node_modules/react-native-size-matters": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/react-native-size-matters/-/react-native-size-matters-0.4.0.tgz", + "integrity": "sha512-8/C0htHrFWeUm9N8JegmadovUfgTWkGBkDPZ1N3YkXtDWb+98Ya2gThiKcu445r8c7YhcrBfnHz/mYsXIusaOQ==", + "peerDependencies": { + "react-native": "*" + } + }, "node_modules/react-native-svg": { "version": "13.2.0", "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.2.0.tgz", @@ -18106,6 +18328,19 @@ "node": ">= 5.10.0" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -19731,6 +19966,11 @@ "node": ">= 0.8" } }, + "node_modules/vcard-parser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vcard-parser/-/vcard-parser-1.0.0.tgz", + "integrity": "sha512-rSEjrjBK3of4VimMR5vBjLLcN5ZCSp9yuVzyx5i4Fwx74Yd0s+DnHtSit/wAAtj1a7/T/qQc0ykwXADoD0+fTQ==" + }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -22971,6 +23211,20 @@ "integrity": "sha512-fR7wSIhmIUX+Skzgkr2vj5xopWa0lvvEWoXP1m7//jZjEgOZnu9DgdUimLHDrMo6AtZyUNrJscsFEepihTLlPQ==", "requires": {} }, + "@react-native-community/slider": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-4.3.2.tgz", + "integrity": "sha512-pKIx+l3yFQAVMcqGsnRcJAqZbVeR69CRbW85nZHhLuR/mOT0NbKWJIAEy7MC+e84DMTw0RJnEflRQO2/j8wcxQ==", + "requires": { + "@types/react-test-renderer": "^18.0.0" + } + }, + "@react-native-picker/picker": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.4.6.tgz", + "integrity": "sha512-TyrQZKwi7tbGbETxpQpaf0Jld6Fw/RRWVPAShRobTUWwUglveP71mtdLwuNJV+1NXI6PqW/OvCEk9ZmFfGj0fQ==", + "requires": {} + }, "@react-native/assets": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@react-native/assets/-/assets-1.0.0.tgz", @@ -23057,6 +23311,45 @@ "resolved": "https://registry.npmjs.org/@realm.io/common/-/common-0.1.5.tgz", "integrity": "sha512-Y+UnICLvsPFpe2WOXWIdJUaV3G2qDocN8al/Yz13mYMkjODXHL4VhyfEKR2hvcAubv+7isdegEyYNdo3zQzbFA==" }, + "@rneui/base": { + "version": "0.0.0-edge.2", + "resolved": "https://registry.npmjs.org/@rneui/base/-/base-0.0.0-edge.2.tgz", + "integrity": "sha512-MFyiK0Kz23v5mwOUotZdD8cudREa0t9lFwb2+6MyyG1SN2I8CUyqqsZBBwUMInXbspeOtJGtWOPv61TM/2esFQ==", + "requires": { + "@rneui/base-edge": "github:react-native-elements/react-native-elements#base" + } + }, + "@rneui/base-edge": { + "version": "git+ssh://git@github.com/react-native-elements/react-native-elements.git#9ab2c462fc905e606bc6372e8f516cdd10f12ceb", + "from": "@rneui/base-edge@github:react-native-elements/react-native-elements#base", + "requires": { + "@types/react-native-vector-icons": "^6.4.10", + "color": "^3.2.1", + "deepmerge": "^4.2.2", + "hoist-non-react-statics": "^3.3.2", + "react-native-ratings": "^8.1.0", + "react-native-size-matters": "^0.4.0" + }, + "dependencies": { + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + } + } + }, + "@rneui/themed": { + "version": "0.0.0-edge.2", + "resolved": "https://registry.npmjs.org/@rneui/themed/-/themed-0.0.0-edge.2.tgz", + "integrity": "sha512-MnsZarge+2V1//ov9jCAxkKzjS5RejZf/eRpE9tVOmvDZeEO1Q/9LIV00ZJxEHnjJHpozs5UvBkwb8KAwFL/0Q==", + "requires": { + "@rneui/themed-edge": "github:react-native-elements/react-native-elements#themed" + } + }, + "@rneui/themed-edge": { + "version": "git+ssh://git@github.com/react-native-elements/react-native-elements.git#c6336871730b0624a41c91267f06ad61dc7ea2ca", + "from": "@rneui/themed-edge@github:react-native-elements/react-native-elements#themed" + }, "@segment/loosely-validate-event": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz", @@ -23232,6 +23525,31 @@ "csstype": "^3.0.2" } }, + "@types/react-native": { + "version": "0.70.4", + "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.70.4.tgz", + "integrity": "sha512-z5tKfblHLG6jts2AQcioDw4N+F2EzflO9n495yNyqyMYRkSIVTLX64MHBeqMp5wfOY5mshy0GsOgnFSXrXKQSg==", + "requires": { + "@types/react": "*" + } + }, + "@types/react-native-vector-icons": { + "version": "6.4.12", + "resolved": "https://registry.npmjs.org/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.12.tgz", + "integrity": "sha512-gSXtv3NMOsRwSXJ/gvGebm7CNjHbkeFKCse9h/Pvi+x2yjCLOkJR1FBfec06DhaFJpsK7Y8WRQpwOS0eLqx5Rg==", + "requires": { + "@types/react": "*", + "@types/react-native": "*" + } + }, + "@types/react-test-renderer": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-18.0.0.tgz", + "integrity": "sha512-C7/5FBJ3g3sqUahguGi03O79b8afNeSD6T8/GU50oQrJCU0bVCCGQHaGKUbg2Ce8VQEEqTw8/HiS6lXHHdgkdQ==", + "requires": { + "@types/react": "*" + } + }, "@types/scheduler": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", @@ -24559,6 +24877,30 @@ "object-visit": "^1.0.0" } }, + "color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "requires": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + }, + "dependencies": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + } + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -24572,6 +24914,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "colorette": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", @@ -25883,6 +26234,23 @@ "url-parse": "^1.5.9" } }, + "expo-av": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/expo-av/-/expo-av-12.0.4.tgz", + "integrity": "sha512-wq3wx6J1aacZEPZce9TK1+o4YTAOWyb5cJ4CqfsgHcXeUdHyO3qbva/5uecigpEYlCxOlWYFhAz2T0dQ7nWSpQ==", + "requires": { + "@expo/config-plugins": "~5.0.0" + } + }, + "expo-barcode-scanner": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/expo-barcode-scanner/-/expo-barcode-scanner-11.4.0.tgz", + "integrity": "sha512-Q4BreQHY5U1aGF+rfqeGSzcdlayTKnSe/qTIfkXTmXFsL7bu3hMqdh5J/DL00Dfmc7C0IR8EiV75rqRrY4t0nA==", + "requires": { + "@expo/config-plugins": "~5.0.0", + "expo-image-loader": "~3.2.0" + } + }, "expo-constants": { "version": "13.2.4", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-13.2.4.tgz", @@ -25930,6 +26298,12 @@ "fontfaceobserver": "^2.1.0" } }, + "expo-image-loader": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/expo-image-loader/-/expo-image-loader-3.2.0.tgz", + "integrity": "sha512-LU3Q2prn64/HxdToDmxgMIRXS1ZvD9Q3iCxRVTZn1fPQNNDciIQFE5okaa74Ogx20DFHs90r6WoUd7w9Af1OGQ==", + "requires": {} + }, "expo-keep-awake": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-10.2.0.tgz", @@ -26022,6 +26396,14 @@ "invariant": "^2.2.4" } }, + "expo-video-player": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/expo-video-player/-/expo-video-player-2.2.0.tgz", + "integrity": "sha512-DDai4zmTF265EHOagnWWA22o/xwP4FI1YVUzhTibN5vB3nLqSL9ABBI+H++I9T0p7sCRgQhgoy4whaWWcN4ZfQ==", + "requires": { + "tslib": "^2.4.0" + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -30975,8 +31357,6 @@ }, "string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "bundled": true, "requires": { "safe-buffer": "~5.2.0" @@ -32051,11 +32431,26 @@ "nullthrows": "^1.1.1" } }, + "react-native-flash-message": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/react-native-flash-message/-/react-native-flash-message-0.3.1.tgz", + "integrity": "sha512-PswNvDdHBOavmIM7G4loLuEwML3oB8E8wVCuOPQ0Q6hRbExwTaF6gsTJvo5fQkyUsCi27ainSkL/F0ZijIkVig==", + "requires": { + "prop-types": "^15.8.1", + "react-native-iphone-x-helper": "^1.3.1" + } + }, "react-native-gradle-plugin": { "version": "0.70.3", "resolved": "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz", "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A==" }, + "react-native-iphone-x-helper": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz", + "integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==", + "requires": {} + }, "react-native-pdf": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/react-native-pdf/-/react-native-pdf-6.6.2.tgz", @@ -32073,6 +32468,14 @@ "prop-types": "^15.7.2" } }, + "react-native-ratings": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-8.1.0.tgz", + "integrity": "sha512-+QOJ4G3NjVkI1D+tk4EGx1dCvVfbD2nQdkrj9cXrcAoEiwmbep4z4bZbCKmWMpQ5h2dqbxABU8/eBnbDmvAc3g==", + "requires": { + "lodash": "^4.17.15" + } + }, "react-native-safe-area-context": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz", @@ -32088,6 +32491,12 @@ "warn-once": "^0.1.0" } }, + "react-native-size-matters": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/react-native-size-matters/-/react-native-size-matters-0.4.0.tgz", + "integrity": "sha512-8/C0htHrFWeUm9N8JegmadovUfgTWkGBkDPZ1N3YkXtDWb+98Ya2gThiKcu445r8c7YhcrBfnHz/mYsXIusaOQ==", + "requires": {} + }, "react-native-svg": { "version": "13.2.0", "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.2.0.tgz", @@ -33033,6 +33442,21 @@ } } }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + } + } + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -34221,6 +34645,11 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, + "vcard-parser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vcard-parser/-/vcard-parser-1.0.0.tgz", + "integrity": "sha512-rSEjrjBK3of4VimMR5vBjLLcN5ZCSp9yuVzyx5i4Fwx74Yd0s+DnHtSit/wAAtj1a7/T/qQc0ykwXADoD0+fTQ==" + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", diff --git a/ComApp/package.json b/ComApp/package.json index 736e6ed..bc5c2a6 100644 --- a/ComApp/package.json +++ b/ComApp/package.json @@ -11,10 +11,17 @@ }, "dependencies": { "@react-native-community/netinfo": "^9.3.2", + "@react-native-community/slider": "^4.3.2", + "@react-native-picker/picker": "^2.4.6", "@react-navigation/native": "^6.0.13", "@react-navigation/native-stack": "^6.9.0", + "@rneui/base": "^0.0.0-edge.2", + "@rneui/themed": "^0.0.0-edge.2", "axios": "^0.27.2", "expo": "^46.0.13", + "expo-av": "^12.0.4", + "expo-barcode-scanner": "^11.4.0", + "expo-video-player": "^2.2.0", "i18n-js": "^4.1.1", "install": "^0.13.0", "lodash": "^4.17.21", @@ -24,6 +31,7 @@ "react-native-animated-tree-view": "^0.1.4", "react-native-b-crypt-bridge": "file:react-native-b-crypt-bridge-2.0.0.tgz", "react-native-blob-util": "^0.16.2", + "react-native-flash-message": "^0.3.1", "react-native-pdf": "^6.6.2", "react-native-progress": "^5.0.0", "react-native-safe-area-context": "^4.4.1", @@ -32,7 +40,8 @@ "react-native-vector-icons": "^9.2.0", "react-redux": "^8.0.4", "realm": "^11.0.0-rc.2", - "redux": "^4.2.0" + "redux": "^4.2.0", + "vcard-parser": "^1.0.0" }, "devDependencies": { "@babel/core": "^7.12.9", diff --git a/ComApp/src/App.js b/ComApp/src/App.js index 142a8f2..6f26336 100644 --- a/ComApp/src/App.js +++ b/ComApp/src/App.js @@ -31,6 +31,10 @@ import LoginScreen from './App/Views/LoginScreen'; import SyncScreen from './App/Views/SyncScreen'; import DirectoriesScreen from './App/Views/DirectoriesScreen'; import PDFScreen from './App/Views/PDFScreen'; +import VideoScreen from './App/Views/VideoScreen'; +import OnlyVideosScreen from './App/Views/OnlyVideosScreen'; +import ContactScreen from './App/Views/ContactScreen'; +import ContactDetailsScreen from './App/Views/ContactDetailsScreen'; // Lang Flags import flagFR from './Resources/assets/img/flags/fr.png'; import flagEN from './Resources/assets/img/flags/en.png'; @@ -188,6 +192,47 @@ class App extends React.Component { headerTitle: () => CustomNavigation.LogoTitle('PDF') })} /> + ({ + headerTitle: () => CustomNavigation.LogoTitle(i18n.t('app.video')) + })} + /> + ({ + headerTitle: () => CustomNavigation.LogoTitle(i18n.t('global.videos')), + headerRight: () => ( + + this.setState({ searchTxt: text })} /> + { + if (this.state.searchTxt.length > 0) { + navigation.navigation.navigate('SearchScreen', { + needle: this.state.searchTxt, + onlyVideos: true, + }); + this.setState({ searchTxt: '' }); + } + }}> + + + + ), + })} + /> + CustomNavigation.LogoTitle(i18n.t('global.contacts')) }} + initialParams={{ contactAdded: false }} + /> + CustomNavigation.LogoTitle(i18n.t('app.contact_details')) }} + /> diff --git a/ComApp/src/App/Views/ContactDetailsScreen.js b/ComApp/src/App/Views/ContactDetailsScreen.js new file mode 100644 index 0000000..2331dbc --- /dev/null +++ b/ComApp/src/App/Views/ContactDetailsScreen.js @@ -0,0 +1,847 @@ +import React from 'react'; +import { + View, + Button, + TextInput, + TouchableOpacity, + Text, + Alert, + ScrollView +} from 'react-native'; +// Reduxs +import { connect } from 'react-redux'; +// Helpers +import Helpers from "../Lib/Helpers"; +// Translations +import i18n from "../../I18n"; +// Icons +import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'; +// Style +import styles from '../../Resources/Styles/ContactDetailsStyle'; +// UI Elements +import { Overlay, CheckBox, ButtonGroup } from '@rneui/themed'; +// Flash Messages +import { showMessage } from 'react-native-flash-message'; +// Picker +import { Picker } from '@react-native-picker/picker'; +// vCard parser +import vCard from 'vcard-parser'; +// BarCode Scanner +import { BarCodeScanner } from 'expo-barcode-scanner'; + +function mapStateToProps(state) { + return { + contacts: state.app.contacts, + currentUser: state.app.currentUser, + }; +} + +let date = new Date().getDate(); +if (date < 10) { + date = '0' + date.toString(); +} +let month = new Date().getMonth() + 1; +if (month < 10) { + month = '0' + month.toString(); +} +const year = new Date().getFullYear(); + +class ContactDetailsScreen extends React.Component { + state = { + action: 'add', + visits: [], + selectedVisit: 0, + tmpVisitNote: '', + newVisitTitle: date + '/' + month + '/' + year, + selectedIndex: 0, + showNewVisit: false, + tmpID: 0, + tmpNote: '', + tmpName: '', + tmpFirstname: '', + tmpEmail: '', + tmpCompany: '', + tmpAddress: '', + tmpPhone: '', + tmpSelect1: '', + tmpSelect2: '', + tmpOther: '', + clientChecked: false, + prospectChecked: false, + otherChecked: false, + p1: false, + p2: false, + p3: false, + p4: false, + p5: false, + p6: false, + p7: false, + p8: false, + p9: false, + showQRcodevCard: false, + parsedType: null, + parsedDatas: [], + hasPermission: null, + scanned: false, + showDynContact: false, + parsedName: '', + parsedFirstname: '', + parsedEmail: '', + parsedCompany: '', + parsedAddress: '', + parsedPhone: '' + }; + + updateContact() { + let error = ''; + const { action } = this.props.route.params; + // On récupère le texte courant + if (this.state.visits.length > 0) { + this.state.visits[ + this.state.selectedVisit + ].note = this.state.tmpVisitNote; + } + let type; + if (this.state.clientChecked === true) { + type = 'client'; + } else if (this.state.prospectChecked === true) { + type = 'prospect'; + } else if (this.state.otherChecked === true) { + type = 'other'; + if (this.state.tmpOther.length === 0) { + error = error.concat(i18n.t('error.fill_other_field') + '.\n'); + } + } else { + error = error.concat(i18n.t('error.specify_type_contact') + '.\n'); + } + if (this.state.tmpEmail.length < 5 || !Helpers.isEmailValid(this.state.tmpEmail)) { + error = error.concat(i18n.t('error.invalid_email_address') + '.\n'); + } + if (this.state.tmpName.length === 0) { + error = error.concat(i18n.t('error.invalid_name') + '.\n'); + } + if (this.state.tmpFirstname.length === 0) { + error = error.concat(i18n.t('error.invalid_firstname') + '.\n'); + } + + if (error.length > 0) { + Alert.alert(i18n.t('global.warning') + ' !', error, [ + { text: 'OK' }, + ], + { cancelable: false }, + ); + } else { + const products = [ + this.state.p1, + this.state.p2, + this.state.p3, + this.state.p4, + this.state.p5, + this.state.p6, + this.state.p7, + this.state.p8, + this.state.p9 + ]; + const contact = { + id: Helpers.generateUUID(), + email: this.state.tmpEmail, + type: type, + other: this.state.tmpOther, + select1: this.state.tmpSelect1, + select2: this.state.tmpSelect2, + name: this.state.tmpName, + firstname: this.state.tmpFirstname, + company: this.state.tmpCompany, + address: this.state.tmpAddress, + phone: this.state.tmpPhone, + products: JSON.stringify(products), + notes: this.state.tmpNote, + visits: JSON.stringify(this.state.visits), + to_delete: false, + synced: false, + }; + if (action === 'edit') { + contact.id = this.state.tmpID; + this.props.dispatch({ type: 'UPDATE_CONTACT', data: contact }); + this.populate(); + showMessage({ + message: i18n.t('contact_details_s.contact_saved') + '.', + type: 'success', + duration: 500, + }); + } else { + contact.user_id = this.props.currentUser.id; + this.props.dispatch({ type: 'ADD_CONTACT', data: contact }); + this.props.navigation.navigate('ContactScreen', { contactAdded: true }); + } + } + } + + updateContactType(type) { + if (type === 'client') { + this.setState({ + clientChecked: true, + prospectChecked: false, + otherChecked: false, + tmpOther: '', + }); + } else if (type === 'prospect') { + this.setState({ + clientChecked: false, + prospectChecked: true, + otherChecked: false, + tmpOther: '', + }); + } else { + this.setState({ + clientChecked: false, + prospectChecked: false, + otherChecked: true, + }); + } + } + + newVisit() { + this.state.visits.unshift({ title: this.state.newVisitTitle, note: '' }); + this.state.visits[this.state.selectedVisit].note = this.state.tmpVisitNote; + this.setState({ + tmpVisitNote: '', + visits: this.state.visits, + showNewVisit: false, + selectedVisit: 0, + }); + } + + deleteVisit() { + Alert.alert( + i18n.t('global.confirmation'), + i18n.t('contact_details_s.confirm_visit_delete'), + [ + { + text: i18n.t('global.no'), + onPress: () => console.log('Cancel Pressed'), + style: 'cancel', + }, + { + text: i18n.t('global.yes'), + onPress: () => { + this.state.visits.splice(this.state.selectedVisit, 1); + if (this.state.visits.length === 0) { + this.setState({ + visits: this.state.visits, + selectedVisit: 0, + tmpVisitNote: '', + }); + } else { + this.setState({ + visits: this.state.visits, + selectedVisit: 0, + tmpVisitNote: this.state.visits[0].note, + }); + } + }, + }, + ], + { cancelable: false }, + ); + } + + populate() { + const { contactId } = this.props.route.params; + const contact = this.props.contacts.filter(tmp => tmp.id === contactId)[0]; + this.setState({ + tmpID: contact.id, + tmpNote: contact.notes, + tmpName: contact.name, + tmpFirstname: contact.firstname, + tmpEmail: contact.email, + tmpCompany: contact.company, + tmpAddress: contact.address, + tmpPhone: contact.phone, + tmpSelect1: contact.select1, + tmpSelect2: contact.select2, + tmpOther: contact.other, + tmpProducts: contact.product, + }); + if (contact.type === 'client') { + this.setState({ clientChecked: true }); + } else if (contact.type === 'prospect') { + this.setState({ prospectChecked: true }); + } else { + this.setState({ otherChecked: true }); + } + if (contact.visits !== null) { + const tmp = JSON.parse(contact.visits); + this.setState({ visits: tmp }); + if (tmp.length > 0) { + this.setState({ tmpVisitNote: tmp[this.state.selectedVisit].note }); + } + } + if (contact.products !== null) { + const tmp = JSON.parse(contact.products); + this.setState({ + p1: tmp[0], + p2: tmp[1], + p3: tmp[2], + p4: tmp[3], + p5: tmp[4], + p6: tmp[5], + p7: tmp[6], + p8: tmp[7], + p9: tmp[8], + p10: tmp[9], + }); + } + } + + componentDidMount() { + const { action } = this.props.route.params; + if (action === 'edit') { + this.setState({ action: 'edit' }); + this.populate(); + } + + BarCodeScanner.requestPermissionsAsync().then(res => { + this.setState({ hasPermission: res.status === 'granted' }); + }); + + } + + render() { + const handleBarCodeScanned = ({ type, data }) => { + this.setState({ scanned: true }); + if (data.includes('VCARD')) { + let datas = vCard.parse(data); + let tmpDatas = []; + if (datas['n'] !== undefined) { + const nx = Object.assign({ n1: [{ value: datas['n'][0].value[0] }] }, { n2: [{ value: datas['n'][0].value[1] }] }); + datas = Object.assign(datas, nx); + } + if (datas['adr'] !== undefined) { + let tmp = datas['adr'][0].value; + let tmpadr = ''; + for (let i = 0; i < tmp.length; i++) { + if (tmp[i].length > 0) { + if (tmpadr.length > 0) { + tmpadr = tmpadr + ', ' + tmp[i]; + } else { + tmpadr = tmp[i]; + } + } + } + datas['adr'] = [{ value: tmpadr }]; + } + Object.keys(datas).map((objectKey, index) => { + if (objectKey === 'email' || objectKey === 'adr' || objectKey === 'tel' || objectKey === 'org' || objectKey === 'n1' || objectKey === 'n2') { + let value = datas[objectKey][0].value; + if (typeof value === 'string') { + tmpDatas.push(value); + } + } + }); + this.setState({ parsedType: 'vcard', parsedDatas: tmpDatas, showQRcodevCard: false, showDynContact: true }) + } else { + Alert.alert(i18n.t('contact_details_s.qrcode_not_vcard_format')); + } + }; + return ( + + + + this.updateContactType('client')} + /> + this.updateContactType('prospect')} + /> + this.updateContactType('other')} + /> + {this.state.otherChecked === true && ( + this.setState({ tmpOther: text })} + /> + )} + + + this.setState({ tmpName: text })} + /> + this.setState({ tmpFirstname: text })} + /> + + this.setState({ tmpEmail: text })} + autoCapitalize={'none'} + autoCorrect={false} + keyboardType={'email-address'} + /> + this.setState({ tmpCompany: text })} + /> + this.setState({ tmpAddress: text })} + /> + this.setState({ tmpPhone: text })} + autoCompleteType={'tel'} + dataDetectorTypes={'phoneNumber'} + keyboardType={'phone-pad'} + /> + + + + { + if (itemValue !== '0') { + this.setState({ tmpSelect1: itemValue }); + } + }}> + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + if (itemValue !== '0') { + this.setState({ tmpSelect2: itemValue }); + } + }}> + + + + + + + + + + + + + + + + + + this.setState({ p1: !this.state.p1 })} + containerStyle={styles.clearCheckbox} + /> + this.setState({ p2: !this.state.p2 })} + containerStyle={styles.clearCheckbox} + /> + this.setState({ p3: !this.state.p3 })} + containerStyle={styles.clearCheckbox} + /> + this.setState({ p4: !this.state.p4 })} + containerStyle={styles.clearCheckbox} + /> + + + + + this.setState({ selectedIndex: index })} + /> + {this.state.selectedIndex === 0 && ( + + + {this.state.visits.length > 0 && ( + + + { + this.state.visits[ + this.state.selectedVisit + ].note = this.state.tmpVisitNote; + this.setState({ + visits: this.state.visits, + selectedVisit: itemIndex, + tmpVisitNote: this.state.visits[itemIndex].note, + }); + }}> + {this.state.visits.map((item, index) => { + return ; + })} + + + )} + {this.state.visits.length === 0 && ( + + {i18n.t('contact_details_s.no_visits')}. + + )} + + this.setState({ showNewVisit: true })}> + + + {this.state.visits.length > 0 && ( + this.deleteVisit()}> + + + )} + + + {this.state.visits.length > 0 && ( + this.setState({ tmpVisitNote: text })} + /> + )} + + )} + {this.state.selectedIndex === 1 && ( + this.setState({ tmpNote: text })} + /> + )} + + + {this.state.action === 'add' && ( + <> +