-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonRow.js
More file actions
executable file
·58 lines (47 loc) · 1.65 KB
/
ButtonRow.js
File metadata and controls
executable file
·58 lines (47 loc) · 1.65 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
56
57
import React from 'react';
import { StyleSheet, Text, View, Button, Dimensions } from 'react-native';
import CustomButton from './CustomButton';
export default class ButtonRow extends React.Component {
createCols = () => {
let cols = []
for (let i = 0; i < this.props.nrOfCols; i++) {
if (i == this.props.columnNumber) {
cols.push(<CustomButton
rowNumber={this.props.rowNumber}
columnNumber={i}
isCounting='true'
callbackFunc={this.props.callbackFunc}
doneWithTest={this.props.doneWithTest}
highestResult={this.props.highestResult}
lowestResult={this.props.lowestResult}
key={i}/>)
} else {
cols.push(<CustomButton
rowNumber={this.props.rowNumber}
columnNumber={i}
isCounting='false'
callbackFunc={this.props.callbackFunc}
doneWithTest={this.props.doneWithTest}
highestResult={this.props.highestResult}
lowestResult={this.props.lowestResult}
key={i} />)
}
}
return cols;
}
render() {
return (
<View style={styles.buttonRow} >
{this.createCols()}
</View>
)
}
}
let deviceWidth = Dimensions.get('window').width
let deviceHeight = Dimensions.get('window').height
const styles = StyleSheet.create({
buttonRow: {
flex: 1,
flexDirection: 'row'
}
});