mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
apply eslint and prettier rules
This commit is contained in:
@@ -38,18 +38,7 @@ class Button extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
label,
|
||||
loading,
|
||||
disabled,
|
||||
type,
|
||||
color,
|
||||
className,
|
||||
icon,
|
||||
fullWidth,
|
||||
reducedMobile,
|
||||
children
|
||||
} = this.props;
|
||||
const { label, loading, disabled, type, color, className, icon, fullWidth, reducedMobile, children } = this.props;
|
||||
const loadingClass = loading ? "is-loading" : "";
|
||||
const fullWidthClass = fullWidth ? "is-fullwidth" : "";
|
||||
const reducedMobileClass = reducedMobile ? "is-reduced-mobile" : "";
|
||||
@@ -59,14 +48,7 @@ class Button extends React.Component<Props> {
|
||||
type={type}
|
||||
disabled={disabled}
|
||||
onClick={this.onClick}
|
||||
className={classNames(
|
||||
"button",
|
||||
"is-" + color,
|
||||
loadingClass,
|
||||
fullWidthClass,
|
||||
reducedMobileClass,
|
||||
className
|
||||
)}
|
||||
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, reducedMobileClass, className)}
|
||||
>
|
||||
<span className="icon is-medium">
|
||||
<Icon name={icon} color="inherit" />
|
||||
@@ -83,13 +65,7 @@ class Button extends React.Component<Props> {
|
||||
type={type}
|
||||
disabled={disabled}
|
||||
onClick={this.onClick}
|
||||
className={classNames(
|
||||
"button",
|
||||
"is-" + color,
|
||||
loadingClass,
|
||||
fullWidthClass,
|
||||
className
|
||||
)}
|
||||
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, className)}
|
||||
>
|
||||
{label} {children}
|
||||
</button>
|
||||
|
||||
@@ -28,11 +28,7 @@ class ButtonAddons extends React.Component<Props> {
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<Flex className={classNames("field", "has-addons", className)}>
|
||||
{childWrapper}
|
||||
</Flex>
|
||||
);
|
||||
return <Flex className={classNames("field", "has-addons", className)}>{childWrapper}</Flex>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,7 @@ class ButtonGroup extends React.Component<Props> {
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={classNames("field", "is-grouped", className)}>
|
||||
{childWrapper}
|
||||
</div>
|
||||
);
|
||||
return <div className={classNames("field", "is-grouped", className)}>{childWrapper}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,7 @@ class DownloadButton extends React.Component<Props> {
|
||||
because jsx a does not the custom disabled attribute
|
||||
but bulma does.
|
||||
// @ts-ignore */}
|
||||
<a
|
||||
className="button is-link"
|
||||
href={url}
|
||||
disabled={disabled}
|
||||
onClick={onClickOrDefault}
|
||||
>
|
||||
<a className="button is-link" href={url} disabled={disabled} onClick={onClickOrDefault}>
|
||||
<span className="icon is-medium">
|
||||
<i className="fas fa-arrow-circle-down" />
|
||||
</span>
|
||||
|
||||
@@ -11,27 +11,13 @@ import EditButton from "./EditButton";
|
||||
import SubmitButton from "./SubmitButton";
|
||||
import { ReactElement } from "react";
|
||||
|
||||
const colors = [
|
||||
"primary",
|
||||
"link",
|
||||
"info",
|
||||
"success",
|
||||
"warning",
|
||||
"danger",
|
||||
"white",
|
||||
"light",
|
||||
"dark",
|
||||
"black",
|
||||
"text"
|
||||
];
|
||||
const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"];
|
||||
|
||||
const Spacing = styled.div`
|
||||
padding: 1em;
|
||||
`;
|
||||
|
||||
const RoutingDecorator = story => (
|
||||
<MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>
|
||||
);
|
||||
const RoutingDecorator = story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
||||
|
||||
const SpacingDecorator = story => <Spacing>{story()}</Spacing>;
|
||||
|
||||
@@ -65,17 +51,7 @@ buttonStory("AddButton", () => <AddButton>Add</AddButton>);
|
||||
buttonStory("CreateButton", () => <CreateButton>Create</CreateButton>);
|
||||
buttonStory("DeleteButton", () => <DeleteButton>Delete</DeleteButton>);
|
||||
buttonStory("DownloadButton", () => (
|
||||
<DownloadButton
|
||||
displayName="Download"
|
||||
disabled={false}
|
||||
url=""
|
||||
></DownloadButton>
|
||||
)).add("Disabled", () => (
|
||||
<DownloadButton
|
||||
displayName="Download"
|
||||
disabled={true}
|
||||
url=""
|
||||
></DownloadButton>
|
||||
));
|
||||
<DownloadButton displayName="Download" disabled={false} url=""></DownloadButton>
|
||||
)).add("Disabled", () => <DownloadButton displayName="Download" disabled={true} url=""></DownloadButton>);
|
||||
buttonStory("EditButton", () => <EditButton>Edit</EditButton>);
|
||||
buttonStory("SubmitButton", () => <SubmitButton>Submit</SubmitButton>);
|
||||
|
||||
@@ -9,6 +9,4 @@ export { default as SubmitButton } from "./SubmitButton";
|
||||
export { default as DownloadButton } from "./DownloadButton";
|
||||
export { default as ButtonGroup } from "./ButtonGroup";
|
||||
export { default as ButtonAddons } from "./ButtonAddons";
|
||||
export {
|
||||
default as RemoveEntryOfTableButton
|
||||
} from "./RemoveEntryOfTableButton";
|
||||
export { default as RemoveEntryOfTableButton } from "./RemoveEntryOfTableButton";
|
||||
|
||||
Reference in New Issue
Block a user