forked from rationalappdev/tabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
76 lines (73 loc) · 2.37 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import React, { Component } from 'react';
import {
StyleSheet, // CSS-like styles
Text, // Renders text
View // Container component
} from 'react-native';
import Tabs from './tabs';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Tabs>
{/* First tab */}
<View title="WELCOME" style={styles.content}>
<Text style={styles.header}>
Welcome to React Native
</Text>
<Text style={styles.text}>
The best technology to build cross platform mobile apps with
</Text>
</View>
{/* Second tab */}
<View title="NATIVE" style={styles.content}>
<Text style={styles.header}>
Truly Native
</Text>
<Text style={styles.text}>
Components you define will end up rendering as native platform widgets
</Text>
</View>
{/* Third tab */}
<View title="EASY" style={styles.content}>
<Text style={styles.header}>
Ease of Learning
</Text>
<Text style={styles.text}>
It’s much easier to read and write comparing to native platform’s code
</Text>
</View>
</Tabs>
</View>
);
}
}
const styles = StyleSheet.create({
// App container
container: {
flex: 1, // Take up all screen
backgroundColor: '#E91E63', // Background color
},
// Tab content container
content: {
flex: 1, // Take up all available space
justifyContent: 'center', // Center vertically
alignItems: 'center', // Center horizontally
backgroundColor: '#C2185B', // Darker background for content area
},
// Content header
header: {
margin: 10, // Add margin
color: '#FFFFFF', // White color
fontFamily: 'Avenir', // Change font family
fontSize: 26, // Bigger font size
},
// Content text
text: {
marginHorizontal: 20, // Add horizontal margin
color: 'rgba(255, 255, 255, 0.75)', // Semi-transparent text
textAlign: 'center', // Center
fontFamily: 'Avenir',
fontSize: 18,
},
});