0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed button bug in Admin design system

refs. https://github.com/TryGhost/Team/issues/3150
This commit is contained in:
Peter Zimon 2023-05-17 14:02:19 +02:00
parent d1c96dd9c8
commit 9e9200022c
2 changed files with 9 additions and 3 deletions

View file

@ -6,7 +6,13 @@ import {ButtonColors} from './Button';
const meta = {
title: 'Global / Button',
component: Button,
tags: ['autodocs']
tags: ['autodocs'],
argTypes: {
color: {
control: 'select',
options: ButtonColors
}
}
} satisfies Meta<typeof Button>;
export default meta;

View file

@ -29,9 +29,9 @@ const Button: React.FC<ButtonProps> = ({
}) => {
let buttonColor: string;
if (!color) {
color = ButtonColors.Black;
color = ButtonColors.Clear;
}
const fontWeight: string = ((link && color !== ButtonColors.Black) || (!link && color !== ButtonColors.Clear)) ? 'font-bold' : 'font-semibold';
const fontWeight: string = ((link && color !== ButtonColors.Clear && color !== ButtonColors.Black) || (!link && color !== ButtonColors.Clear)) ? 'font-bold' : 'font-semibold';
const padding: string = !link ? 'px-4 h-9' : '';
switch (color) {