Remove size from CodiconButton
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user