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")}> <FlexFullHeight className={classNames("media-content", "text-box", "is-flex")}>
<div className="is-flex"> <div className="is-flex">
<ContentLeft className="content"> <ContentLeft className="content">
<p className="shorten-text is-marginless"> <p className="shorten-text is-marginless">{title}</p>
{title}
</p>
<p className="shorten-text">{description}</p> <p className="shorten-text">{description}</p>
</ContentLeft> </ContentLeft>
<ContentRight>{contentRight}</ContentRight> <ContentRight>{contentRight}</ContentRight>

View File

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

View File

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

View File

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

View File

@@ -25,7 +25,6 @@ import React, { ChangeEvent } from "react";
import { Help } from "../index"; import { Help } from "../index";
import styled from "styled-components"; import styled from "styled-components";
const StyledRadio = styled.label` const StyledRadio = styled.label`
margin-right: 0.5em; 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 CustomQueryFlexWrappedColumns } from "./CustomQueryFlexWrappedColumns";
export { default as PrimaryContentColumn } from "./PrimaryContentColumn"; export { default as PrimaryContentColumn } from "./PrimaryContentColumn";
export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn"; export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn";

View File

@@ -62,7 +62,11 @@ class ConfirmAlert extends React.Component<Props> {
<div className="field is-grouped"> <div className="field is-grouped">
{buttons.map((button, i) => ( {buttons.map((button, i) => (
<p className="control"> <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} {button.label}
</a> </a>
</p> </p>

View File

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

View File

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

View File

@@ -204,10 +204,10 @@ describe("ExtensionPoint test", () => {
return { return {
...props, ...props,
name: "Two" name: "Two"
} };
}; };
const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />); const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />);
expect(rendered.text()).toBe("Extension Two"); 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 renderAllExtensions = (binder: Binder, name: string, props: object) => {
const extensions = binder.getExtensions(name, props); const extensions = binder.getExtensions(name, props);
return ( return <>{extensions.map((cmp, index) => createInstance(cmp, props, index))}</>;
<>
{extensions.map((cmp, index) => createInstance(cmp, props, index))}
</>
);
}; };
const renderSingleExtension = (binder: Binder, name: string, props: object) => { 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" schema-utils "^1.0.0"
webpack-sources "^1.1.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: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" 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-is "^16.6.0"
react-lifecycles-compat "^3.0.0" react-lifecycles-compat "^3.0.0"
react-refresh@^0.7.2: react-refresh@^0.8.0:
version "0.7.2" version "0.8.1"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.1.tgz#5500506ad6fc891fdd057d0bf3581f9310abc6a2"
integrity sha512-u5l7fhAJXecWUJzVxzMRU2Zvw8m4QmDNHlTrT5uo3KBlYBhmChd7syAakBoay1yIiVhx/8Fi7a6v6kQZfsw81Q== integrity sha512-xZIKi49RtLUUSAZ4a4ut2xr+zr4+glOD5v0L413B55MPvlg4EQ6Ctx8PD4CmjlPGoAWmSCTmmkY59TErizNsow==
react-router-dom@^5.1.2: react-router-dom@^5.1.2:
version "5.1.2" version "5.1.2"