mirror of
https://bitbucket.org/tagfer_team/tagfer-app.git
synced 2025-12-25 03:37:41 +00:00
UPS15-Scan Profile QR Code
This commit is contained in:
parent
652b74b003
commit
a01d5345cf
@ -139,6 +139,7 @@ android {
|
||||
dependencies {
|
||||
compile project(':react-native-app-settings')
|
||||
compile project(':react-native-image-picker')
|
||||
compile project(':react-native-camera')
|
||||
compile project(':react-native-contacts')
|
||||
compile project(':react-native-webview')
|
||||
compile project(':react-native-vector-icons')
|
||||
|
||||
@ -5,6 +5,7 @@ import android.app.Application;
|
||||
import com.facebook.react.ReactApplication;
|
||||
import com.krazylabs.OpenAppSettingsPackage;
|
||||
import com.imagepicker.ImagePickerPackage;
|
||||
import org.reactnative.camera.RNCameraPackage;
|
||||
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
|
||||
import com.reactnativecommunity.webview.RNCWebViewPackage;
|
||||
import com.oblador.vectoricons.VectorIconsPackage;
|
||||
@ -32,6 +33,7 @@ public class MainApplication extends Application implements ReactApplication {
|
||||
new MainReactPackage(),
|
||||
new OpenAppSettingsPackage(),
|
||||
new ImagePickerPackage(),
|
||||
new RNCameraPackage(),
|
||||
new ReactNativeContacts(),
|
||||
new RNCWebViewPackage(),
|
||||
new VectorIconsPackage(),
|
||||
|
||||
@ -3,6 +3,8 @@ include ':react-native-app-settings'
|
||||
project(':react-native-app-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-app-settings/android')
|
||||
include ':react-native-image-picker'
|
||||
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
|
||||
include ':react-native-camera'
|
||||
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
|
||||
include ':react-native-contacts'
|
||||
project(':react-native-contacts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts/android')
|
||||
include ':react-native-webview'
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
9D589CB7979845E6B5306594 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A0DFBDDDC4B54403AD569E6C /* Feather.ttf */; };
|
||||
AD3198E72354473C9CFBB5F9 /* libRNCWebView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D20792500D4B45FCBCC640FE /* libRNCWebView.a */; };
|
||||
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
|
||||
BF345C997C7D4D1F94B9FED9 /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27161680E2D0458F97F4EFE4 /* libRNCamera.a */; };
|
||||
C82C9AD575F240A5AAC7BD27 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4AB2611A0B4CE5A9FD41C4 /* libRNGestureHandler.a */; };
|
||||
CCFF320D8D3B429E98A05055 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AC4E3A77FB9C4C96AC304034 /* MaterialCommunityIcons.ttf */; };
|
||||
D9DE5DDB1B7D4D3A97259D9B /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F025858B6C364BB985AFD241 /* Octicons.ttf */; };
|
||||
@ -138,6 +139,13 @@
|
||||
remoteGlobalIDString = 5DBEB1501B18CEA900B34395;
|
||||
remoteInfo = RNVectorIcons;
|
||||
};
|
||||
073BF71A21EBB8CB009AF7D3 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 50A8D56D1F304C2FAC89FE4F /* RNCamera.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 4107012F1ACB723B00C6AA39;
|
||||
remoteInfo = RNCamera;
|
||||
};
|
||||
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
|
||||
@ -392,6 +400,7 @@
|
||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Tagfer/Info.plist; sourceTree = "<group>"; };
|
||||
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Tagfer/main.m; sourceTree = "<group>"; };
|
||||
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
|
||||
27161680E2D0458F97F4EFE4 /* libRNCamera.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCamera.a; sourceTree = "<group>"; };
|
||||
2D02E47B1E0B4A5D006451C7 /* Tagfer-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tagfer-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2D02E4901E0B4A5D006451C7 /* Tagfer-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tagfer-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -402,6 +411,7 @@
|
||||
4BD99765C4D944D88DFB0C3D /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
||||
4F118585274849369219BFCB /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; };
|
||||
4F4AB2611A0B4CE5A9FD41C4 /* libRNGestureHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNGestureHandler.a; sourceTree = "<group>"; };
|
||||
50A8D56D1F304C2FAC89FE4F /* RNCamera.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCamera.xcodeproj; path = "../node_modules/react-native-camera/ios/RNCamera.xcodeproj"; sourceTree = "<group>"; };
|
||||
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
||||
5F8E09E191C84292BA09C78C /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
|
||||
6084982B5FB04776AB51F562 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = "<group>"; };
|
||||
@ -464,6 +474,7 @@
|
||||
864F29A547984CC590F11FA6 /* libRNOpenAppSettings.a in Frameworks */,
|
||||
B4C9A4F1EFED483EBDF40E81 /* libRNImagePicker.a in Frameworks */,
|
||||
992B84F904804663A133A734 /* libReactNativePermissions.a in Frameworks */,
|
||||
BF345C997C7D4D1F94B9FED9 /* libRNCamera.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -560,6 +571,7 @@
|
||||
D3F803AC4AB4414E9AC91E62 /* libRNVectorIcons.a */,
|
||||
D20792500D4B45FCBCC640FE /* libRNCWebView.a */,
|
||||
7093AEA19630406782486DB0 /* libRCTContacts.a */,
|
||||
27161680E2D0458F97F4EFE4 /* libRNCamera.a */,
|
||||
);
|
||||
name = "Recovered References";
|
||||
sourceTree = "<group>";
|
||||
@ -604,6 +616,14 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
073BF71721EBB8CB009AF7D3 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
073BF71B21EBB8CB009AF7D3 /* libRNCamera.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
139105B71AF99BAD00B5F7CC /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -712,6 +732,7 @@
|
||||
92557FC291AB42ADB5028635 /* RNOpenAppSettings.xcodeproj */,
|
||||
54F9E00CCF864C30A5B82943 /* RNImagePicker.xcodeproj */,
|
||||
CCA4530A7D6748FE88A55EA2 /* ReactNativePermissions.xcodeproj */,
|
||||
50A8D56D1F304C2FAC89FE4F /* RNCamera.xcodeproj */,
|
||||
);
|
||||
name = Libraries;
|
||||
sourceTree = "<group>";
|
||||
@ -865,8 +886,12 @@
|
||||
TargetAttributes = {
|
||||
00E356ED1AD99517003FC87E = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
DevelopmentTeam = N5U792ZQLU;
|
||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
||||
};
|
||||
13B07F861A680F5B00A75B9A = {
|
||||
DevelopmentTeam = N5U792ZQLU;
|
||||
};
|
||||
2D02E47A1E0B4A5D006451C7 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
@ -946,6 +971,10 @@
|
||||
ProductGroup = 0715CF9321DF118B004C7919 /* Products */;
|
||||
ProjectRef = 5F8E09E191C84292BA09C78C /* RealmReact.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 073BF71721EBB8CB009AF7D3 /* Products */;
|
||||
ProjectRef = 50A8D56D1F304C2FAC89FE4F /* RNCamera.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 0715CF9121DF118B004C7919 /* Products */;
|
||||
ProjectRef = A6904FF8C83444048D6F2AF5 /* RNCWebView.xcodeproj */;
|
||||
@ -1040,6 +1069,13 @@
|
||||
remoteRef = 0715CFA621DF118C004C7919 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
073BF71B21EBB8CB009AF7D3 /* libRNCamera.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRNCamera.a;
|
||||
remoteRef = 073BF71A21EBB8CB009AF7D3 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@ -1409,6 +1445,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
DEVELOPMENT_TEAM = N5U792ZQLU;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
@ -1423,6 +1460,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = TagferTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
@ -1452,6 +1490,7 @@
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEVELOPMENT_TEAM = N5U792ZQLU;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||
@ -1462,6 +1501,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = TagferTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
@ -1492,6 +1532,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = N5U792ZQLU;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||
@ -1502,6 +1543,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = Tagfer/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
@ -1510,7 +1552,7 @@
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.rnsand;
|
||||
PRODUCT_NAME = Tagfer;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
@ -1521,6 +1563,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = N5U792ZQLU;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||
@ -1531,6 +1574,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = Tagfer/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
@ -1539,7 +1583,7 @@
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.rnsand;
|
||||
PRODUCT_NAME = Tagfer;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
@ -1567,6 +1611,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = "Tagfer-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
@ -1614,6 +1659,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = "Tagfer-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
@ -1660,6 +1706,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = "Tagfer-tvOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
@ -1706,6 +1753,7 @@
|
||||
"$(SRCROOT)/../node_modules/react-native-app-settings/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-image-picker/ios",
|
||||
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-camera/ios/**",
|
||||
);
|
||||
INFOPLIST_FILE = "Tagfer-tvOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Allow the user to search for his phone contacts in network</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
@ -55,6 +53,12 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Upload photos and scan QR codes</string>
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Allow the user to search for his phone contacts in network</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Entypo.ttf</string>
|
||||
@ -69,5 +73,19 @@
|
||||
<string>SimpleLineIcons.ttf</string>
|
||||
<string>Zocial.ttf</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
8317
package-lock.json
generated
8317
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@
|
||||
"react": "16.6.3",
|
||||
"react-native": "0.57.8",
|
||||
"react-native-app-settings": "^2.0.1",
|
||||
"react-native-camera": "^1.8.0",
|
||||
"react-native-contacts": "^2.2.5",
|
||||
"react-native-country-picker-modal": "^0.6.2",
|
||||
"react-native-elements": "^0.19.1",
|
||||
|
||||
64
src/components/new/QRCodeScanner.js
Normal file
64
src/components/new/QRCodeScanner.js
Normal file
@ -0,0 +1,64 @@
|
||||
import React from 'react';
|
||||
import { View, Alert, Vibration } from 'react-native';
|
||||
import { RNCamera } from 'react-native-camera';
|
||||
|
||||
export default class QRCodeScanner extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
isScanning: true,
|
||||
borderColor: '#ff0000'
|
||||
};
|
||||
}
|
||||
|
||||
handleBarCodeRead(data) {
|
||||
if (this.state.isScanning) {
|
||||
Vibration.vibrate();
|
||||
this.setState({ isScanning: false, borderColor: '#00ff00' });
|
||||
this.camera.pausePreview();
|
||||
|
||||
const error = this.props.onRead(data);
|
||||
if (error) {
|
||||
const onPress = () => {
|
||||
this.camera.resumePreview();
|
||||
this.setState({ isScanning: true, borderColor: '#ff0000' });
|
||||
};
|
||||
Alert.alert(error, 'Please try again', [{ text: 'OK', onPress }]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<RNCamera
|
||||
ref={ref => { this.camera = ref; }}
|
||||
style={styles.preview(this.state.borderColor)}
|
||||
type={RNCamera.Constants.Type.back}
|
||||
permissionDialogTitle={'Camera Access Required'}
|
||||
permissionDialogMessage={'Tagfer requires Camera access for barcode scanning'}
|
||||
captureAudio={false}
|
||||
doNotSave
|
||||
onBarCodeRead={({ data }) => this.handleBarCodeRead(data)}
|
||||
barCodeTypes={[RNCamera.Constants.BarCodeType.qr]}
|
||||
/>
|
||||
</View>
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = {
|
||||
container: {
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center'
|
||||
},
|
||||
preview: (borderColor) => ({
|
||||
flex: 0.45,
|
||||
marginHorizontal: 10,
|
||||
borderWidth: 3,
|
||||
borderColor
|
||||
})
|
||||
};
|
||||
@ -1,5 +1,6 @@
|
||||
import { createStackNavigator, createAppContainer } from 'react-navigation';
|
||||
import WelcomeScreen from '../screens/onboaring/WelcomeScreen';
|
||||
// AUTH IMPORTS
|
||||
import LoginScreen from '../screens/auth/LoginScreen';
|
||||
import SignupScreenOne from '../screens/auth/SignupScreen1';
|
||||
import SignupScreenTwo from '../screens/auth/SignupScreen2';
|
||||
@ -11,8 +12,11 @@ import SignupScreenSix from '../screens/auth/SignupScreen6';
|
||||
import TwitterWebView from '../screens/auth/TwitterWebView';
|
||||
import LinkedInWebView from '../screens/auth/LinkedInWebView';
|
||||
import ForgotPasswordScreen from '../screens/auth/ForgotPasswordScreen';
|
||||
// PROFILE IMPORTS
|
||||
import ProfileQRCodeScanner from '../screens/profile/ProfileQRCodeScanner';
|
||||
import ProfileSearchScreen from '../screens/profile/ProfileSearchScreen';
|
||||
|
||||
const MainNavigator = createStackNavigator({
|
||||
const MainNavigator = createStackNavigator({
|
||||
welcome: WelcomeScreen,
|
||||
login: LoginScreen,
|
||||
forgotPassword: ForgotPasswordScreen,
|
||||
@ -22,7 +26,9 @@ const MainNavigator = createStackNavigator({
|
||||
signup3b: SignupScreenThreeB,
|
||||
signup4: SignupScreenFour,
|
||||
signup5: SignupScreenFive,
|
||||
signup6: SignupScreenSix
|
||||
signup6: SignupScreenSix,
|
||||
profileQRScan: ProfileQRCodeScanner,
|
||||
profileSearch: ProfileSearchScreen
|
||||
});
|
||||
|
||||
const RootNavigator = createStackNavigator(
|
||||
|
||||
23
src/screens/profile/ProfileQRCodeScanner.js
Normal file
23
src/screens/profile/ProfileQRCodeScanner.js
Normal file
@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
|
||||
import QRCodeScanner from '../../components/new/QRCodeScanner';
|
||||
|
||||
export default class ProfileQRCodeScanner extends React.Component {
|
||||
static navigationOptions = {
|
||||
title: 'Scan Profile QR Code',
|
||||
headerStyle: { borderBottomWidth: 0 },
|
||||
headerTintColor: '#0D497E'
|
||||
};
|
||||
|
||||
onRead(data) {
|
||||
if (data.indexOf('@profile') === -1) {
|
||||
return 'Invalid Profile QR Code';
|
||||
}
|
||||
const [tagferId, profileN] = data.split('@profile');
|
||||
this.props.navigation.navigate('profile', { tagferId, profileN });
|
||||
}
|
||||
|
||||
render() {
|
||||
return <QRCodeScanner onRead={this.onRead.bind(this)} />;
|
||||
}
|
||||
}
|
||||
104
src/screens/profile/ProfileSearchScreen.js
Normal file
104
src/screens/profile/ProfileSearchScreen.js
Normal file
@ -0,0 +1,104 @@
|
||||
import React from 'react';
|
||||
import { View, TouchableOpacity, StyleSheet, Text, Platform } from 'react-native';
|
||||
import { Avatar } from 'react-native-elements';
|
||||
|
||||
import colors from '../../config/colors.json';
|
||||
|
||||
|
||||
export default class ProfileSearchScreen extends React.Component {
|
||||
static navigationOptions = {
|
||||
title: 'Make Connections via',
|
||||
headerStyle: { borderBottomWidth: 0, backgroundColor: colors.offWhite },
|
||||
headerLeft: null
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<HorizontalCard
|
||||
flex={0.2}
|
||||
text='Scan QR Code'
|
||||
icon={{ name: 'qrcode-scan', type: 'material-community' }}
|
||||
color={colors.buttonBlue}
|
||||
onPress={() => this.props.navigation.navigate('profileQRScan')}
|
||||
/>
|
||||
<HorizontalCard
|
||||
flex={0.2}
|
||||
text='Scan business cards'
|
||||
icon={{ name: 'id-card', type: 'font-awesome' }}
|
||||
color={colors.teal}
|
||||
/>
|
||||
<VerticalCard
|
||||
flex={0.33}
|
||||
text='Transfer Tagfer IDs'
|
||||
icon={{ name: 'md-search', type: 'ionicon', size: 50 }}
|
||||
color={colors.darkOrange}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const HorizontalCard = ({ flex, text, icon, color, onPress }) => (
|
||||
<View style={{ flex }}>
|
||||
<TouchableOpacity style={styles.cardContainer('row')} onPress={onPress}>
|
||||
<View style={{ flex: 0.4, alignItems: 'center', justifyContent: 'center' }}>
|
||||
<Avatar
|
||||
large
|
||||
rounded
|
||||
icon={icon}
|
||||
containerStyle={{ backgroundColor: color }}
|
||||
/>
|
||||
</View>
|
||||
<View style={{ flex: 0.6, alignItems: 'flex-start', justifyContent: 'center' }}>
|
||||
<Text style={{ fontSize: 26, color }}>{text}</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
|
||||
const VerticalCard = ({ flex, text, icon, color, onPress }) => (
|
||||
<View style={{ flex }}>
|
||||
<TouchableOpacity style={styles.cardContainer('column')} onPress={onPress}>
|
||||
<View style={{ flex: 0.4, alignItems: 'center', justifyContent: 'center', marginTop: 20 }}>
|
||||
<Avatar
|
||||
large
|
||||
rounded
|
||||
icon={icon}
|
||||
containerStyle={{ backgroundColor: color }}
|
||||
/>
|
||||
</View>
|
||||
<View style={{ flex: 0.6, alignItems: 'center', justifyContent: 'center' }}>
|
||||
<Text style={{ fontSize: 26, color }}>{text}</Text>
|
||||
<Text style={{ fontSize: 16, color: '#8A8A8A', marginTop: 10 }}>Choose which profiles to connect with</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.offWhite
|
||||
},
|
||||
cardContainer: (flexDirection) => ({
|
||||
flex: 1,
|
||||
flexDirection,
|
||||
backgroundColor: 'white',
|
||||
borderColor: '#e1e8ee',
|
||||
borderWidth: 1,
|
||||
margin: 15,
|
||||
marginBottom: 0,
|
||||
...Platform.select({
|
||||
ios: {
|
||||
shadowColor: 'rgba(0,0,0, .2)',
|
||||
shadowOffset: { height: 0, width: 0 },
|
||||
shadowOpacity: 1,
|
||||
shadowRadius: 4,
|
||||
},
|
||||
android: {
|
||||
elevation: 1,
|
||||
},
|
||||
}),
|
||||
})
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user