mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(home): change layout of env tile [EE-4479] (#8061)
This commit is contained in:
parent
b48aa1274d
commit
eba5879ec8
29 changed files with 717 additions and 445 deletions
33
app/react/components/LinkButton.tsx
Normal file
33
app/react/components/LinkButton.tsx
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { ComponentProps } from 'react';
|
||||
|
||||
import { Button } from './buttons';
|
||||
import { Link } from './Link';
|
||||
|
||||
export function LinkButton({
|
||||
to,
|
||||
params,
|
||||
disabled,
|
||||
children,
|
||||
...props
|
||||
}: ComponentProps<typeof Button> & ComponentProps<typeof Link>) {
|
||||
const button = (
|
||||
<Button
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
size="medium"
|
||||
disabled={disabled}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
|
||||
if (disabled) {
|
||||
return button;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link to={to} params={params} className="text-inherit hover:no-underline">
|
||||
{button}
|
||||
</Link>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue