Skip to content

Commit 92f62ea

Browse files
committed
added latest RN template
1 parent fab79c3 commit 92f62ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2419
-64
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
.vscode/
3+
.DS_Store

script.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

template.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
2-
placeholderName: 'ProjectName',
2+
placeholderName: 'HelloWorld',
33
templateDir: './template',
4-
postInitScript: './script.js'
54
}

template/App.tsx

Lines changed: 84 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,99 @@
11
/**
2-
* ProjectName
2+
* Sample React Native App
33
* https://github.com/facebook/react-native
44
*
55
* Generated with the TypeScript template
66
* https://github.com/emin93/react-native-template-typescript
7-
*
7+
*
88
* @format
99
*/
1010

11-
import React, {Component} from 'react';
12-
import {Platform, StyleSheet, Text, View} from 'react-native';
11+
import React, {Fragment} from 'react';
12+
import {
13+
SafeAreaView,
14+
StyleSheet,
15+
ScrollView,
16+
View,
17+
Text,
18+
StatusBar,
19+
} from 'react-native';
1320

14-
const instructions = Platform.select({
15-
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
16-
android:
17-
'Double tap R on your keyboard to reload,\n' +
18-
'Shake or press menu button for dev menu',
19-
});
21+
import {
22+
Header,
23+
LearnMoreLinks,
24+
Colors,
25+
DebugInstructions,
26+
ReloadInstructions,
27+
} from 'react-native/Libraries/NewAppScreen';
2028

21-
interface Props {}
22-
export default class App extends Component<Props> {
23-
render() {
24-
return (
25-
<View style={styles.container}>
26-
<Text style={styles.welcome}>Welcome to React Native!</Text>
27-
<Text style={styles.instructions}>To get started, edit App.tsx</Text>
28-
<Text style={styles.instructions}>{instructions}</Text>
29-
</View>
30-
);
31-
}
32-
}
29+
const App = () => {
30+
return (
31+
<Fragment>
32+
<StatusBar barStyle="dark-content" />
33+
<SafeAreaView>
34+
<ScrollView
35+
contentInsetAdjustmentBehavior="automatic"
36+
style={styles.scrollView}>
37+
<Header />
38+
<View style={styles.body}>
39+
<View style={styles.sectionContainer}>
40+
<Text style={styles.sectionTitle}>Step One</Text>
41+
<Text style={styles.sectionDescription}>
42+
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
43+
screen and then come back to see your edits.
44+
</Text>
45+
</View>
46+
<View style={styles.sectionContainer}>
47+
<Text style={styles.sectionTitle}>See Your Changes</Text>
48+
<Text style={styles.sectionDescription}>
49+
<ReloadInstructions />
50+
</Text>
51+
</View>
52+
<View style={styles.sectionContainer}>
53+
<Text style={styles.sectionTitle}>Debug</Text>
54+
<Text style={styles.sectionDescription}>
55+
<DebugInstructions />
56+
</Text>
57+
</View>
58+
<View style={styles.sectionContainer}>
59+
<Text style={styles.sectionTitle}>Learn More</Text>
60+
<Text style={styles.sectionDescription}>
61+
Read the docs to discover what to do next:
62+
</Text>
63+
</View>
64+
<LearnMoreLinks />
65+
</View>
66+
</ScrollView>
67+
</SafeAreaView>
68+
</Fragment>
69+
);
70+
};
3371

3472
const styles = StyleSheet.create({
35-
container: {
36-
flex: 1,
37-
justifyContent: 'center',
38-
alignItems: 'center',
39-
backgroundColor: '#F5FCFF',
73+
scrollView: {
74+
backgroundColor: Colors.lighter,
75+
},
76+
body: {
77+
backgroundColor: Colors.white,
78+
},
79+
sectionContainer: {
80+
marginTop: 32,
81+
paddingHorizontal: 24,
4082
},
41-
welcome: {
42-
fontSize: 20,
43-
textAlign: 'center',
44-
margin: 10,
83+
sectionTitle: {
84+
fontSize: 24,
85+
fontWeight: '600',
86+
color: Colors.black,
4587
},
46-
instructions: {
47-
textAlign: 'center',
48-
color: '#333333',
49-
marginBottom: 5,
88+
sectionDescription: {
89+
marginTop: 8,
90+
fontSize: 18,
91+
fontWeight: '400',
92+
color: Colors.dark,
5093
},
51-
});
94+
highlight: {
95+
fontWeight: '700',
96+
},
97+
});
98+
99+
export default App;

template/__tests__/App-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ import renderer from 'react-test-renderer';
1111

1212
it('renders correctly', () => {
1313
renderer.create(<App />);
14-
});
14+
});

template/_buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

template/_eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

template/_gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

template/_gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
xcshareddata
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/

template/_watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)