Navigation Menu

Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
7kfpun committed Jan 20, 2017
1 parent 2cee29c commit a9dc060
Show file tree
Hide file tree
Showing 1,339 changed files with 639 additions and 14,645 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}
6 changes: 6 additions & 0 deletions .buckconfig
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
44 changes: 44 additions & 0 deletions .flowconfig
@@ -0,0 +1,44 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/

[options]
module.system=haste

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy

unsafe.enable_getters_and_setters=true

[version]
^0.36.0
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
*.pbxproj -text
63 changes: 29 additions & 34 deletions .gitignore
@@ -1,9 +1,10 @@
# OSX
#
.DS_Store

# Xcode
!**/*.xcodeproj
!**/*.pbxproj
!**/*.xcworkspacedata
!**/*.xcsettings
!**/*.xcscheme
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -21,41 +22,35 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Gradle
/build/
/Examples/**/android/app/build/
/Examples/**/android/app/gradle/
/Examples/**/android/app/gradlew
/Examples/**/android/app/gradlew.bat
/ReactAndroid/build/

# Buck
.buckd
buck-out
/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
/ReactAndroid/src/main/gen

# Android
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
/android/

# Node
node_modules
*.log
.nvm
# node.js
#
node_modules/
npm-debug.log

# OS X
.DS_Store
# BUCK
buck-out/
\.buckd/
android/app/libs
*.keystore

# Test generated files
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
*.js.meta
# 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

# APP
yarn.lock
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots

# App
config.js
*.keystore
1 change: 1 addition & 0 deletions .watchmanconfig
@@ -0,0 +1 @@
{}
Binary file removed AudienceNetwork.zip
Binary file not shown.
28 changes: 28 additions & 0 deletions app.js
@@ -0,0 +1,28 @@
import React from 'react';

import { Actions, Router, Scene } from 'react-native-router-flux';

import Main from './app/main';
import Login from './app/login';
import Overview from './app/overview';
import Add from './app/add';

console.ignoredYellowBox = [
'Possible Unhandled Promise Rejection',
'Warning: setState(...): Can only update a mounted or mounting component.',
];

const scenes = Actions.create(
<Scene key="root">
<Scene key="main" title={'Audience Network'} component={Main} hideNavBar={true} initial={true} />
<Scene key="add" title={'Add'} component={Add} hideNavBar={true} direction="vertical" />
<Scene key="login" title={'Login'} component={Login} hideNavBar={true} direction="vertical" panHandlers={null} />
<Scene key="overview" title={'Overview'} component={Overview} hideNavBar={true} />
</Scene>,
);

const AudienceNetwork = function Photos() {
return <Router scenes={scenes} />;
};

export default AudienceNetwork;
12 changes: 9 additions & 3 deletions app/add.js
Expand Up @@ -6,6 +6,7 @@ import {
StyleSheet,
Text,
TouchableOpacity,
Platform,
View,
} from 'react-native';

Expand Down Expand Up @@ -160,9 +161,14 @@ export default class AddView extends Component {
<Text style={styles.text}>You can find your Facebook App IDs at</Text>
<TouchableOpacity
onPress={() => {
SafariView.isAvailable()
.then(SafariView.show({ url: 'https://developers.facebook.com/apps/' }))
.catch(() => Linking.openURL('https://developers.facebook.com/apps/'));
const url = 'https://developers.facebook.com/apps/';
if (Platform.OS === 'ios') {
SafariView.isAvailable()
.then(SafariView.show({ url }))
.catch(error => console.log(error));
} else {
Linking.openURL(url);
}
AppEventsLogger.logEvent('open-fb-apps-link');
}}
>
Expand Down
6 changes: 3 additions & 3 deletions app/main.js
Expand Up @@ -31,23 +31,23 @@ const styles = StyleSheet.create({
paddingRight: 10,
},
row: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white',
paddingHorizontal: 15,
paddingVertical: 10,
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: '#E0E0E0',
borderBottomWidth: StyleSheet.hairlineWidth,
borderBottomColor: '#E0E0E0',
flexDirection: 'row',
alignItems: 'center',
},
image: {
width: 40,
height: 40,
},
text: {
fontSize: 15,
lineHeight: 24,
lineHeight: 22,
},
});

Expand Down
Binary file removed assets/icon-original.png
Binary file not shown.
51 changes: 2 additions & 49 deletions index.android.js
@@ -1,53 +1,6 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import App from './app';

export default class AppReview extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Double tap R on your keyboard to reload,{'\n'}
Shake or press menu button for dev menu
</Text>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

AppRegistry.registerComponent('AppReview', () => AppReview);
AppRegistry.registerComponent('AudienceNetwork', () => App);
29 changes: 2 additions & 27 deletions index.ios.js
@@ -1,31 +1,6 @@
import React from 'react';
import {
AppRegistry,
} from 'react-native';
import App from './app';

import { Actions, Router, Scene } from 'react-native-router-flux';

import Main from './app/main';
import Login from './app/login';
import Overview from './app/overview';
import Add from './app/add';

console.ignoredYellowBox = [
'Possible Unhandled Promise Rejection',
'Warning: setState(...): Can only update a mounted or mounting component.',
];

const scenes = Actions.create(
<Scene key="root">
<Scene key="main" title={'Performance'} component={Main} hideNavBar={true} initial={true} />
<Scene key="add" title={'Add'} component={Add} hideNavBar={true} direction="vertical" />
<Scene key="login" title={'Login'} component={Login} hideNavBar={true} direction="vertical" panHandlers={null} />
<Scene key="overview" title={'Overview'} component={Overview} hideNavBar={true} />
</Scene>,
);

const AudienceNetwork = function Photos() {
return <Router scenes={scenes} />;
};

AppRegistry.registerComponent('AppReview', () => AudienceNetwork);
AppRegistry.registerComponent('AudienceNetwork', () => App);

0 comments on commit a9dc060

Please sign in to comment.