Copy the changes to the core-components packages
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
@@ -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} />
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user