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

@@ -32,7 +32,7 @@ import MarkdownXmlCodeBlock from "./__resources__/markdown-xml-codeblock.md";
import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md";
import Title from "./layout/Title";
import { Subtitle } from "./layout";
import {MemoryRouter} from "react-router-dom";
import { MemoryRouter } from "react-router-dom";
const Spacing = styled.div`
padding: 2em;

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

@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React, {useState} from "react";
import React, { useState } from "react";
import { storiesOf } from "@storybook/react";
import styled from "styled-components";
import Textarea from "./Textarea";

View File

@@ -33,7 +33,7 @@ import hitchhiker from "../__resources__/hitchhiker.png";
import marvin from "../__resources__/marvin.jpg";
import NavLink from "../navigation/NavLink";
import ExternalLink from "../navigation/ExternalLink";
import {MemoryRouter} from "react-router-dom";
import { MemoryRouter } from "react-router-dom";
const trillian: Me = {
name: "trillian",

View File

@@ -52,7 +52,7 @@ const PageActionContainer = styled.div`
`;
const MarginLeft = styled.div`
margin-left: 0.5rem;
margin-left: 0.5rem;
`;
const FlexContainer = styled.div`

View File

@@ -40,7 +40,7 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle,
document.title = title;
}
}
},[title, preventRefreshingPageTitle, customPageTitle]);
}, [title, preventRefreshingPageTitle, customPageTitle]);
if (title) {
return <h1 className={classNames("title", className)}>{title}</h1>;

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

@@ -36,7 +36,7 @@ export const MenuContext = React.createContext<MenuContext>({
setCollapsed() {}
});
export const StateMenuContextProvider: FC = ({children}) => {
export const StateMenuContextProvider: FC = ({ children }) => {
const [collapsed, setCollapsed] = useState(false);
const context = {

View File

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

View File

@@ -21,10 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React, {FC} from "react";
import React, { FC } from "react";
import SubNavigation from "./SubNavigation";
import NavLink from "./NavLink";
import {RoutingProps} from "./RoutingProps";
import { RoutingProps } from "./RoutingProps";
type Props = RoutingProps & {
label: string;

View File

@@ -21,11 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React, { FC, useContext} from "react";
import React, { FC, useContext } from "react";
import { Link, useRouteMatch } from "react-router-dom";
import classNames from "classnames";
import useMenuContext, {MenuContext} from "./MenuContext";
import {RoutingProps} from "./RoutingProps";
import useMenuContext, { MenuContext } from "./MenuContext";
import { RoutingProps } from "./RoutingProps";
type Props = RoutingProps & {
label: string;

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(() => {
if (this.state.sideBySide) {
setCollapsed(true);
}
})}
onClick={() =>
this.toggleSideBySide(() => {
if (this.state.sideBySide) {
setCollapsed(true);
}
})
}
/>
)}
</MenuContext.Consumer>

View File

@@ -32,7 +32,7 @@ import { Binder, BinderContext } from "@scm-manager/ui-extensions";
import { Repository } from "@scm-manager/ui-types";
import Image from "../Image";
import Icon from "../Icon";
import {MemoryRouter} from "react-router-dom";
import { MemoryRouter } from "react-router-dom";
const baseDate = "2020-03-26T12:13:42+02:00";