Adds more explanation in the changeset about the action and onClick props

This commit is contained in:
Juan Lulkin
2021-03-02 16:06:07 +01:00
parent a965a70548
commit bf169d0320
+19
View File
@@ -6,3 +6,22 @@
Adds onClick and other props to IconLinkVertical
Allows TriggerButton component to render when pager duty key is missing
Refactors TriggerButton and PagerDutyCard not to have shared state
Removes the `action` prop of the IconLinkVertical component while adding `onClick`. So instead of having an action including a button with onClick, now the whole component can be clickable making it easier to implement and having a better UX. Before:
```ts
const myLink : IconLinkVerticalProps = {
label: 'Click me',
action: <Button onClick={myAction} />,
icon: <MyIcon onClick={myAction} />,
}
```
After:
```ts
const myLink : IconLinkVerticalProps = {
label: 'Click me',
onClick: myAction,
icon: <MyIcon />,
}
```