Skip to content

Commit

Permalink
Make colon conditional to recibing category in toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
isacoder committed Jan 10, 2025
1 parent 1487595 commit 40401c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const _ToggleButton = () => {

const disabled = boolean('Disabled', false);
const design = select('Design type', { Default: 'default', Basic: 'basic' }, 'basic');
const categoryLabel = text('Category Label', 'Layout:');
const categoryLabel = text('Category Label', 'Layout');
const options = object('Options', layoutOptions);
const showToggleValue = action('Button Value: ');

Expand Down
3 changes: 2 additions & 1 deletion packages/ui-lib/src/Filters/atoms/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const ToggleButton: React.FC<IToggleButton> = ({ options, categoryLabel, selecte

return (
<FilterButton icon={options[selectedIndex].icon} onClick={() => onToggleCallback(selectedIndex)} {...{design}} {...props}>
{`${categoryLabel} : ${options[selectedIndex].text}`}
{ categoryLabel && `${categoryLabel} : `}
{`${options[selectedIndex].text}`}
</FilterButton>
);
};
Expand Down

0 comments on commit 40401c8

Please sign in to comment.