Remove size from CodiconButton

This commit is contained in:
Koen Vlaswinkel
2023-10-06 16:48:49 +02:00
parent 29aa4a3f29
commit 3b6263fb07

View File

@@ -2,14 +2,11 @@ import * as React from "react";
import { styled } from "styled-components"; import { styled } from "styled-components";
import classNames from "classnames"; import classNames from "classnames";
type Size = "x-small" | "small" | "medium" | "large" | "x-large"; const StyledButton = styled.button`
const StyledButton = styled.button<{ size: Size }>`
background: none; background: none;
color: var(--vscode-textLink-foreground); color: var(--vscode-textLink-foreground);
border: none; border: none;
cursor: pointer; cursor: pointer;
font-size: ${(props) => props.size ?? "1em"};
padding: 0; padding: 0;
vertical-align: text-bottom; vertical-align: text-bottom;
@@ -20,14 +17,12 @@ const StyledButton = styled.button<{ size: Size }>`
`; `;
export const CodiconButton = ({ export const CodiconButton = ({
size,
onClick, onClick,
className, className,
name, name,
label, label,
disabled, disabled,
}: { }: {
size?: Size;
onClick: (e: React.MouseEvent) => void; onClick: (e: React.MouseEvent) => void;
className?: string; className?: string;
name: string; name: string;
@@ -35,7 +30,6 @@ export const CodiconButton = ({
disabled?: boolean; disabled?: boolean;
}) => ( }) => (
<StyledButton <StyledButton
size={size}
onClick={onClick} onClick={onClick}
className={className} className={className}
disabled={disabled} disabled={disabled}