-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
58 lines (42 loc) · 1.25 KB
/
test.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
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
export default class CameraFilter extends React.Component {
camera = null;
constructor(props) {
super(props)
this.state = {
key: [],
}
}
onPressButton1(key) {
return 1
console.log(key)
};
onPressButton2(key) {
return 2
console.log(key)
};
render() {
const filters = () => {
switch (this.key) {
case 1:
return faces.map(face => < Glasses key = { face.faceID } face = { face } />)
case 2:
return faces.map(face => < Nose key = { face.faceID } face = { face } />)
}
}
return (
<View>
{filters()}
<Button
onPress={this.onPressButton1}
title="Press Me"
/>
<Button
onPress={this.onPressButton2}
title="Press Me"
/>
</View>
);
}
}