├── Handle BarCodeScanner ├── src │ ├── navigation │ │ └── Navigator.js │ └── screens │ │ ├── Results.js │ │ ├── Scanner.js │ │ ├── Maj.js │ │ └── Products.js ├── assets │ ├── 4.png │ ├── icon.png │ ├── logo.png │ ├── favicon.png │ ├── open-box.png │ ├── search.png │ ├── splash.png │ ├── switch.png │ └── adaptive-icon.png ├── babel.config.js ├── .expo-shared │ └── assets.json ├── .gitignore ├── app.json ├── package.json └── App.js └── readme.md /Handle BarCodeScanner/src/navigation/Navigator.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/4.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/icon.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/logo.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/favicon.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/open-box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/open-box.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/search.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/splash.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/switch.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saifeddineelhanoune/HandlingBarCode/HEAD/Handle BarCodeScanner/assets/adaptive-icon.png -------------------------------------------------------------------------------- /Handle BarCodeScanner/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | 13 | # macOS 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ### Feature updates : 2 | 3 | a button 'import' that could help to add a .csv file that contains a requirement to fill it into the app . 4 | 5 | custom logo of company/start-up that may help to manage products and become aproducts management application 6 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/src/screens/Results.js: -------------------------------------------------------------------------------- 1 | import { View, Text } from 'react-native' 2 | import React from 'react' 3 | 4 | const Results = () => { 5 | return ( 6 | 7 | Results 8 | 9 | ) 10 | } 11 | 12 | export default Results -------------------------------------------------------------------------------- /Handle BarCodeScanner/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "scan", 4 | "slug": "scan", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "userInterfaceStyle": "light", 9 | "splash": { 10 | "image": "./assets/splash.png", 11 | "resizeMode": "contain", 12 | "backgroundColor": "#ffffff" 13 | }, 14 | "updates": { 15 | "fallbackToCacheTimeout": 0 16 | }, 17 | "assetBundlePatterns": [ 18 | "**/*" 19 | ], 20 | "ios": { 21 | "supportsTablet": true 22 | }, 23 | "android": { 24 | "adaptiveIcon": { 25 | "foregroundImage": "./assets/adaptive-icon.png", 26 | "backgroundColor": "#FFFFFF" 27 | } 28 | }, 29 | "web": { 30 | "favicon": "./assets/favicon.png" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scan", 3 | "version": "1.0.0", 4 | "main": "node_modules/expo/AppEntry.js", 5 | "scripts": { 6 | "start": "expo start", 7 | "android": "expo start --android", 8 | "ios": "expo start --ios", 9 | "web": "expo start --web", 10 | "eject": "expo eject" 11 | }, 12 | "dependencies": { 13 | "@react-navigation/native": "^6.0.11", 14 | "@react-navigation/native-stack": "^6.7.0", 15 | "expo": "^49.0.21", 16 | "expo-barcode-scanner": "~11.3.0", 17 | "expo-status-bar": "~1.3.0", 18 | "react": "17.0.2", 19 | "react-dom": "17.0.2", 20 | "react-native": "0.68.2", 21 | "react-native-ico-material-design": "^3.3.1", 22 | "react-native-safe-area-context": "4.2.4", 23 | "react-native-screens": "~3.11.1", 24 | "react-native-svg": "^12.4.3", 25 | "react-native-web": "0.17.7" 26 | }, 27 | "devDependencies": { 28 | "@babel/core": "^7.12.9" 29 | }, 30 | "private": true 31 | } 32 | -------------------------------------------------------------------------------- /Handle BarCodeScanner/src/screens/Scanner.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import { Text, View, StyleSheet, Button } from 'react-native'; 3 | import { BarCodeScanner } from 'expo-barcode-scanner'; 4 | 5 | export default function Scanner() { 6 | const [hasPermission, setHasPermission] = useState(null); 7 | const [scanned, setScanned] = useState(false); 8 | 9 | useEffect(() => { 10 | (async () => { 11 | const { status } = await BarCodeScanner.requestPermissionsAsync(); 12 | setHasPermission(status === 'granted'); 13 | })(); 14 | }, []); 15 | 16 | const handleBarCodeScanned = ({ data }) => { 17 | setScanned(true); 18 | let codeScan = data; 19 | let codeArticle = codeScan.substring(4,7); 20 | let quantity = codeScan.substring(8,11); 21 | if(codeScan.length > 13) 22 | alert("le code barre doit être composé de 13 chiffre"); 23 | } 24 | 25 | if (hasPermission === null) { 26 | return Requesting for camera permission; 27 | } 28 | if (hasPermission === false) { 29 | return No access to camera; 30 | } 31 | 32 | return ( 33 | 34 | 38 | {scanned &&