Skip to content

Commit 7ee4bd4

Browse files
committed
settings screen [nfc]: Simplify comparing *Row layouts on this screen
Now, there's less clicking required to check, by reading code, that the three components NestedNavRow, SwitchRow, and InputRowRadioButtons will look reasonably uniform. That's nice when they're all seen together, as they are when they make a list of settings on the settings screen (with the last of these being a newcomer there; see recent commits). This also continues our progress toward removing the constants in miscStyles.
1 parent ec67df4 commit 7ee4bd4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/common/NestedNavRow.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export default function NestedNavRow(props: Props): Node {
3737
() =>
3838
createStyleSheet({
3939
container: {
40+
flexDirection: 'row',
41+
alignItems: 'center',
42+
paddingVertical: 8,
43+
paddingHorizontal: 16,
44+
4045
// Minimum touch target height (and width):
4146
// https://material.io/design/usability/accessibility.html#layout-and-typography
4247
minHeight: 48,
@@ -60,7 +65,7 @@ export default function NestedNavRow(props: Props): Node {
6065

6166
return (
6267
<Touchable onPress={onPress}>
63-
<View style={[styles.container, globalStyles.listItem]}>
68+
<View style={styles.container}>
6469
{!!Icon && <Icon size={24} style={styles.iconFromProps} />}
6570
<ZulipTextIntl style={styles.label} text={label} />
6671
<View style={globalStyles.rightItem}>

src/common/SwitchRow.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ type Props = $ReadOnly<{|
1717

1818
const componentStyles = createStyleSheet({
1919
container: {
20+
flexDirection: 'row',
21+
alignItems: 'center',
22+
paddingVertical: 8,
23+
paddingHorizontal: 16,
24+
2025
// For uniformity with other rows this might share a screen with, e.g.,
2126
// NestedNavRow and InputRowRadioButtons on the settings screen. See
2227
// height-related attributes on those rows.
@@ -37,7 +42,7 @@ export default function SwitchRow(props: Props): Node {
3742
const themeContext = useContext(ThemeContext);
3843

3944
return (
40-
<View style={[componentStyles.container, styles.listItem]}>
45+
<View style={componentStyles.container}>
4146
{!!Icon && <Icon size={24} style={[componentStyles.icon, { color: themeContext.color }]} />}
4247
<ZulipTextIntl text={label} style={styles.flexed} />
4348
<View style={styles.rightItem}>

0 commit comments

Comments
 (0)