mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
feat: modify button component
This commit is contained in:
@@ -24,12 +24,12 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
icon,
|
||||
type = 'default',
|
||||
children,
|
||||
bold = false,
|
||||
...props
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const { iconSize } = getSize(size);
|
||||
console.log('type', type);
|
||||
|
||||
return (
|
||||
<StyledButton
|
||||
@@ -42,6 +42,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
hoverStyle={hoverStyle}
|
||||
// @ts-ignore
|
||||
type={type}
|
||||
bold={bold}
|
||||
{...props}
|
||||
>
|
||||
{icon &&
|
||||
|
||||
@@ -19,4 +19,5 @@ export type ButtonProps = PropsWithChildren &
|
||||
icon?: ReactElement;
|
||||
shape?: 'default' | 'round' | 'circle';
|
||||
type?: 'primary' | 'warning' | 'danger' | 'default';
|
||||
bold?: boolean;
|
||||
};
|
||||
|
||||
@@ -65,6 +65,7 @@ export const StyledButton = styled.button<
|
||||
| 'hoverStyle'
|
||||
| 'shape'
|
||||
| 'type'
|
||||
| 'bold'
|
||||
>
|
||||
>(
|
||||
({
|
||||
@@ -74,6 +75,7 @@ export const StyledButton = styled.button<
|
||||
hoverBackground,
|
||||
hoverColor,
|
||||
hoverStyle,
|
||||
bold = false,
|
||||
shape = 'default',
|
||||
type = 'default',
|
||||
}) => {
|
||||
@@ -91,6 +93,7 @@ export const StyledButton = styled.button<
|
||||
// TODO: Implement circle shape
|
||||
borderRadius: shape === 'default' ? borderRadius : height / 2,
|
||||
fontSize,
|
||||
fontWeight: bold ? '500' : '400',
|
||||
'.affine-button-icon': {
|
||||
color: theme.colors.iconColor,
|
||||
},
|
||||
|
||||
@@ -41,6 +41,7 @@ export const Confirm = ({
|
||||
<StyledButtonWrapper>
|
||||
<Button
|
||||
shape="round"
|
||||
bold={true}
|
||||
onClick={() => {
|
||||
setOpen(false);
|
||||
onCancel?.();
|
||||
@@ -52,6 +53,7 @@ export const Confirm = ({
|
||||
<Button
|
||||
type={confirmType}
|
||||
shape="round"
|
||||
bold={true}
|
||||
onClick={() => {
|
||||
setOpen(false);
|
||||
onConfirm?.();
|
||||
|
||||
@@ -4,7 +4,6 @@ import { StyledTableCell } from './styles';
|
||||
|
||||
export const TableCell = ({
|
||||
children,
|
||||
ellipsis,
|
||||
...props
|
||||
}: PropsWithChildren<
|
||||
TableCellProps & HTMLAttributes<HTMLTableCellElement>
|
||||
|
||||
Reference in New Issue
Block a user