forked from dooley1001/hoard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectableImageRow.js
More file actions
65 lines (62 loc) · 1.41 KB
/
Copy pathSelectableImageRow.js
File metadata and controls
65 lines (62 loc) · 1.41 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
58
59
60
61
62
63
64
65
import React from 'react';
import PropTypes from 'prop-types';
import { View, Image, Text, TouchableOpacity, StyleSheet } from 'react-native';
export default function SelectableImageRow({
onPress,
selected,
image,
title,
subtitle,
}) {
return (
<TouchableOpacity onPress={onPress}>
<View
style={[
styles.container,
{ borderColor: selected ? 'rgba(0, 193, 255, 0.5)' : 'transparent' },
]}
>
<Image style={styles.image} source={image} />
<View>
<Text style={styles.title}>{title}</Text>
<Text style={styles.subtitle}>{subtitle}</Text>
</View>
</View>
</TouchableOpacity>
);
}
SelectableImageRow.propTypes = {
image: Image.propTypes.source,
selected: PropTypes.bool.isRequired,
subtitle: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
};
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
marginVertical: 10,
alignItems: 'center',
borderRadius: 10,
padding: 5,
borderWidth: 1,
backgroundColor: "rgba(255, 255, 255, 0.075)",
},
image: {
width: 30,
height: 30,
borderRadius: 15,
resizeMode: 'contain',
marginRight: 10,
},
title: {
fontSize: 16,
fontWeight: '500',
color: "#8cbcbd"
},
subtitle: {
fontSize: 12,
fontWeight: '100',
color: "#8cbcbd"
},
});