This commit is contained in:
Flatlogic Bot 2025-06-15 10:47:49 +00:00
parent ed52d17b4b
commit c2dce96be4
5 changed files with 30 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@ -53,6 +53,8 @@
"react-toastify": "^11.0.2", "react-toastify": "^11.0.2",
"swr": "^1.3.0", "swr": "^1.3.0",
"uuid": "^9.0.0" "uuid": "^9.0.0"
"@shadcn/ui": "^0.1.0",
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/forms": "^0.5.7", "@tailwindcss/forms": "^0.5.7",

View File

@ -4,6 +4,8 @@ import { getButtonColor } from '../colors';
import BaseIcon from './BaseIcon'; import BaseIcon from './BaseIcon';
import type { ColorButtonKey } from '../interfaces'; import type { ColorButtonKey } from '../interfaces';
import { useAppSelector } from '../stores/hooks'; import { useAppSelector } from '../stores/hooks';
import ShadcnButtonWrapper from './ShadcnButton';
type Props = { type Props = {
label?: string; label?: string;
@ -84,23 +86,17 @@ export default function BaseButton({
</> </>
); );
if (href && !disabled) { return (
return ( <ShadcnButtonWrapper
<Link href={href} target={target} className={componentClassString}> href={href}
target={target}
type={type ?? 'button'}
disabled={disabled}
onClick={onClick}
className={componentClassString}
>
{componentChildren} {componentChildren}
</Link> </ShadcnButtonWrapper>
); );
}
return React.createElement(
asAnchor ? 'a' : 'button',
{
className: componentClassString,
type: type ?? 'button',
target,
disabled,
onClick,
},
componentChildren,
);
} }

View 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;

View File

@ -72,6 +72,8 @@ module.exports = {
plugins: [ plugins: [
require('@tailwindcss/forms'), require('@tailwindcss/forms'),
require('@tailwindcss/typography'), require('@tailwindcss/typography'),
require('@shadcn/ui'),
plugin(function ({ matchUtilities, theme }) { plugin(function ({ matchUtilities, theme }) {
matchUtilities( matchUtilities(
{ {