Skip to content

Commit 9680d46

Browse files
committed
NestedNavRow [nfc]: Offer subtitle prop
1 parent 55548ac commit 9680d46

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/common/NestedNavRow.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Props = $ReadOnly<{|
1717
|},
1818

1919
title: LocalizableReactText,
20+
subtitle?: LocalizableReactText,
2021

2122
// TODO: Should we make this unconfigurable? Should we have two reusable
2223
// components, with and without this?
@@ -33,7 +34,7 @@ type Props = $ReadOnly<{|
3334
* selectable option row instead, use `SelectableOptionRow`.
3435
*/
3536
export default function NestedNavRow(props: Props): Node {
36-
const { title, titleBoldUppercase, onPress, icon } = props;
37+
const { title, subtitle, titleBoldUppercase, onPress, icon } = props;
3738

3839
const themeContext = useContext(ThemeContext);
3940

@@ -55,9 +56,16 @@ export default function NestedNavRow(props: Props): Node {
5556
marginRight: 8,
5657
color: icon?.color ?? themeContext.color,
5758
},
59+
textWrapper: {
60+
flex: 1,
61+
},
5862
title: {
5963
...(titleBoldUppercase ? { textTransform: 'uppercase', fontWeight: '500' } : undefined),
6064
},
65+
subtitle: {
66+
fontWeight: '300',
67+
fontSize: 13,
68+
},
6169
iconRightFacingArrow: {
6270
textAlign: 'center',
6371
marginLeft: 8,
@@ -71,7 +79,10 @@ export default function NestedNavRow(props: Props): Node {
7179
<Touchable onPress={onPress}>
7280
<View style={styles.container}>
7381
{!!icon && <icon.Component size={24} style={styles.iconFromProps} />}
74-
<ZulipTextIntl style={styles.title} text={title} />
82+
<View style={styles.textWrapper}>
83+
<ZulipTextIntl style={styles.title} text={title} />
84+
{subtitle !== undefined && <ZulipTextIntl style={styles.subtitle} text={subtitle} />}
85+
</View>
7586
<View style={globalStyles.rightItem}>
7687
<IconRight size={24} style={styles.iconRightFacingArrow} />
7788
</View>

0 commit comments

Comments
 (0)