-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
executable file
·59 lines (49 loc) · 1.28 KB
/
Copy pathApp.js
File metadata and controls
executable file
·59 lines (49 loc) · 1.28 KB
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
import React from 'react';
import { KeyboardAvoidingView } from 'react-native';
import Counter from './components/Counter'
import Selectors from './components/Selectors'
import styles from './components/styles'
export default class App extends React.Component {
constructor() {
super()
this.state = {
work: {
minutes: 25,
secondes: 0,
message: "Time to work"
},
chill: {
minutes : 5,
secondes: 0,
message: "Time to chill"
}
}
}
workFormSelector = (min, sec) => {
this.setState({
work: {
minutes: Number(min),
secondes: Number(sec),
message: "Time to work"
}
})
}
chillFormSelector = (min, sec) => {
this.setState({
chill: {
minutes: Number(min),
secondes: Number(sec),
message: "Time to chill"
}
})
}
render() {
return (
<KeyboardAvoidingView style={styles.container} behavior="padding">
<Counter timingWork={this.state.work} timingChill={this.state.chill} />
<Selectors status="work" time={this.state.work} callback={this.workFormSelector} />
<Selectors status="chill" time={this.state.chill} callback={this.chillFormSelector} />
</KeyboardAvoidingView>
)
}
}