提交 bda8cddc authored 作者: vipcxj's avatar vipcxj

project rename and fix

上级 0c6bcd61
[android]
target = Google Inc.:Google APIs:25
[maven_repositories]
central = https://repo1.maven.org/maven2
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
; For RN Apps installed via npm, "Libraries" folder is inside ; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root ; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js .*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
; Ignore polyfills
.*/Libraries/polyfills/.*
; Additional create-react-native-app ignores ; Additional create-react-native-app ignores
...@@ -34,8 +36,7 @@ ...@@ -34,8 +36,7 @@
[libs] [libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow node_modules/react-native/flow/
flow/
[lints] [lints]
...@@ -52,14 +53,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we ...@@ -52,14 +53,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we
suppress_type=$FlowIssue suppress_type=$FlowIssue
suppress_type=$FlowFixMe suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true unsafe.enable_getters_and_setters=true
[version] [version]
^0.57.3 ^0.53.0
*.pbxproj -text
node_modules/ node_modules/
<<<<<<< ours
.expo/ .expo/
ios/build/ ios/build/
android/.gradle
android/.idea
android/build/ android/build/
android/app/build/ android/app/build/
npm-debug.* npm-debug.*
` `
=======
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
>>>>>>> theirs
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="AwesomeProject" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
...@@ -45,12 +45,12 @@ android_library( ...@@ -45,12 +45,12 @@ android_library(
android_build_config( android_build_config(
name = "build_config", name = "build_config",
package = "com.awesomeproject", package = "com.bolanmanagerapp",
) )
android_resource( android_resource(
name = "res", name = "res",
package = "com.awesomeproject", package = "com.bolanmanagerapp",
res = "src/main/res", res = "src/main/res",
) )
......
...@@ -79,10 +79,8 @@ ...@@ -79,10 +79,8 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/multi-dex" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/multi-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
...@@ -92,7 +90,6 @@ ...@@ -92,7 +90,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
......
...@@ -72,6 +72,10 @@ import com.android.build.OutputFile ...@@ -72,6 +72,10 @@ import com.android.build.OutputFile
* ] * ]
*/ */
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native/react.gradle"
/** /**
...@@ -94,7 +98,7 @@ android { ...@@ -94,7 +98,7 @@ android {
buildToolsVersion "25.0.3" buildToolsVersion "25.0.3"
defaultConfig { defaultConfig {
applicationId "com.awesomeproject" applicationId "com.bolanmanagerapp"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 25 targetSdkVersion 25
multiDexEnabled true multiDexEnabled true
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.awesomeproject" package="com.bolanmanagerapp"
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-sdk <uses-sdk
android:minSdkVersion="16" android:minSdkVersion="16"
......
...@@ -10,7 +10,7 @@ import android.os.ServiceManager; ...@@ -10,7 +10,7 @@ import android.os.ServiceManager;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import com.awesomeproject.R; import com.bolanmanagerapp.R;
import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactApplicationContext;
......
package com.awesomeproject; package com.bolanmanagerapp;
import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivity;
...@@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity { ...@@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/ */
@Override @Override
protected String getMainComponentName() { protected String getMainComponentName() {
return "Proland Starter"; return "bolanManagerApp";
} }
} }
package com.awesomeproject; package com.bolanmanagerapp;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
...@@ -24,11 +24,16 @@ public class MainApplication extends Application implements ReactApplication { ...@@ -24,11 +24,16 @@ public class MainApplication extends Application implements ReactApplication {
@Override @Override
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.asList( return Arrays.<ReactPackage>asList(
new MainReactPackage(), new MainReactPackage(),
new IDCardReactPackage() new IDCardReactPackage()
); );
} }
@Override
protected String getJSMainModuleName() {
return "index";
}
}; };
@Override @Override
......
<resources> <resources>
<string name="app_name">React Native Demo</string> <string name="app_name">bolanManagerApp</string>
</resources> </resources>
rootProject.name = 'AwesomeProject' rootProject.name = 'bolanManagerApp'
include ':app' include ':app'
{ {
"expo": { "name": "bolanManagerApp",
"sdkVersion": "20.0.0" "displayName": "bolanManagerApp"
},
"name": "Proland Starter",
"displayName": "React Native Demo"
} }
\ No newline at end of file
import './src/index';
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOS.app" BuildableName = "bolanManagerApp-tvOS.app"
BlueprintName = "AwesomeProject-tvOS" BlueprintName = "bolanManagerApp-tvOS"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry <BuildActionEntry
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOSTests.xctest" BuildableName = "bolanManagerApp-tvOSTests.xctest"
BlueprintName = "AwesomeProject-tvOSTests" BlueprintName = "bolanManagerApp-tvOSTests"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
</BuildActionEntries> </BuildActionEntries>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOSTests.xctest" BuildableName = "bolanManagerApp-tvOSTests.xctest"
BlueprintName = "AwesomeProject-tvOSTests" BlueprintName = "bolanManagerApp-tvOSTests"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
</Testables> </Testables>
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOS.app" BuildableName = "bolanManagerApp-tvOS.app"
BlueprintName = "AwesomeProject-tvOS" BlueprintName = "bolanManagerApp-tvOS"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <AdditionalOptions>
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOS.app" BuildableName = "bolanManagerApp-tvOS.app"
BlueprintName = "AwesomeProject-tvOS" BlueprintName = "bolanManagerApp-tvOS"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions> <AdditionalOptions>
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "AwesomeProject-tvOS.app" BuildableName = "bolanManagerApp-tvOS.app"
BlueprintName = "AwesomeProject-tvOS" BlueprintName = "bolanManagerApp-tvOS"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
</ProfileAction> </ProfileAction>
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "AwesomeProject.app" BuildableName = "bolanManagerApp.app"
BlueprintName = "AwesomeProject" BlueprintName = "bolanManagerApp"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry <BuildActionEntry
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "AwesomeProjectTests.xctest" BuildableName = "bolanManagerAppTests.xctest"
BlueprintName = "AwesomeProjectTests" BlueprintName = "bolanManagerAppTests"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
</BuildActionEntries> </BuildActionEntries>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E" BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "AwesomeProjectTests.xctest" BuildableName = "bolanManagerAppTests.xctest"
BlueprintName = "AwesomeProjectTests" BlueprintName = "bolanManagerAppTests"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
</Testables> </Testables>
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "AwesomeProject.app" BuildableName = "bolanManagerApp.app"
BlueprintName = "AwesomeProject" BlueprintName = "bolanManagerApp"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <AdditionalOptions>
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "AwesomeProject.app" BuildableName = "bolanManagerApp.app"
BlueprintName = "AwesomeProject" BlueprintName = "bolanManagerApp"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions> <AdditionalOptions>
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "AwesomeProject.app" BuildableName = "bolanManagerApp.app"
BlueprintName = "AwesomeProject" BlueprintName = "bolanManagerApp"
ReferencedContainer = "container:AwesomeProject.xcodeproj"> ReferencedContainer = "container:bolanManagerApp.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
</ProfileAction> </ProfileAction>
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
{ {
NSURL *jsCodeLocation; NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Proland Starter" moduleName:@"bolanManagerApp"
initialProperties:nil initialProperties:nil
launchOptions:launchOptions]; launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AwesomeProject" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="bolanManagerApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/> <rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>React Native Demo</string> <string>bolanManagerApp</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#define TIMEOUT_SECONDS 600 #define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
@interface AwesomeProjectTests : XCTestCase @interface bolanManagerAppTests : XCTestCase
@end @end
@implementation AwesomeProjectTests @implementation bolanManagerAppTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
{ {
......
{ {
"name": "AwesomeProject", "name": "bolanManagerApp",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"devDependencies": { "devDependencies": {
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"babel-plugin-import": "^1.6.0", "babel-plugin-import": "^1.6.0",
"babel-preset-flow": "^6.23.0", "babel-preset-flow": "^6.23.0",
"babel-preset-react-native-stage-0": "^1.0.1", "babel-preset-react-native-stage-0": "^1.0.1",
"css-loader": "^0.28.7",
"eslint": "^4.8.0", "eslint": "^4.8.0",
"eslint-config-airbnb": "^16.0.0", "eslint-config-airbnb": "^16.0.0",
"eslint-plugin-import": "^2.7.0", "eslint-plugin-import": "^2.7.0",
...@@ -14,7 +15,10 @@ ...@@ -14,7 +15,10 @@
"eslint-plugin-react": "^7.4.0", "eslint-plugin-react": "^7.4.0",
"flow-bin": "^0.57.3", "flow-bin": "^0.57.3",
"jest-expo": "~20.0.0", "jest-expo": "~20.0.0",
"react-test-renderer": "16.0.0-alpha.12" "less": "^3.0.0-alpha.3",
"less-loader": "^4.0.5",
"react-test-renderer": "16.0.0-alpha.12",
"style-loader": "^0.19.0"
}, },
"scripts": { "scripts": {
"start": "react-native start", "start": "react-native start",
...@@ -30,8 +34,8 @@ ...@@ -30,8 +34,8 @@
"dependencies": { "dependencies": {
"antd-mobile": "^2.0.0", "antd-mobile": "^2.0.0",
"dva-core": "^1.1.0", "dva-core": "^1.1.0",
"react": "16.0.0-alpha.12", "react": "^16.0.0-beta.5",
"react-native": "^0.47.0", "react-native": "^0.49.3",
"react-navigation": "^1.0.0-beta.14", "react-navigation": "^1.0.0-beta.14",
"react-redux": "^5.0.6", "react-redux": "^5.0.6",
"redux-persist": "^4.10.1" "redux-persist": "^4.10.1"
......
...@@ -22,4 +22,4 @@ persistStore(app.getStore(), { ...@@ -22,4 +22,4 @@ persistStore(app.getStore(), {
blacklist: ['router'], blacklist: ['router'],
}); });
AppRegistry.registerComponent('Proland Starter', () => App); AppRegistry.registerComponent('bolanManagerApp', () => App);
import router from './router';
import welcome from './welcome'; import welcome from './welcome';
export default [ export default [
router,
welcome, welcome,
]; ];
...@@ -6,7 +6,7 @@ export default { ...@@ -6,7 +6,7 @@ export default {
effects: { effects: {
*login(ignored, { put, call }) { *login(ignored, { put, call }) {
yield put(NavigationActions.navigate({ yield put(NavigationActions.navigate({
routerName: 'Main', routeName: 'Main',
})); }));
}, },
}, },
......
import { delay, NavigationActions } from '../utils' import { delay, NavigationActions } from '../utils';
import { routerReducer } from '../router' import { routerReducer } from '../router';
const actions = [ const actions = [
NavigationActions.BACK, NavigationActions.BACK,
...@@ -8,7 +8,7 @@ const actions = [ ...@@ -8,7 +8,7 @@ const actions = [
NavigationActions.RESET, NavigationActions.RESET,
NavigationActions.SET_PARAMS, NavigationActions.SET_PARAMS,
NavigationActions.URI, NavigationActions.URI,
] ];
export default { export default {
namespace: 'router', namespace: 'router',
...@@ -17,26 +17,26 @@ export default { ...@@ -17,26 +17,26 @@ export default {
}, },
reducers: { reducers: {
apply(state, { payload: action }) { apply(state, { payload: action }) {
return routerReducer(state, action) return routerReducer(state, action);
}, },
}, },
effects: { effects: {
watch: [ watch: [
function* watch({ take, call, put }) { function* watch({ take, call, put }) {
const loop = true const loop = true;
while (loop) { while (loop) {
const payload = yield take(actions) const payload = yield take(actions);
yield put({ yield put({
type: 'apply', type: 'apply',
payload, payload,
}) });
// debounce, see https://github.com/react-community/react-navigation/issues/271 // debounce, see https://github.com/react-community/react-navigation/issues/271
if (payload.type === 'Navigation/NAVIGATE') { if (payload.type === 'Navigation/NAVIGATE') {
yield call(delay, 500) yield call(delay, 500);
} }
} }
}, },
{ type: 'watcher' }, { type: 'watcher' },
], ],
}, },
} };
...@@ -3,16 +3,18 @@ import { NavigationActions } from 'react-navigation'; ...@@ -3,16 +3,18 @@ import { NavigationActions } from 'react-navigation';
export default { export default {
namespace: 'welcome', namespace: 'welcome',
state: {},
reducers: {},
effects: { effects: {
*init(ignored, { put, call }) { *init(ignored, { put, call }) {
const token = yield call(AsyncStorage.getItem, 'token'); const token = yield call(AsyncStorage.getItem, 'token');
if (token) { if (!token) {
yield put(NavigationActions.navigate({ yield put(NavigationActions.navigate({
routerName: 'Login', routeName: 'Login',
})); }));
} else { } else {
yield put(NavigationActions.navigate({ yield put(NavigationActions.navigate({
routerName: 'Main', routeName: 'Main',
})); }));
} }
}, },
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { BackHandler, Animated, Easing } from 'react-native'; import { BackHandler, Animated, Easing } from 'react-native';
import { import { StackNavigator, addNavigationHelpers, NavigationActions } from 'react-navigation';
StackNavigator,
addNavigationHelpers,
NavigationActions,
} from 'react-navigation';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import NavigatorService from './services/navigator'; import NavigatorService from './services/navigator';
import Welcome from './routes/welcome'; import Welcome from './routes/welcome';
...@@ -76,7 +72,7 @@ class Router extends PureComponent { ...@@ -76,7 +72,7 @@ class Router extends PureComponent {
backHandle = () => { backHandle = () => {
const currentScreen = getCurrentScreen(this.props.router); const currentScreen = getCurrentScreen(this.props.router);
if (currentScreen === 'Login') { if (currentScreen === 'Login' || currentScreen === 'Welcome') {
return true; return true;
} }
if (currentScreen !== 'Home') { if (currentScreen !== 'Home') {
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View } from 'react-native'; import { View, Text } from 'react-native';
import { Button } from 'antd-mobile'; import { Button } from 'antd-mobile';
import { NavigationActions } from 'react-navigation'; import { NavigationActions } from 'react-navigation';
class ErrorScreen extends Component { class ErrorScreen extends Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
title: navigation.state.params.title title: navigation.state.params.title,
}); });
render() { render() {
...@@ -13,7 +13,9 @@ class ErrorScreen extends Component { ...@@ -13,7 +13,9 @@ class ErrorScreen extends Component {
const { content } = state.params; const { content } = state.params;
return ( return (
<View> <View>
<Text>
{ content || '' } { content || '' }
</Text>
<Button onClick={() => { navigate.dispatch(NavigationActions.back()); }} >确定</Button> <Button onClick={() => { navigate.dispatch(NavigationActions.back()); }} >确定</Button>
</View> </View>
); );
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View } from 'react-native'; import { View, Text } from 'react-native';
class Login extends Component { class Login extends Component {
render() { render() {
return ( return (
<View> <View>
login <Text>login</Text>
</View> </View>
); );
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View } from 'react-native'; import { View, Text } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import {createAction} from '../utils/index'; import { createAction } from '../utils/index';
@connect(({ welcome }) => ({ welcome })) @connect(({ welcome }) => ({ welcome }))
class WelcomeScreen extends Component { class WelcomeScreen extends Component {
componentDidMount() { componentDidMount() {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(createAction('init')); dispatch(createAction('welcome/init')());
} }
render() { render() {
return ( return (
<View> <View>
welcome <Text>welcome</Text>
</View> </View>
); );
} }
......
export { NavigationActions } from 'react-navigation';
export const delay = time => new Promise(resolve => setTimeout(resolve, time));
export const createAction = type => payload => ({ type, payload }); export const createAction = type => payload => ({ type, payload });
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论