/
MenuButton.js
50 lines (42 loc) · 1.22 KB
/
MenuButton.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
import React, { Component } from 'react';
import { Image, TouchableOpacity } from 'react-native';
import imageAddProfile from '../../images/add_profile.png';
import imageSettings from '../../images/extra.png';
import imageEditProfiles from '../../images/edit.png';
import imageEditProfilesInProgress from '../../images/edit_in_progress.png';
import imageRemoveProfile from '../../images/remove_profile.png';
export default class MenuButton extends Component {
render() {
let image;
switch(this.props.image)
{
case 'add_profile':
image = imageAddProfile;
break;
case 'settings':
image = imageSettings;
break;
case 'edit_profiles':
image = imageEditProfiles;
break;
case 'edit_profiles_in_progress':
image = imageEditProfilesInProgress;
break;
case 'remove_profile':
image = imageRemoveProfile;
break;
}
return (
<TouchableOpacity
onPress={this.props.action}
accessible={this.props.accessible}
accessibilityLabel={this.props.accessibilityLabel}
>
<Image
style={this.props.style}
source={image}
/>
</TouchableOpacity>
);
}
}