Skip to content

Commit 55548ac

Browse files
committed
NestedNavRow [nfc]: Rename label to title
In preparation for adding a `subtitle` prop.
1 parent 6f4b179 commit 55548ac

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/common/NestedNavRow.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ type Props = $ReadOnly<{|
1616
+color?: string,
1717
|},
1818

19-
label: LocalizableReactText,
19+
title: LocalizableReactText,
2020

2121
// TODO: Should we make this unconfigurable? Should we have two reusable
2222
// components, with and without this?
23-
labelBoldUppercase?: true,
23+
titleBoldUppercase?: true,
2424

2525
/** Use this to navigate to a "nested" screen. */
2626
onPress: () => void,
@@ -33,7 +33,7 @@ type Props = $ReadOnly<{|
3333
* selectable option row instead, use `SelectableOptionRow`.
3434
*/
3535
export default function NestedNavRow(props: Props): Node {
36-
const { label, labelBoldUppercase, onPress, icon } = props;
36+
const { title, titleBoldUppercase, onPress, icon } = props;
3737

3838
const themeContext = useContext(ThemeContext);
3939

@@ -55,23 +55,23 @@ export default function NestedNavRow(props: Props): Node {
5555
marginRight: 8,
5656
color: icon?.color ?? themeContext.color,
5757
},
58-
label: {
59-
...(labelBoldUppercase ? { textTransform: 'uppercase', fontWeight: '500' } : undefined),
58+
title: {
59+
...(titleBoldUppercase ? { textTransform: 'uppercase', fontWeight: '500' } : undefined),
6060
},
6161
iconRightFacingArrow: {
6262
textAlign: 'center',
6363
marginLeft: 8,
6464
color: themeContext.color,
6565
},
6666
}),
67-
[themeContext, icon, labelBoldUppercase],
67+
[themeContext, icon, titleBoldUppercase],
6868
);
6969

7070
return (
7171
<Touchable onPress={onPress}>
7272
<View style={styles.container}>
7373
{!!icon && <icon.Component size={24} style={styles.iconFromProps} />}
74-
<ZulipTextIntl style={styles.label} text={label} />
74+
<ZulipTextIntl style={styles.title} text={title} />
7575
<View style={globalStyles.rightItem}>
7676
<IconRight size={24} style={styles.iconRightFacingArrow} />
7777
</View>

src/diagnostics/DiagnosticsScreen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ export default function DiagnosticsScreen(props: Props): Node {
3131
<ZulipText style={styles.versionLabel} text={`v${nativeApplicationVersion ?? '?.?.?'}`} />
3232
<OptionDivider />
3333
<NestedNavRow
34-
label="Variables"
34+
title="Variables"
3535
onPress={() => {
3636
navigation.push('variables');
3737
}}
3838
/>
3939
<NestedNavRow
40-
label="Timing"
40+
title="Timing"
4141
onPress={() => {
4242
navigation.push('timing');
4343
}}
4444
/>
4545
<NestedNavRow
46-
label="Storage"
46+
title="Storage"
4747
onPress={() => {
4848
navigation.push('storage');
4949
}}
5050
/>
5151
<NestedNavRow
52-
label="Debug"
52+
title="Debug"
5353
onPress={() => {
5454
navigation.push('debug');
5555
}}

src/settings/LegalScreen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function LegalScreen(props: Props): Node {
3434

3535
return (
3636
<Screen title="Legal">
37-
<NestedNavRow label="Zulip terms" onPress={openZulipPolicies} />
37+
<NestedNavRow title="Zulip terms" onPress={openZulipPolicies} />
3838
<NestedNavRow
3939
// These are really terms set by the server admin responsible for
4040
// hosting the org, and that server admin may or may not represent
@@ -46,7 +46,7 @@ export default function LegalScreen(props: Props): Node {
4646
// at the other link).
4747
// - These terms will apply to all users in the org, in all cases.
4848
// We should link to them.
49-
label={{
49+
title={{
5050
text: 'Terms for {realmName}',
5151
values: { realmName: <ZulipText style={{ fontWeight: 'bold' }} text={realmName} /> },
5252
}}

src/settings/NotificationsScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function NotificationsScreen(props: Props): Node {
8787
return (
8888
<Screen title="Notifications">
8989
<ServerPushSetupBanner isDismissable={false} />
90-
<NestedNavRow label="System settings for Zulip" onPress={handleSystemSettingsPress} />
90+
<NestedNavRow title="System settings for Zulip" onPress={handleSystemSettingsPress} />
9191
<SwitchRow
9292
label="Notifications when offline"
9393
value={offlineNotification}

src/settings/SettingsScreen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,28 @@ export default function SettingsScreen(props: Props): Node {
6969
/>
7070
<NestedNavRow
7171
icon={{ Component: IconNotifications }}
72-
label="Notifications"
72+
title="Notifications"
7373
onPress={() => {
7474
navigation.push('notifications');
7575
}}
7676
/>
7777
<NestedNavRow
7878
icon={{ Component: IconLanguage }}
79-
label="Language"
79+
title="Language"
8080
onPress={() => {
8181
navigation.push('language');
8282
}}
8383
/>
8484
<NestedNavRow
8585
icon={{ Component: IconDiagnostics }}
86-
label="Diagnostics"
86+
title="Diagnostics"
8787
onPress={() => {
8888
navigation.push('diagnostics');
8989
}}
9090
/>
9191
<NestedNavRow
9292
icon={{ Component: IconMoreHorizontal }}
93-
label="Legal"
93+
title="Legal"
9494
onPress={() => {
9595
navigation.push('legal');
9696
}}

src/streams/SubscriptionsScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function AllStreamsButton(props: FooterProps): Node {
4646
navigation.push('all-streams');
4747
}, [navigation]);
4848

49-
return <NestedNavRow label="All streams" labelBoldUppercase onPress={handlePressAllScreens} />;
49+
return <NestedNavRow title="All streams" titleBoldUppercase onPress={handlePressAllScreens} />;
5050
}
5151

5252
export default function SubscriptionsScreen(props: Props): Node {

0 commit comments

Comments
 (0)