Skip to content

Commit

Permalink
fix(Settings): extend description SettingsItem prop (#136)
Browse files Browse the repository at this point in the history
* fix(Settings): extend description SettingsItem prop

* chore: tune SettingsDemo
  • Loading branch information
Lunory authored Oct 13, 2023
1 parent f8f8491 commit c285014
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Settings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The components provides layouting functionality of settings panel with the follo
| renderTitleComponent | Function | | | Cusomt header of |
| align | 'top', 'center' | | 'center' | Item alignment |
| mode | 'row' | | | Layout for mobile. Title and control will be placed in row |
| description | string | | | Description of item |
| description | ReactNode | | | Description of item |

### Usage

Expand Down
2 changes: 1 addition & 1 deletion src/components/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface SettingsItemProps {
children: React.ReactNode;
withBadge?: boolean;
mode?: 'row';
description?: string;
description?: React.ReactNode;
}

export interface SettingsContextType
Expand Down
10 changes: 8 additions & 2 deletions src/components/Settings/__stories__/SettingsDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ export const SettingsComponent = React.memo(
</Settings.Item>
</Settings.Section>
<Settings.Section title="Common" withBadge={withBadge}>
<Settings.Item title="Default VCS">
<Settings.Item
title="Default VCS"
description={
<div>
<i>Description</i>
</div>
}
>
<RadioButton
value={settings.vcs}
onChange={(event) => {
Expand Down Expand Up @@ -131,7 +138,6 @@ export const SettingsComponent = React.memo(
renderTitleComponent={(highlightedTitle) => (
<div>
<span>{highlightedTitle || 'Theme'}</span>
<HelpPopover content="Change the look and feel of your application" />
</div>
)}
>
Expand Down

0 comments on commit c285014

Please sign in to comment.