Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit cf430b3

Browse files
valentinewallacetanx
authored andcommitted
Add copy prop to SettingItem component.
1 parent 2b520f5 commit cf430b3

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

src/component/setting.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,20 @@ const iStyles = StyleSheet.create({
8585
item: {
8686
height: 60,
8787
},
88-
name: {
88+
left: {
8989
flex: 1,
90+
},
91+
name: {
9092
color: color.grey,
9193
fontSize: font.sizeSub,
9294
},
95+
copy: {
96+
width: '80%',
97+
fontSize: font.sizeS,
98+
lineHeight: font.lineHeightS,
99+
color: color.greyListLabel,
100+
opacity: 0.74,
101+
},
93102
lbl: {
94103
fontSize: font.sizeS,
95104
color: color.greyListLabel,
@@ -100,9 +109,22 @@ const iStyles = StyleSheet.create({
100109
},
101110
});
102111

103-
export const SettingItem = ({ name, onSelect, label, arrow, children }) => (
104-
<ListItem style={iStyles.item} onSelect={onSelect}>
105-
<Text style={iStyles.name}>{name}</Text>
112+
export const SettingItem = ({
113+
name,
114+
copy,
115+
onSelect,
116+
label,
117+
arrow,
118+
children,
119+
}) => (
120+
<ListItem
121+
style={[iStyles.item, copy ? { height: 80 } : null]}
122+
onSelect={onSelect}
123+
>
124+
<View style={iStyles.left}>
125+
<Text style={iStyles.name}>{name}</Text>
126+
{copy ? <Text style={iStyles.copy}>{copy}</Text> : null}
127+
</View>
106128
{label ? <Text style={iStyles.lbl}>{label}</Text> : null}
107129
{children}
108130
{arrow ? (
@@ -115,6 +137,7 @@ export const SettingItem = ({ name, onSelect, label, arrow, children }) => (
115137

116138
SettingItem.propTypes = {
117139
name: PropTypes.string.isRequired,
140+
copy: PropTypes.string,
118141
onSelect: PropTypes.func,
119142
label: PropTypes.string,
120143
arrow: PropTypes.bool,

0 commit comments

Comments
 (0)