-
Notifications
You must be signed in to change notification settings - Fork 3
/
App.js
71 lines (59 loc) · 1.49 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
import * as React from 'react';
import { Text, View, StyleSheet, Button, TouchableOpacity, Image } from 'react-native';
import { Constants } from 'expo';
// You can import from local files
import AssetExample from './components/AssetExample';
// or any pure javascript modules available in npm
import { Card } from 'react-native-elements'; // 0.19.1
export default class App extends React.Component {
constructor(){
super();
this.state = {
clickCount:0
}
}
onPressButton = () => {
this.setState({
clickCount: this.state.clickCount + 1
})
}
render() {
return (
<View style={styles.container}>
<Text style={styles.paragraph}>
Cookie Clicker App
</Text>
<Button
// onPress={this.onPressButton}
title="Button"
color="#841584"
/>
<TouchableOpacity>
<Image
style={{width: 70, height: 70}}
source={{uri: 'https://ubisafe.org/images/transparent-cookie-cartoon.png'}}
/>
</TouchableOpacity>
<Text style={styles.paragraph}>
{this.state.clickCount} Cookies
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
},
paragraph: {
margin: 24,
fontSize: 18,
fontWeight: 'bold',
textAlign: 'center',
color: '#34495e',
},
});