reformat components with prettier

This commit is contained in:
Eduard Heimbuch
2020-03-31 17:11:16 +02:00
parent 5273082caa
commit fd94746a98
21 changed files with 49 additions and 50 deletions

View File

@@ -99,9 +99,7 @@ export default class CardColumn extends React.Component<Props> {
<FlexFullHeight className={classNames("media-content", "text-box", "is-flex")}>
<div className="is-flex">
<ContentLeft className="content">
<p className="shorten-text is-marginless">
{title}
</p>
<p className="shorten-text is-marginless">{title}</p>
<p className="shorten-text">{description}</p>
</ContentLeft>
<ContentRight>{contentRight}</ContentRight>

View File

@@ -25,7 +25,6 @@
import { chooseLocale, supportedLocales } from "./DateFromNow";
describe("test choose locale", () => {
it("should choose de", () => {
const locale = chooseLocale("de_DE", ["de", "en"]);
expect(locale).toBe(supportedLocales.de);
@@ -45,5 +44,4 @@ describe("test choose locale", () => {
const locale = chooseLocale("af", ["af", "be"]);
expect(locale).toBe(supportedLocales.en);
});
});

View File

@@ -42,4 +42,3 @@ storiesOf("Forms|Checkbox", module)
<Checkbox label="Checked but disabled" checked={true} disabled={true} />
</Spacing>
));

View File

@@ -54,7 +54,7 @@ export default class Checkbox extends React.Component<Props> {
if (title) {
return <LabelWithHelpIcon label={title} helpText={helpText} />;
}
}
};
render() {
const { label, checked, disabled } = this.props;
@@ -68,13 +68,7 @@ export default class Checkbox extends React.Component<Props> {
but bulma does.
// @ts-ignore */}
<label className="checkbox" disabled={disabled}>
<input
type="checkbox"
checked={checked}
onChange={this.onCheckboxChange}
disabled={disabled}
/>{" "}
{label}
<input type="checkbox" checked={checked} onChange={this.onCheckboxChange} disabled={disabled} /> {label}
{this.renderHelp()}
</label>
</div>

View File

@@ -25,7 +25,6 @@ import React, { ChangeEvent } from "react";
import { Help } from "../index";
import styled from "styled-components";
const StyledRadio = styled.label`
margin-right: 0.5em;
`;

View File

@@ -34,4 +34,3 @@ export { default as Title } from "./Title";
export { default as CustomQueryFlexWrappedColumns } from "./CustomQueryFlexWrappedColumns";
export { default as PrimaryContentColumn } from "./PrimaryContentColumn";
export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn";

View File

@@ -62,7 +62,11 @@ class ConfirmAlert extends React.Component<Props> {
<div className="field is-grouped">
{buttons.map((button, i) => (
<p className="control">
<a className={classNames("button", "is-info", button.className)} key={i} onClick={() => this.handleClickButton(button)}>
<a
className={classNames("button", "is-info", button.className)}
key={i}
onClick={() => this.handleClickButton(button)}
>
{button.label}
</a>
</p>

View File

@@ -26,4 +26,4 @@ export type RoutingProps = {
to: string;
activeOnlyWhenExact?: boolean;
activeWhenMatch?: (route: any) => boolean;
}
};

View File

@@ -291,11 +291,13 @@ class DiffFile extends React.Component<Props, State> {
<DiffButton
icon={sideBySide ? "align-left" : "columns"}
tooltip={t(sideBySide ? "diff.combined" : "diff.sideBySide")}
onClick={() => this.toggleSideBySide(() => {
onClick={() =>
this.toggleSideBySide(() => {
if (this.state.sideBySide) {
setCollapsed(true);
}
})}
})
}
/>
)}
</MenuContext.Consumer>

View File

@@ -204,10 +204,10 @@ describe("ExtensionPoint test", () => {
return {
...props,
name: "Two"
}
};
};
const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />);
expect(rendered.text()).toBe("Extension Two");
})
});
});

View File

@@ -48,11 +48,7 @@ const createInstance = (Component: any, props: object, key?: number) => {
const renderAllExtensions = (binder: Binder, name: string, props: object) => {
const extensions = binder.getExtensions(name, props);
return (
<>
{extensions.map((cmp, index) => createInstance(cmp, props, index))}
</>
);
return <>{extensions.map((cmp, index) => createInstance(cmp, props, index))}</>;
};
const renderSingleExtension = (binder: Binder, name: string, props: object) => {

View File

@@ -10020,6 +10020,16 @@ mini-css-extract-plugin@^0.8.0:
schema-utils "^1.0.0"
webpack-sources "^1.1.0"
mini-css-extract-plugin@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==
dependencies:
loader-utils "^1.1.0"
normalize-url "1.9.1"
schema-utils "^1.0.0"
webpack-sources "^1.1.0"
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
@@ -12247,10 +12257,10 @@ react-redux@^5.0.7:
react-is "^16.6.0"
react-lifecycles-compat "^3.0.0"
react-refresh@^0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50"
integrity sha512-u5l7fhAJXecWUJzVxzMRU2Zvw8m4QmDNHlTrT5uo3KBlYBhmChd7syAakBoay1yIiVhx/8Fi7a6v6kQZfsw81Q==
react-refresh@^0.8.0:
version "0.8.1"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.1.tgz#5500506ad6fc891fdd057d0bf3581f9310abc6a2"
integrity sha512-xZIKi49RtLUUSAZ4a4ut2xr+zr4+glOD5v0L413B55MPvlg4EQ6Ctx8PD4CmjlPGoAWmSCTmmkY59TErizNsow==
react-router-dom@^5.1.2:
version "5.1.2"