Skip to content

Commit

Permalink
CDC #60 - Adding customization for action button sizes to Items
Browse files Browse the repository at this point in the history
  • Loading branch information
dleadbetter committed Jan 9, 2024
1 parent 39ef2df commit b3a319b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/semantic-ui/src/components/Items.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class ItemsClass extends Component<Props, {}> {
icon={action.resolveIcon ? action.resolveIcon(item) : action.icon}
key={actionIndex}
onClick={action.onClick.bind(this, item)}
size={action.size}
/>
))}
{ this.isSelectable() && (
Expand Down Expand Up @@ -410,6 +411,7 @@ class ItemsClass extends Component<Props, {}> {
key={actionIndex}
icon={action.resolveIcon ? action.resolveIcon(item) : action.icon}
onClick={action.onClick.bind(this, item)}
size={action.size}
/>
))}
</Item.Content>
Expand Down
12 changes: 12 additions & 0 deletions packages/storybook/src/semantic-ui/Items.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,16 @@ export const ItemsPerRow = useDragDrop(() => (
renderHeader={(item) => <Header content={item.header} />}
renderMeta={(item) => item.id}
/>
));

export const ButtonSize = useDragDrop(() => (
<Items
actions={_.map(actions, (a) => ({ ...a, size: 'mini' }))}
items={items}
onCopy={action('copy')}
onDelete={action('delete')}
renderImage={(item) => <Image alt={item.image_alt} src={item.image} />}
renderHeader={(item) => <Header content={item.header} />}
renderMeta={(item) => item.id}
/>
));

0 comments on commit b3a319b

Please sign in to comment.