Skip to content

Commit

Permalink
Remove Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Sep 24, 2024
1 parent 8d8e46b commit fd54c52
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/desktop-client/src/components/common/Button2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React, {
forwardRef,
useMemo,
type ComponentPropsWithoutRef,
type ComponentType,
type ReactNode,
type SVGProps,
} from 'react';
import {
type ButtonRenderProps as ReactAriaButtonRenderProps,
Expand Down Expand Up @@ -135,21 +133,14 @@ const _getActiveStyles = (
type ButtonProps = ComponentPropsWithoutRef<typeof ReactAriaButton> & {
variant?: ButtonVariant;
bounce?: boolean;
Icon?: ComponentType<SVGProps<SVGSVGElement>>;
children?: ReactNode;
};

type ButtonVariant = 'normal' | 'primary' | 'bare' | 'menu' | 'menuSelected';

export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(props, ref) => {
const {
children,
variant = 'normal',
bounce = true,
Icon,
...restProps
} = props;
const { children, variant = 'normal', bounce = true, ...restProps } = props;

const variantWithDisabled: ButtonVariant | `${ButtonVariant}Disabled` =
props.isDisabled ? `${variant}Disabled` : variant;
Expand All @@ -174,10 +165,9 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
...styles.smallText,
'&[data-hovered]': _getHoveredStyles(variant),
'&[data-pressed]': _getActiveStyles(variant, bounce),
...(Icon ? { paddingLeft: 0 } : {}),
}),
),
[Icon, bounce, variant, variantWithDisabled],
[bounce, variant, variantWithDisabled],
);

const className = restProps.className;
Expand Down

0 comments on commit fd54c52

Please sign in to comment.