Copy the changes to the core-components packages

Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
Dominik Henneke
2021-06-15 11:09:04 +02:00
parent 938aee2fbd
commit 740503d88f
2 changed files with 9 additions and 6 deletions
+1
View File
@@ -1,5 +1,6 @@
---
'@backstage/core': patch
'@backstage/core-components': patch
---
Use the Backstage `Link` component in the `Button`
@@ -14,17 +14,19 @@
* limitations under the License.
*/
import React, { ComponentProps } from 'react';
import { Button as MaterialButton } from '@material-ui/core';
import { Link as RouterLink } from 'react-router-dom';
import {
Button as MaterialButton,
ButtonProps as MaterialButtonProps,
} from '@material-ui/core';
import React from 'react';
import { Link, LinkProps } from '../Link';
type Props = ComponentProps<typeof MaterialButton> &
ComponentProps<typeof RouterLink>;
type Props = MaterialButtonProps & Omit<LinkProps, 'variant' | 'color'>;
/**
* Thin wrapper on top of material-ui's Button component
* Makes the Button to utilise react-router
*/
export const Button = React.forwardRef<any, Props>((props, ref) => (
<MaterialButton ref={ref} component={RouterLink} {...props} />
<MaterialButton ref={ref} component={Link} {...props} />
));