mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup Lens repo with tighter linting
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
1 parent
e468105143
commit
b1ff34879a
470 files changed
+8447
-7443
No files matched your search
@@ -22,10 +22,26 @@ export class Button extends React.PureComponent<ButtonProps, {}> {
|
||||
private link: HTMLAnchorElement;
|
||||
private button: HTMLButtonElement;
|
||||
|
||||
render() {
|
||||
const { className, waiting, label, primary, accent, plain, hidden, active, big, round, tooltip, children, ...props } = this.props;
|
||||
render(): JSX.Element {
|
||||
const {
|
||||
className,
|
||||
waiting,
|
||||
label,
|
||||
primary,
|
||||
accent,
|
||||
plain,
|
||||
hidden,
|
||||
active,
|
||||
big,
|
||||
round,
|
||||
tooltip: _tooltip,
|
||||
children,
|
||||
...props
|
||||
} = this.props;
|
||||
const btnProps = props as Partial<ButtonProps>;
|
||||
if (hidden) return null;
|
||||
if (hidden) {
|
||||
return null;
|
||||
}
|
||||
|
||||
btnProps.className = cssNames('Button', className, {
|
||||
waiting, primary, accent, plain, active, big, round,
|
||||
@@ -41,17 +57,21 @@ export class Button extends React.PureComponent<ButtonProps, {}> {
|
||||
// render as link
|
||||
if (this.props.href) {
|
||||
return (
|
||||
<a {...btnProps} ref={e => this.link = e}>
|
||||
<a {...btnProps} ref={(e): void => {
|
||||
this.link = e;
|
||||
}}>
|
||||
{btnContent}
|
||||
</a>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// render as button
|
||||
return (
|
||||
<button type="button" {...btnProps} ref={e => this.button = e}>
|
||||
<button type="button" {...btnProps} ref={(e): void => {
|
||||
this.button = e;
|
||||
}}>
|
||||
{btnContent}
|
||||
</button>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
export * from './button'
|
||||
export * from './button';
|
||||
Reference in new issue
Block a user