Skip to content

Commit

Permalink
Merge pull request #43006 from s77rt/ToggleSettingOptionRow-add-style…
Browse files Browse the repository at this point in the history
…-prop

Add bold style for switch labels in  workflow and more features pages
  • Loading branch information
Hayata Suenaga authored Jun 5, 2024
2 parents b56ac33 + 28cb521 commit bf1f2b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceMoreFeaturesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
<ToggleSettingOptionRow
icon={item.icon}
title={translate(item.titleTranslationKey)}
titleStyle={styles.textStrong}
subtitle={translate(item.subtitleTranslationKey)}
switchAccessibilityLabel={translate(item.subtitleTranslationKey)}
isActive={item.isActive}
Expand Down
7 changes: 5 additions & 2 deletions src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useMemo} from 'react';
import {View} from 'react-native';
import type {StyleProp, ViewStyle} from 'react-native';
import type {StyleProp, TextStyle, ViewStyle} from 'react-native';
import Icon from '@components/Icon';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import Switch from '@components/Switch';
Expand All @@ -22,6 +22,8 @@ type ToggleSettingOptionRowProps = {
shouldPlaceSubtitleBelowSwitch?: boolean;
/** Used to apply styles to the outermost container */
wrapperStyle?: StyleProp<ViewStyle>;
/** Used to apply styles to the Title */
titleStyle?: StyleProp<TextStyle>;
/** Whether the option is enabled or not */
isActive: boolean;
/** Callback to be called when the switch is toggled */
Expand Down Expand Up @@ -49,6 +51,7 @@ function ToggleSettingOptionRow({
switchAccessibilityLabel,
shouldPlaceSubtitleBelowSwitch,
wrapperStyle,
titleStyle,
onToggle,
subMenuItems,
isActive,
Expand Down Expand Up @@ -85,7 +88,7 @@ function ToggleSettingOptionRow({
/>
)}
<View style={[styles.flexColumn, styles.flex1]}>
<Text style={[styles.textNormal, styles.lh20]}>{title}</Text>
<Text style={[styles.textNormal, styles.lh20, titleStyle]}>{title}</Text>
{!shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView}
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ function WorkspaceWorkflowsPage({policy, betas, route}: WorkspaceWorkflowsPagePr
<ToggleSettingOptionRow
icon={item.icon}
title={item.title}
titleStyle={styles.textStrong}
subtitle={item.subtitle}
switchAccessibilityLabel={item.switchAccessibilityLabel}
onToggle={item.onToggle}
Expand Down

0 comments on commit bf1f2b8

Please sign in to comment.