mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
eslint fix
This commit is contained in:
parent
dfaac877fb
commit
fa4d51360b
81 changed files with 741 additions and 972 deletions
|
@ -1,14 +1,14 @@
|
|||
import classnames from "classnames";
|
||||
import * as styles from "./styles.scss";
|
||||
import React, { ButtonHTMLAttributes, DetailedHTMLProps, FC } from "react";
|
||||
import { Icon } from "~/components/input/Icon";
|
||||
import { IIcon } from "~/redux/types";
|
||||
import classnames from 'classnames';
|
||||
import React, { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react';
|
||||
import * as styles from './styles.scss';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { IIcon } from '~/redux/types';
|
||||
|
||||
type IButtonProps = DetailedHTMLProps<
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
> & {
|
||||
size?: "mini" | "normal" | "big" | "giant" | "micro";
|
||||
size?: 'mini' | 'normal' | 'big' | 'giant' | 'micro';
|
||||
iconLeft?: IIcon;
|
||||
iconRight?: IIcon;
|
||||
seamless?: boolean;
|
||||
|
@ -22,8 +22,8 @@ type IButtonProps = DetailedHTMLProps<
|
|||
};
|
||||
|
||||
export const Button: FC<IButtonProps> = ({
|
||||
className = "",
|
||||
size = "normal",
|
||||
className = '',
|
||||
size = 'normal',
|
||||
iconLeft,
|
||||
iconRight,
|
||||
children,
|
||||
|
@ -36,26 +36,25 @@ export const Button: FC<IButtonProps> = ({
|
|||
title,
|
||||
stretchy,
|
||||
...props
|
||||
}) =>
|
||||
React.createElement(seamless || non_submitting ? "div" : "button", {
|
||||
className: classnames(styles.button, className, styles[size], {
|
||||
red,
|
||||
grey,
|
||||
seamless,
|
||||
transparent,
|
||||
disabled: props.disabled,
|
||||
icon: (iconLeft || iconRight) && !title && !children,
|
||||
is_loading,
|
||||
stretchy
|
||||
}),
|
||||
children: [
|
||||
iconLeft && <Icon icon={iconLeft} size={20} key={0} />,
|
||||
title ? (
|
||||
<span key={1}>{title}</span>
|
||||
) : (
|
||||
(children && <span key={1}>{children}</span>) || null
|
||||
),
|
||||
iconRight && <Icon icon={iconRight} size={20} key={2} />
|
||||
],
|
||||
...props
|
||||
});
|
||||
}) => React.createElement(seamless || non_submitting ? 'div' : 'button', {
|
||||
className: classnames(styles.button, className, styles[size], {
|
||||
red,
|
||||
grey,
|
||||
seamless,
|
||||
transparent,
|
||||
disabled: props.disabled,
|
||||
icon: (iconLeft || iconRight) && !title && !children,
|
||||
is_loading,
|
||||
stretchy
|
||||
}),
|
||||
children: [
|
||||
iconLeft && <Icon icon={iconLeft} size={20} key={0} />,
|
||||
title ? (
|
||||
<span key={1}>{title}</span>
|
||||
) : (
|
||||
(children && <span key={1}>{children}</span>) || null
|
||||
),
|
||||
iconRight && <Icon icon={iconRight} size={20} key={2} />
|
||||
],
|
||||
...props
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue