Commit baefc76e by Giang Tran

update code

parent 6bfd7025
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "pwa-chrome",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8081",
"webRoot": "${workspaceFolder}"
}
]
}
\ No newline at end of file
......@@ -6,7 +6,6 @@ import rootReducer from './src/Reducers/index';
import RootView from './src/RootView';
import createSagaMiddleware from 'redux-saga';
import rootSaga from './src/Saga/rootSaga';
import {SafeAreaProvider} from 'react-native-safe-area-context';
const sagaMiddleware = createSagaMiddleware();
......@@ -14,11 +13,9 @@ let store = createStore(rootReducer, applyMiddleware(sagaMiddleware));
sagaMiddleware.run(rootSaga);
const App = () => {
return (
<SafeAreaProvider>
<Provider store={store}>
<RootView />
</Provider>
</SafeAreaProvider>
<Provider store={store}>
<RootView />
</Provider>
);
};
......
......@@ -192,7 +192,13 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation platform('com.google.firebase:firebase-bom:26.6.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
......@@ -222,5 +228,7 @@ task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
\ No newline at end of file
{
"project_info": {
"project_number": "1070545778193",
"project_id": "investcustomer",
"storage_bucket": "investcustomer.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1070545778193:android:d91067a8a39254dc0a23b0",
"android_client_info": {
"package_name": "com.invest"
}
},
"oauth_client": [
{
"client_id": "1070545778193-ms07g1dog8lvkismot205eji0m624lkg.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.invest",
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
}
},
{
"client_id": "1070545778193-hgn2lv4i1jcaotmmrvtih6514pit8q90.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDohJEC4QiXCub1pmGsUDXHGx7xGpBzirc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1070545778193-hgn2lv4i1jcaotmmrvtih6514pit8q90.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -3,7 +3,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name=".MainApplication"
......@@ -14,11 +15,19 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
>
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -11,6 +11,9 @@ import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.facebook.react.ReactApplication; //<- Dòng này
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;//<- Dòng này
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;//<- Dòng này
public class MainApplication extends Application implements ReactApplication {
......@@ -27,6 +30,8 @@ public class MainApplication extends Application implements ReactApplication {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new RNFirebaseMessagingPackage());//<- Dòng này
packages.add(new RNFirebaseNotificationsPackage());//<- Dòng này
return packages;
}
......
......@@ -13,6 +13,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:4.0.1")
classpath 'com.google.gms:google-services:4.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1070545778193-1f50lidmpnp57s1eqgir4stht3f1ggn3.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1070545778193-1f50lidmpnp57s1eqgir4stht3f1ggn3</string>
<key>ANDROID_CLIENT_ID</key>
<string>1070545778193-ms07g1dog8lvkismot205eji0m624lkg.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyD-yEnw8BpGPNziPvPNx9BInK-U1dDLQQM</string>
<key>GCM_SENDER_ID</key>
<string>1070545778193</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>dcv.investcustomer.vn</string>
<key>PROJECT_ID</key>
<string>investcustomer</string>
<key>STORAGE_BUCKET</key>
<string>investcustomer.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1070545778193:ios:de8b945376b0af910a23b0</string>
</dict>
</plist>
\ No newline at end of file
......@@ -25,6 +25,8 @@
48E6A9A75AE9C55476F21D2D /* libPods-Invest-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4ECD31835B4784D2DC719E76 /* libPods-Invest-tvOSTests.a */; };
4BC9D2EFF73E48E798032BED /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 06A69E05F2264332A355F4BE /* EvilIcons.ttf */; };
4FB2E9FBB1C8484EA26B5FD1 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FCF39514129C4FD0BF839CDD /* Zocial.ttf */; };
52B7A0A425F722CF00CEDA09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */; };
52B7A0A525F722CF00CEDA09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */; };
71FC5C823A95494AA49F39AE /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1F75FF950F9B4C8AB6A8ECAD /* Octicons.ttf */; };
A93047C9FE4D470B9120342F /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A6BB8EF021B44C7CBFDA96B6 /* FontAwesome5_Solid.ttf */; };
AAC8FF1F19824DFCA96A8E55 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C0727D77229B4BDB8FFCBD65 /* SimpleLineIcons.ttf */; };
......@@ -80,6 +82,8 @@
3243599BDBAB43A18CE82BA0 /* Fontisto.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Fontisto.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf"; sourceTree = "<group>"; };
3D21415C579545A6906C6B62 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = "<group>"; };
4ECD31835B4784D2DC719E76 /* libPods-Invest-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Invest-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
52E1A15225F1255E00EA970D /* Invest.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Invest.entitlements; path = Invest/Invest.entitlements; sourceTree = "<group>"; };
5F96EA7789D1E36A43479651 /* libPods-Invest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Invest.a"; sourceTree = BUILT_PRODUCTS_DIR; };
72B39130AB01DE9359CED049 /* Pods-Invest-InvestTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Invest-InvestTests.release.xcconfig"; path = "Target Support Files/Pods-Invest-InvestTests/Pods-Invest-InvestTests.release.xcconfig"; sourceTree = "<group>"; };
762EB148EB19491EAFC4A90E /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; };
......@@ -157,6 +161,8 @@
13B07FAE1A68108700A75B9A /* Invest */ = {
isa = PBXGroup;
children = (
52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */,
52E1A15225F1255E00EA970D /* Invest.entitlements */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
......@@ -266,7 +272,7 @@
00E356EC1AD99517003FC87E /* Resources */,
50AA96423ADD3C77C5478E40 /* [CP] Embed Pods Frameworks */,
E44ED71C60298AC6A80FDE0F /* ShellScript */,
A5ABCC563E72E104612E5CAE /* [CP] Copy Pods Resources */,
AA0D418EA141E60BA49CB685 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
......@@ -354,6 +360,7 @@
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = MXZ24GRH48;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
......@@ -410,6 +417,7 @@
046B20939BE846C8906F5B76 /* FontAwesome5_Regular.ttf in Resources */,
A93047C9FE4D470B9120342F /* FontAwesome5_Solid.ttf in Resources */,
2152D883AD1E4C5085BB868C /* Fontisto.ttf in Resources */,
52B7A0A425F722CF00CEDA09 /* GoogleService-Info.plist in Resources */,
B3F02F293E914ADF8BD33398 /* Foundation.ttf in Resources */,
CA20A8CA92294D0C8C300AAB /* Ionicons.ttf in Resources */,
35CBE257E32843D581B2E066 /* MaterialCommunityIcons.ttf in Resources */,
......@@ -425,6 +433,7 @@
buildActionMask = 2147483647;
files = (
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
52B7A0A525F722CF00CEDA09 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -557,7 +566,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest/Pods-Invest-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A5ABCC563E72E104612E5CAE /* [CP] Copy Pods Resources */ = {
AA0D418EA141E60BA49CB685 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
......@@ -852,7 +861,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -861,13 +873,15 @@
);
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = dcv.investcustomer.vn;
PRODUCT_NAME = Invest;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
......@@ -880,17 +894,22 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = dcv.investcustomer.vn;
PRODUCT_NAME = Invest;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
......
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
......
......@@ -4,6 +4,11 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "Firebase.h"
#import "RNFirebaseMessaging.h"
#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
......@@ -31,6 +36,11 @@ static void InitializeFlipper(UIApplication *application) {
InitializeFlipper(application);
#endif
[FIRApp configure];
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"Invest"
......
{
"images" : [
{
"filename" : "zxc-2-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "zxc-2-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "zxc-2-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "zxc-2-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "zxc-2-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "zxc-2-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "zxc-2-60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "zxc-2-60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "zxc-2-20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "zxc-2-20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "zxc-2-29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "zxc-2-29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "zxc-2-40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "zxc-2-40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "zxc-2-76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "zxc-2-76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "zxc-2-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "zxc-2-1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
......
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
......@@ -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>NSPhotoLibraryUsageDescription</key>
<string>To upload images</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
......@@ -19,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......@@ -41,20 +39,8 @@
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<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/>
<key>NSPhotoLibraryUsageDescription</key>
<string>To upload images</string>
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
......@@ -74,5 +60,22 @@
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
......@@ -45,6 +45,10 @@ def flipper_post_install(installer)
end
target 'Invest' do
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
# Pods for Invest
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
......
......@@ -4,7 +4,10 @@ PODS:
- React
- CocoaAsyncSocket (7.6.5)
- CocoaLibEvent (1.0.0)
- Crashlytics (3.14.0):
- Fabric (~> 1.10.2)
- DoubleConversion (1.1.6)
- Fabric (1.10.2)
- FBLazyVector (0.62.2)
- FBReactNativeSpec (0.62.2):
- Folly (= 2018.10.22.00)
......@@ -13,6 +16,58 @@ PODS:
- React-Core (= 0.62.2)
- React-jsi (= 0.62.2)
- ReactCommon/turbomodule/core (= 0.62.2)
- Firebase/Auth (6.34.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 6.9.2)
- Firebase/Core (6.34.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 6.9.0)
- Firebase/CoreOnly (6.34.0):
- FirebaseCore (= 6.10.4)
- Firebase/Messaging (6.34.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.1)
- FirebaseAnalytics (6.9.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.7)
- GoogleAppMeasurement (= 6.9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30906.0)
- FirebaseAuth (6.9.2):
- FirebaseCore (~> 6.10)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/Environment (~> 6.7)
- GTMSessionFetcher/Core (~> 1.1)
- FirebaseCore (6.10.4):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- FirebaseCoreDiagnostics (1.7.0):
- GoogleDataTransport (~> 7.4)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- nanopb (~> 1.30906.0)
- FirebaseInstallations (1.7.0):
- FirebaseCore (~> 6.10)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- PromisesObjC (~> 1.2)
- FirebaseInstanceID (4.8.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- FirebaseMessaging (4.7.1):
- FirebaseCore (~> 6.10)
- FirebaseInstanceID (~> 4.7)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Reachability (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- Protobuf (>= 3.9.2, ~> 3.9)
- Flipper (0.33.1):
- Flipper-Folly (~> 2.1)
- Flipper-RSocket (~> 1.0)
......@@ -69,7 +124,42 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- GoogleAppMeasurement (6.9.0):
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30906.0)
- GoogleDataTransport (7.5.1):
- nanopb (~> 1.30906.0)
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.7.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (6.7.2):
- GoogleUtilities/Logger
- GoogleUtilities/Network (6.7.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.7.2)"
- GoogleUtilities/Reachability (6.7.2):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.7.2):
- GoogleUtilities/Logger
- GTMSessionFetcher/Core (1.5.0)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- OpenSSL-Universal (1.1.180)
- PromisesObjC (1.2.12)
- Protobuf (3.14.0)
- RCTRequired (0.62.2)
- RCTTypeSafety (0.62.2):
- FBLazyVector (= 0.62.2)
......@@ -298,6 +388,15 @@ PODS:
- React-Core
- RNCMaskedView (0.1.10):
- React
- RNFirebase (5.6.0):
- Firebase/Core
- React
- RNFirebase/Crashlytics (= 5.6.0)
- RNFirebase/Crashlytics (5.6.0):
- Crashlytics
- Fabric
- Firebase/Core
- React
- RNGestureHandler (1.10.3):
- React-Core
- RNImageCropPicker (0.36.0):
......@@ -325,6 +424,9 @@ DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
- Firebase/Auth
- Firebase/Core
- Firebase/Messaging
- Flipper (~> 0.33.1)
- Flipper-DoubleConversion (= 1.1.7)
- Flipper-Folly (~> 2.1)
......@@ -371,6 +473,7 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
- RNFirebase (from `../node_modules/react-native-firebase/ios`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
......@@ -383,6 +486,16 @@ SPEC REPOS:
- boost-for-react-native
- CocoaAsyncSocket
- CocoaLibEvent
- Crashlytics
- Fabric
- Firebase
- FirebaseAnalytics
- FirebaseAuth
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FirebaseInstanceID
- FirebaseMessaging
- Flipper
- Flipper-DoubleConversion
- Flipper-Folly
......@@ -390,7 +503,14 @@ SPEC REPOS:
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleUtilities
- GTMSessionFetcher
- nanopb
- OpenSSL-Universal
- PromisesObjC
- Protobuf
- TOCropViewController
- YogaKit
......@@ -451,6 +571,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/async-storage"
RNCMaskedView:
:path: "../node_modules/@react-native-community/masked-view"
RNFirebase:
:path: "../node_modules/react-native-firebase/ios"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNImageCropPicker:
......@@ -469,9 +591,19 @@ SPEC CHECKSUMS:
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
Crashlytics: 9220f5bc89e7a618df411b4f639389dbfb0e03d2
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
Fabric: ea977e3cd9c20425516d3dafd3bf8c941c51223f
FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245
FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
FirebaseAnalytics: 3bb096873ee0d7fa4b6c70f5e9166b6da413cc7f
FirebaseAuth: c92d49ada7948d1a23466e3db17bc4c2039dddc3
FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: ac90e2debaad40c347b90058feb263a80a3ba657
......@@ -481,7 +613,14 @@ SPEC CHECKSUMS:
FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: 0cde852566359049847168e51bd1c690e0f70056
RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035
RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce
React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3
......@@ -504,6 +643,7 @@ SPEC CHECKSUMS:
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
RNCAsyncStorage: b03032fdbdb725bea0bd9e5ec5a7272865ae7398
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
RNFirebase: 37daa9a346d070f9f6ee1f3b4aaf4c8e3b1d5d1c
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNImageCropPicker: e641bf83ac47324994cac139bde74635ec52c17c
RNReanimated: e03f7425cb7a38dcf1b644d680d1bfc91c3337ad
......@@ -513,6 +653,6 @@ SPEC CHECKSUMS:
Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 3decc4421a01aa5339d806c9e8d5a81477a9690f
PODFILE CHECKSUM: ce9f5d6c1d33ca001c74f3b2f6dffc5fa71bd125
COCOAPODS: 1.10.1
......@@ -20,8 +20,10 @@
"lodash": "^4.17.20",
"moment": "^2.29.1",
"react": "16.11.0",
"react-hook-form": "^6.15.4",
"react-native": "0.62.2",
"react-native-datepicker": "^1.7.2",
"react-native-firebase": "^5.6.0",
"react-native-gesture-handler": "^1.9.0",
"react-native-image-crop-picker": "^0.36.0",
"react-native-indicators": "^0.17.0",
......
File added
......@@ -7,9 +7,16 @@ import Modal from 'react-native-modal';
import {SkypeIndicator} from 'react-native-indicators';
import {HEIGHT, HEIGHTXD} from './Config/Functions';
import R from './assets/R';
import FirebaseNotification from './helper/FirebaseNotification';
const RootView = (props) => {
onReceived = (notification) => {};
onOpened = (notification) => {
console.log(('notification', notification));
};
return (
<View style={{flex: 1}}>
<FirebaseNotification onReceived={onReceived} onOpened={onOpened} />
<Modal isVisible={props.loadingModal.isVisible}>
<SkypeIndicator color={'white'} />
</Modal>
......
import React from 'react';
import {View, Text} from 'react-native';
import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native';
import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti';
import PickerImg from '../../../components/Picker/PickerImg';
import PickerDate from '../../../components/Picker/PickerDate';
import R from '../../../assets/R';
import Button from '../../../components/Button';
const BankInfor = (props) => {
return (
<View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<TextField title={'Loại thẻ'} />
<TextField title={'Số thẻ'} />
<View
style={{
flex: 1,
paddingHorizontal: 10,
paddingTop: 10,
}}>
<TextField title={'Loại thẻ'} onChangeText={(val) => console.log(val)} />
<TextField title={'Số thẻ'} onChangeText={(val) => console.log(val)} />
<PickerDate title={'Ngày cấp'} />
<View
style={{
......@@ -21,8 +28,18 @@ const BankInfor = (props) => {
<PickerImg title={'Ảnh mặt sau CMND'} />
<PickerImg title={'Ảnh chữ ký'} />
</View>
<View style={styles.btnSend}>
<Button title={'Xác minh'} />
</View>
</View>
);
};
const styles = StyleSheet.create({
btnSend: {
width: '100%',
marginTop: 50,
},
});
export default BankInfor;
import React, {useState} from 'react';
import {View, Text} from 'react-native';
import {View, Text, Image, TouchableOpacity, StyleSheet} from 'react-native';
import R from '../../../assets/R';
import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti';
import PickerDate from '../../../components/Picker/PickerDate';
import PickerImg from '../../../components/Picker/PickerImg';
const GeneralInfor = (props) => {
const [birth, setBirth] = useState(new Date());
return (
<View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<TextField title={'User name'} />
<TextField title={'Sponsor ID'} />
<TextField title={'User name'} onChangeText={(val) => console.log(val)} />
<TextField
title={'Sponsor ID'}
onChangeText={(val) => console.log(val)}
/>
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1}}>
<TextField title={'Tên'} />
<TextField title={'Tên'} onChangeText={(val) => console.log(val)} />
</View>
<View style={{width: 20}} />
<View style={{flex: 1}}>
<TextField title={'Họ'} />
<TextField title={'Họ'} onChangeText={(val) => console.log(val)} />
</View>
</View>
<TextField title={'Số điện thoại'} />
<TextField
title={'Số điện thoại'}
onChangeText={(val) => console.log(val)}
/>
<PickerDate
value={birth}
onValueChange={(val) => setBirth(val)}
title={'Ngày sinh'}
/>
<TextMulti title={'Địa chỉ'} />
<TextMulti title={'Địa chỉ'} onChangeText={(val) => console.log(val)} />
<TouchableOpacity
onPress={() => {
props.navigation.navigate('Profile');
}}
style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} />
</TouchableOpacity>
<View style={{height: 100}} />
</View>
);
};
const styles = StyleSheet.create({
btnNext: {
borderRadius: 30,
backgroundColor: '#1473E6',
width: 50,
height: 50,
justifyContent: 'center',
alignItems: 'center',
marginTop: 20,
alignSelf: 'flex-end',
elevation: 2,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.15,
shadowRadius: 1.84,
},
});
export default GeneralInfor;
import React from 'react';
import {View, Text} from 'react-native';
import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native';
import PickerImg from '../../../components/Picker/PickerImg';
import R from '../../../assets/R';
const Profile = (props) => {
return (
<View>
<Text>Profile screen</Text>
<TouchableOpacity
onPress={() => {
props.navigation.navigate('BankInfor');
}}
style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} />
</TouchableOpacity>
</View>
);
};
const styles = StyleSheet.create({
btnNext: {
borderRadius: 30,
backgroundColor: '#1473E6',
width: 50,
height: 50,
justifyContent: 'center',
alignItems: 'center',
marginTop: 20,
alignSelf: 'flex-end',
elevation: 2,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.15,
shadowRadius: 1.84,
},
});
export default Profile;
import React from 'react';
import React, {useState} from 'react';
import {
View,
Text,
......@@ -7,18 +7,43 @@ import {
TouchableOpacity,
KeyboardAvoidingView,
Platform,
Alert,
} from 'react-native';
import InputIcon from '../../components/Input/InputIcon';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions';
import R from '../../assets/R';
import {useNavigation} from '@react-navigation/native';
import {TABNAVIGATOR, FORGOTPASSWORD} from '../../routers/ScreenNames';
import {checkFormatArray} from '../../Config/Functions';
const Login = (props) => {
const {navigation} = props;
const [email, setEmail] = useState('');
const [pass, setPass] = useState('');
const navigate = useNavigation();
const onSubmitLogin = () => {
navigate.reset({
index: 1,
routes: [{name: TABNAVIGATOR}],
});
// const titles = ['tên đăng nhập', 'mật khẩu'];
// const index = checkFormatArray([email, pass]);
// console.log(index);
// if (index === true) {
// console.log('OK');
// navigate.reset({
// index: 1,
// routes: [{name: TABNAVIGATOR}],
// });
// } else {
// Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]);
// }
};
return (
<View
style={{
......@@ -31,11 +56,14 @@ const Login = (props) => {
icon={R.images.iconUser3}
title={'Tên đăng nhập'}
placeholder={'Nhập tên đăng nhập'}
onChangeText={(val) => setEmail(val)}
/>
<InputIcon
icon={R.images.iconLock}
title={'Mật khẩu'}
placeholder={'Nhập mật khẩu'}
isPassWord={true}
onChangeText={(val) => setPass(val)}
/>
<TouchableOpacity
onPress={() => navigate.navigate(FORGOTPASSWORD)}
......@@ -48,14 +76,7 @@ const Login = (props) => {
marginVertical: 20,
alignItems: 'center',
}}>
<TouchableOpacity
onPress={() =>
navigate.reset({
index: 1,
routes: [{name: TABNAVIGATOR}],
})
}
style={styles.wrapLogin}>
<TouchableOpacity onPress={onSubmitLogin} style={styles.wrapLogin}>
<Text style={styles.txtLogin}>Đăng nhp</Text>
<Image source={R.images.iconRight1} style={styles.imgIcon} />
</TouchableOpacity>
......
import React from 'react';
import React, {useState} from 'react';
import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native';
import InputIcon from '../../components/Input/InputIcon';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions';
import R from '../../assets/R';
import {useForm, Controller} from 'react-hook-form';
const Registor = (props) => {
const {navigation} = props;
const {control, handleSubmit, errors} = useForm();
const onSubmit = (data) => console.log(data);
return (
<View
style={{
......@@ -18,12 +22,9 @@ const Registor = (props) => {
icon={R.images.iconEmail}
title={'Email đăng ký'}
placeholder={'Nhập email'}
onChangeText={(val) => setEmail(val)}
/>
<InputIcon
icon={R.images.iconPhone3}
title={'Số điện thoại đăng ký'}
placeholder={'Nhập số điện thoại'}
/>
<InputIcon
icon={R.images.iconLock}
title={'Mật khẩu'}
......
......@@ -10,7 +10,7 @@ const Item = (props) => {
const {item} = props;
const navigate = useNavigation();
return (
<TouchableOpacity onPress={() => navigate.navigate(DETAIL_REQUIRE_MONEY)}>
<TouchableOpacity onPress={() => console.log('hello')}>
<View style={styles.container}>
<Block flex={1} row>
<View style={[styles.wrapLeft, {backgroundColor: item.color}]} />
......@@ -60,9 +60,9 @@ const styles = StyleSheet.create({
elevation: 5,
marginHorizontal: 10,
backgroundColor: R.colors.white,
marginTop: 5,
marginTop: 10,
borderRadius: HEIGHTXD(30),
marginBottom: 5,
marginBottom: 10,
},
wrapRight: {
borderLeftColor: R.colors.borderGray,
......
......@@ -18,6 +18,7 @@ const HomeView = (props) => {
<ScrollView
showsVerticalScrollIndicator={false}
style={styles.containerBody}>
<View style={{height: 10}} />
<View style={styles.containerMenu}>
<View style={styles.row}>
<View style={styles.row}>
......@@ -73,11 +74,12 @@ const styles = StyleSheet.create({
body: {
flex: 1,
backgroundColor: '#DFE7F5',
marginTop: 60,
borderTopLeftRadius: 60,
},
containerBody: {
marginTop: -40,
marginTop: -50,
},
containerMenu: {
height: 160,
......
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {useNavigation} from '@react-navigation/native';
import {TABNAVIGATOR} from '../../routers/ScreenNames';
const LoginView = props => {
const navigate = useNavigation();
import {Text, View, TextInput, Button, Alert, StyleSheet} from 'react-native';
import {useForm, Controller} from 'react-hook-form';
export default function App() {
const {control, handleSubmit, errors} = useForm();
const onSubmit = (data) => console.log(data);
console.log(errors);
return (
<View>
<Text>Login screen</Text>
<TouchableOpacity onPress={() => navigate.navigate(TABNAVIGATOR)}>
<Text>GO to home</Text>
</TouchableOpacity>
<Controller
control={control}
render={({onChange, onBlur, value}) => (
<TextInput
style={styles.input}
onBlur={onBlur}
onChangeText={(value) => onChange(value)}
value={value}
/>
)}
name="firstName"
rules={{required: true}}
defaultValue=""
/>
{/* {errors.firstName && <Text>This is required.</Text>} */}
<Controller
control={control}
render={({onChange, onBlur, value}) => (
<TextInput
style={styles.input}
onBlur={onBlur}
onChangeText={(value) => onChange(value)}
value={value}
/>
)}
name="lastName"
defaultValue=""
rules={{required: true, minLength: 6, maxLength: 10}}
/>
<Button title="Submit" onPress={handleSubmit(onSubmit)} />
</View>
);
};
}
export default LoginView;
const styles = StyleSheet.create({
input: {
height: 50,
backgroundColor: '#fafafa',
fontSize: 22,
marginTop: 50,
marginHorizontal: 20,
borderWidth: 0.6,
borderRadius: 20,
paddingHorizontal: 10,
},
});
......@@ -6,13 +6,13 @@ const images = {
iconWithdraw: require('./images/withdraw.png'),
iconDeposit: require('./images/deposit.png'),
iconAddUser: require('./images/addUser.png'),
headerHome: require('./images/Headerhome.png'),
headerHome: require('./images/imgHome.png'),
iconTransfer: require('./images/transfer.png'),
iconHistory: require('./images/history.png'),
moneyinvest: require('./images/moneyinvest.png'),
moneysupport: require('./images/moneysupport.png'),
moneyteam: require('./images/moneyteam.png'),
bgHeader: require('./images/bgheader2.png'),
bgHeader: require('./images/bgHeader1.png'),
iconMenu: require('./images/iconmenu.png'),
iconUser: require('./images/iconUser1.png'),
......@@ -35,7 +35,7 @@ const images = {
iconCalendar: require('./images/iconBack.png'),
iconImg: require('./images/iconImg.png'),
iconCamera: require('./images/iconCamera.png'),
bgAuthen: require('./images/bgAuthen.png'),
bgAuthen: require('./images/bgAuthen1.png'),
iconLock: require('./images/iconLock.png'),
iconPhone3: require('./images/iconPhone3.png'),
......
......@@ -15,7 +15,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
import Block from '../Block';
import {useNavigation} from '@react-navigation/native';
import ModalOption from './ModalOption';
import SnackBar from '../SnackBar'
import SnackBar from '../SnackBar';
const HeaderHome = (props) => {
const {title} = props;
......@@ -141,5 +141,6 @@ const styles = StyleSheet.create({
height: HEIGHTXD(139),
fontSize: getFontXD(42),
borderRadius: 10,
color: 'black',
},
});
......@@ -41,7 +41,7 @@ export default connect(mapStateToProps, {})(HeaderAuthen);
const styles = StyleSheet.create({
img: {
height: 260,
height: 200,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
......
......@@ -48,7 +48,7 @@ export default connect(mapStateToProps, {})(HeaderHome);
const styles = StyleSheet.create({
img: {
height: Platform.OS == 'ios' ? HEIGHTXD(330) : HEIGHTXD(400),
height: 110,
width: '100%',
justifyContent: 'center',
......
......@@ -74,7 +74,7 @@ export default connect(mapStateToProps, {})(HeaderHome);
const styles = StyleSheet.create({
img: {
height: Platform.OS == 'ios' ? HEIGHTXD(330) : HEIGHTXD(400),
height: 110,
width: '100%',
justifyContent: 'center',
......
......@@ -74,7 +74,7 @@ export default connect(mapStateToProps, {})(HeaderSearch);
const styles = StyleSheet.create({
img: {
height: Platform.OS == 'ios' ? HEIGHTXD(330) : HEIGHTXD(400),
height: 110,
width: '100%',
justifyContent: 'center',
......@@ -112,6 +112,7 @@ const styles = StyleSheet.create({
borderRadius: 10,
marginHorizontal: 10,
paddingHorizontal: 10,
color: 'black',
},
btnIcon: {
backgroundColor: R.colors.lightBlue2,
......
......@@ -100,7 +100,7 @@ export default connect(mapStateToProps, {})(HeaderSearch);
const styles = StyleSheet.create({
img: {
height: Platform.OS == 'ios' ? HEIGHTXD(330) : HEIGHTXD(400),
height: 110,
width: '100%',
justifyContent: 'center',
......@@ -138,6 +138,7 @@ const styles = StyleSheet.create({
borderRadius: 10,
marginHorizontal: 10,
paddingHorizontal: 10,
color: 'black',
},
btnIcon: {
backgroundColor: R.colors.lightBlue2,
......
......@@ -4,7 +4,7 @@ import {HEIGHTXD, WIDTHXD, getFontXD} from '../../../Config/Functions';
import R from '../../../assets/R';
const InputComponent = (props) => {
const {title, numberLine} = props;
const {title, onChangeText, maxLength} = props;
return (
<View style={{marginVertical: 5}}>
......@@ -17,6 +17,8 @@ const InputComponent = (props) => {
{title ? title : ''}
</Text>
<TextInput
maxLength={maxLength}
onChangeText={(val) => onChangeText(val)}
style={{
height: HEIGHTXD(89),
borderRadius: 7,
......@@ -24,6 +26,7 @@ const InputComponent = (props) => {
borderColor: R.colors.borderGray,
fontSize: getFontXD(42),
padding: 5,
color: 'black',
}}
/>
</View>
......
......@@ -4,14 +4,20 @@ import R from '../../assets/R';
import {WIDTHXD, HEIGHTXD, getFontXD} from '../../Config/Functions';
const InputIcon = (props) => {
const {title, placeholder, icon} = props;
const {title, placeholder, icon, onChangeText, maxLength, isPassWord} = props;
const {wrapLeft, wrapRight, container, iconImg, txtInput} = styles;
return (
<View style={container}>
<Image source={icon} style={iconImg} />
<View style={wrapRight}>
<Text>{title}</Text>
<TextInput style={txtInput} placeholder={placeholder} />
<TextInput
maxLength={maxLength}
onChangeText={(val) => onChangeText(val)}
style={txtInput}
placeholder={placeholder}
secureTextEntry={isPassWord}
/>
</View>
</View>
);
......@@ -43,6 +49,7 @@ const styles = StyleSheet.create({
fontSize: getFontXD(42),
marginTop: 5,
paddingHorizontal: 0,
color: 'black',
},
});
......
......@@ -4,7 +4,7 @@ import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
import R from '../../assets/R';
const TextField = (props) => {
const {title} = props;
const {title, onChangeText, maxLength} = props;
return (
<View style={{marginVertical: 5}}>
......@@ -17,8 +17,11 @@ const TextField = (props) => {
{title ? title : ''}
</Text>
<TextInput
maxLength={maxLength}
onChangeText={(val) => onChangeText(val)}
style={{
height: HEIGHTXD(109),
color: 'black',
borderRadius: 7,
borderWidth: 0.7,
borderColor: '#DBDBDB',
......
......@@ -4,7 +4,7 @@ import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
import R from '../../assets/R';
const TextField = (props) => {
const {title} = props;
const {title, onChangeText, maxLength} = props;
return (
<View style={{marginVertical: 5}}>
......@@ -17,9 +17,12 @@ const TextField = (props) => {
{title ? title : ''}
</Text>
<TextInput
maxLength={maxLength}
onChangeText={(val) => onChangeText(val)}
multiline={true}
numberOfLines={3}
style={{
color: 'black',
maxHeight: HEIGHTXD(259),
minHeight: HEIGHTXD(169),
borderRadius: 7,
......
/* eslint-disable no-console */
import React from 'react';
import {Platform, View, Alert} from 'react-native';
import firebase from 'react-native-firebase';
import {Notification} from 'react-native-firebase';
import sampleaudio from '../../sampleaudio.mp3';
import AsyncStorage from '@react-native-community/async-storage';
import KEY from '../assets/AsynStorage';
class FirebaseNotification extends React.PureComponent {
checkPermission = () => {
firebase
.messaging()
.hasPermission()
.then((enabled) => {
if (enabled) {
this.getToken();
} else {
this.requestPermission();
}
});
};
requestPermission = async () => {
try {
await firebase.messaging().requestPermission();
this.getToken();
} catch (error) {}
};
getToken = async () => {
let fcmToken = await AsyncStorage.getItem(KEY.FIREBASE);
console.log('Dat tao', fcmToken);
if (!fcmToken) {
fcmToken = await firebase.messaging().getToken();
console.log('Vua tao', fcmToken);
if (fcmToken) {
AsyncStorage.setItem(KEY.FIREBASE, fcmToken);
}
}
};
async componentDidMount() {
this.checkPermission();
this.createNotificationListeners();
this.removeNotificationDisplayedListener = firebase
.notifications()
.onNotificationDisplayed((notification) => {
console.log('Can alert', notification);
this.props.onReceived(notification);
// Process your notification as required
// ANDROID: Remote notifications do not contain the channel ID. You will have to specify this manually if you'd like to re-display the notification.
});
}
componentWillUnmount() {
this.removeNotificationDisplayedListener;
this.notificationListener;
this.notificationOpenedListener;
}
async createNotificationListeners() {
/*
* Triggered when a particular notification has been received in foreground
* */
console.log('Notification log');
const channel = new firebase.notifications.Android.Channel(
'500',
'Channel Name 1001',
firebase.notifications.Android.Importance.Max,
)
.setDescription('A natural description of the channel')
.setSound('default');
firebase.notifications().android.createChannel(channel);
this.notificationListener = firebase
.notifications()
.onNotification((notification) => {
console.log('notificaiton', notification);
if (Platform.OS === 'android') {
const localNotification = new firebase.notifications.Notification({
sound: sampleaudio,
show_in_foreground: true,
})
.setSound('default')
.setNotificationId(notification.notificationId)
.setTitle(notification.title)
.setBody(notification.body)
.setData(notification.data)
.android.setChannelId('default_notification_channel_id') // e.g. the id you chose above
// .android.setSmallIcon('@mipmap/ic_launcher') // create this icon in Android Studio
// .android.setColor('red') // you can set a color here
.android.setPriority(firebase.notifications.Android.Priority.High)
.android.setVibrate([300])
.android.setDefaults([
firebase.notifications.Android.Defaults.Vibrate,
]);
console.log('Notification:', localNotification);
firebase
.notifications()
.displayNotification(localNotification)
.catch((err) => console.error('Chay vao day android', err));
} else if (Platform.OS === 'ios') {
const localNotification = new firebase.notifications.Notification()
.setNotificationId(notification.notificationId)
.setTitle(notification.title)
.setSubtitle(notification.subtitle)
.setBody(notification.body)
.setData(notification.data)
.ios.setBadge(notification.ios.badge)
.ios.setLaunchImage('@mipmap/ic_stat_ic_notification');
firebase
.notifications()
.displayNotification(localNotification)
.catch((err) => console.error('Chay vao day', err));
}
// this.getNotifyNumber();
});
/*
* If your app is in background, you can listen for when a notification is clicked / tapped / opened as follows:
* */
this.notificationOpenedListener = firebase
.notifications()
.onNotificationOpened((notificationOpen) => {
this.props.onOpened(notificationOpen.notification);
});
/*
* If your app is closed, you can check if it was opened by a notification being clicked / tapped / opened as follows:
* */
const notificationOpen = await firebase
.notifications()
.getInitialNotification();
if (notificationOpen) {
this.props.onOpened(notificationOpen.notification);
}
/*
* Triggered for data only payload in foreground
* */
this.messageListener = firebase.messaging().onMessage((message) => {
// process data message
console.log('message---', message);
this.props.onReceived(message);
});
}
render() {
return <View />;
}
}
export default FirebaseNotification;
......@@ -5648,6 +5648,11 @@ open@^6.2.0:
dependencies:
is-wsl "^1.1.0"
opencollective-postinstall@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
......@@ -6003,6 +6008,11 @@ react-devtools-core@^4.0.6:
shell-quote "^1.6.1"
ws "^7"
react-hook-form@^6.15.4:
version "6.15.4"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-6.15.4.tgz#328003e1ccc096cd158899ffe7e3b33735a9b024"
integrity sha512-K+Sw33DtTMengs8OdqFJI3glzNl1wBzSefD/ksQw/hJf9CnOHQAU6qy82eOrh0IRNt2G53sjr7qnnw1JDjvx1w==
react-is@^16.12.0, react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
......@@ -6027,6 +6037,14 @@ react-native-datepicker@^1.7.2:
dependencies:
moment "^2.22.0"
react-native-firebase@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/react-native-firebase/-/react-native-firebase-5.6.0.tgz#6f6123f53cb73477915dd55c55f3e1de91db38d2"
integrity sha512-I+o3zNLdIz4pxWTCSZH70M1BcPl+SdqKQfurOT0sWcaMSL2ecDqVy0PCTmN7ORt7/Z879Er6PLgA/psjArQlmw==
dependencies:
opencollective-postinstall "^2.0.0"
prop-types "^15.7.2"
react-native-gesture-handler@^1.9.0:
version "1.10.3"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.10.3.tgz#942bbf2963bbf49fa79593600ee9d7b5dab3cfc0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment