Fix ButtonLink and edit request names

This commit is contained in:
Gregory Schier
2023-03-13 00:11:23 -07:00
parent 4ad91b4553
commit 7ad1bd54ac
4 changed files with 66 additions and 35 deletions

View File

@@ -1,5 +1,4 @@
import classnames from 'classnames';
import { Link } from 'preact-router';
import type { ButtonProps } from './Button';
import { Button } from './Button';
@@ -8,10 +7,12 @@ type Props = ButtonProps & {
};
export function ButtonLink({ href, className, ...buttonProps }: Props) {
const linkProps = { href };
return (
<Link {...linkProps}>
<Button className={classnames(className, 'w-full')} tabIndex={-1} {...buttonProps} />
</Link>
<Button
href={href}
className={classnames(className, 'w-full')}
tabIndex={-1}
{...buttonProps}
/>
);
}