Skip to content

Commit 278c12b

Browse files
authored
v5.2.5 (#614)
* Customize each button with buttonProps * v5.2.5
1 parent a5577c6 commit 278c12b

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "5.2.4",
3+
"version": "5.2.5",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/button/buttonGroup.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ const Content = ({ children }) => {
3232
)
3333
}
3434

35-
const RadioButtons = ({ items, value, isMulti, buttonProps = {}, onChange }) => {
35+
const RadioButtons = ({
36+
items,
37+
value,
38+
isMulti,
39+
ButtonComponent = Button,
40+
buttonProps = {},
41+
onChange,
42+
}) => {
3643
return (
3744
<>
3845
{items.map((item, index) => {
@@ -54,14 +61,15 @@ const RadioButtons = ({ items, value, isMulti, buttonProps = {}, onChange }) =>
5461
}
5562

5663
return (
57-
<Button
64+
<ButtonComponent
5865
key={item.value}
5966
label={item.label}
6067
onClick={onClick}
6168
{...(item.title ? { title: item.title } : {})}
6269
{...(!isSelected ? { flavour: "hollow" } : {})}
6370
{...buttonGroupProps}
6471
{...buttonProps}
72+
{...(item.buttonProps || {})}
6573
/>
6674
)
6775
})}
@@ -75,6 +83,7 @@ export const ButtonGroup = ({
7583
isMulti,
7684
onChange = noop,
7785
children,
86+
ButtonComponent,
7887
buttonProps,
7988
...props
8089
}) => (
@@ -85,6 +94,7 @@ export const ButtonGroup = ({
8594
value={value}
8695
isMulti={isMulti}
8796
onChange={onChange}
97+
ButtonComponent={ButtonComponent}
8898
buttonProps={buttonProps}
8999
/>
90100
) : (

0 commit comments

Comments
 (0)