2.3
This commit is contained in:
parent
ed52d17b4b
commit
c2dce96be4
File diff suppressed because one or more lines are too long
@ -53,6 +53,8 @@
|
||||
"react-toastify": "^11.0.2",
|
||||
"swr": "^1.3.0",
|
||||
"uuid": "^9.0.0"
|
||||
"@shadcn/ui": "^0.1.0",
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
|
||||
@ -4,6 +4,8 @@ import { getButtonColor } from '../colors';
|
||||
import BaseIcon from './BaseIcon';
|
||||
import type { ColorButtonKey } from '../interfaces';
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
import ShadcnButtonWrapper from './ShadcnButton';
|
||||
|
||||
|
||||
type Props = {
|
||||
label?: string;
|
||||
@ -84,23 +86,17 @@ export default function BaseButton({
|
||||
</>
|
||||
);
|
||||
|
||||
if (href && !disabled) {
|
||||
return (
|
||||
<Link href={href} target={target} className={componentClassString}>
|
||||
<ShadcnButtonWrapper
|
||||
href={href}
|
||||
target={target}
|
||||
type={type ?? 'button'}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
className={componentClassString}
|
||||
>
|
||||
{componentChildren}
|
||||
</Link>
|
||||
</ShadcnButtonWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
return React.createElement(
|
||||
asAnchor ? 'a' : 'button',
|
||||
{
|
||||
className: componentClassString,
|
||||
type: type ?? 'button',
|
||||
target,
|
||||
disabled,
|
||||
onClick,
|
||||
},
|
||||
componentChildren,
|
||||
);
|
||||
}
|
||||
|
||||
10
frontend/src/components/ShadcnButton.tsx
Normal file
10
frontend/src/components/ShadcnButton.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import { Button as ShadcnButton } from '@shadcn/ui';
|
||||
|
||||
interface ButtonProps extends React.ComponentProps<typeof ShadcnButton> {}
|
||||
|
||||
const ShadcnButtonWrapper: React.FC<ButtonProps> = (props) => {
|
||||
return <ShadcnButton {...props} />;
|
||||
};
|
||||
|
||||
export default ShadcnButtonWrapper;
|
||||
@ -72,6 +72,8 @@ module.exports = {
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
require('@tailwindcss/typography'),
|
||||
require('@shadcn/ui'),
|
||||
|
||||
plugin(function ({ matchUtilities, theme }) {
|
||||
matchUtilities(
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user