Fixed formatting for some of the files

This commit is contained in:
Philipp Czora
2018-10-04 10:16:20 +02:00
parent 676c6f764a
commit 23869bc33a
8 changed files with 54 additions and 65 deletions

View File

@@ -11,7 +11,7 @@ const styles = {
float: "left",
paddingLeft: "3px",
float: "right"
}
}
};
type Props = {
@@ -24,10 +24,14 @@ class Help extends React.Component<Props> {
const { message, classes } = this.props;
const multiline = message.length > 60 ? "is-tooltip-multiline" : "";
return (
<div className={classNames("tooltip is-tooltip-right", multiline, classes.q)}
data-tooltip={message}>
<i className={classNames("fa fa-question has-text-info", classes.img)}></i>
</div>
<div
className={classNames("tooltip is-tooltip-right", multiline, classes.q)}
data-tooltip={message}
>
<i
className={classNames("fa fa-question has-text-info", classes.img)}
/>
</div>
);
}
}

View File

@@ -1,6 +1,6 @@
//@flow
import React from "react";
import {Help} from "./index";
import { Help } from "./index";
type Props = {
label: string,
@@ -8,7 +8,6 @@ type Props = {
};
class LabelWithHelpIcon extends React.Component<Props> {
renderLabel = () => {
const label = this.props.label;
if (label) {
@@ -19,35 +18,28 @@ class LabelWithHelpIcon extends React.Component<Props> {
renderHelp = () => {
const helpText = this.props.helpText;
if(helpText){
if (helpText) {
return (
<div className="control columns is-vcentered">
<Help message={helpText} />
</div>);
}
else
return null;
</div>
);
} else return null;
};
renderLabelWithHelpIcon = () => {
if(this.props.label){
return(
if (this.props.label) {
return (
<div className="field is-grouped">
<div className="control">
{this.renderLabel()}
<div className="control">{this.renderLabel()}</div>
{this.renderHelp()}
</div>
{this.renderHelp()}
</div>
)
}
else
return null;
);
} else return null;
};
render() {
return (
this.renderLabelWithHelpIcon()
);
return this.renderLabelWithHelpIcon();
}
}

View File

@@ -26,7 +26,13 @@ class AddEntryToTableField extends React.Component<Props, State> {
}
render() {
const { disabled, buttonLabel, fieldLabel, errorMessage, helpText} = this.props;
const {
disabled,
buttonLabel,
fieldLabel,
errorMessage,
helpText
} = this.props;
return (
<div className="field">
<InputField

View File

@@ -1,6 +1,6 @@
//@flow
import React from "react";
import {Help} from "../index";
import { Help } from "../index";
type Props = {
label?: string,
@@ -18,14 +18,13 @@ class Checkbox extends React.Component<Props> {
renderHelp = () => {
const helpText = this.props.helpText;
if(helpText){
if (helpText) {
return (
<div className="control columns is-vcentered">
<Help message={helpText} />
</div>);
}
else
return null;
</div>
);
} else return null;
};
render() {

View File

@@ -1,7 +1,7 @@
//@flow
import React from "react";
import classNames from "classnames";
import {LabelWithHelpIcon} from "../index";
import { LabelWithHelpIcon } from "../index";
type Props = {
label?: string,
@@ -64,26 +64,23 @@ class InputField extends React.Component<Props> {
""
);
return (
<div className="field">
<LabelWithHelpIcon
label={label}
helpText={helpText}
<div className="field">
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control">
<input
ref={input => {
this.field = input;
}}
className={classNames("input", errorView)}
type={type}
placeholder={placeholder}
value={value}
onChange={this.handleInput}
onKeyPress={this.handleKeyPress}
disabled={disabled}
/>
<div className="control">
<input
ref={input => {
this.field = input;
}}
className={classNames("input", errorView)}
type={type}
placeholder={placeholder}
value={value}
onChange={this.handleInput}
onKeyPress={this.handleKeyPress}
disabled={disabled}
/>
</div>
{helper}
</div>
{helper}
</div>
);
}

View File

@@ -1,6 +1,6 @@
//@flow
import React from "react";
import {LabelWithHelpIcon} from "../index";
import { LabelWithHelpIcon } from "../index";
export type SelectItem = {
value: string,
@@ -35,10 +35,7 @@ class Select extends React.Component<Props> {
return (
<div className="field">
<LabelWithHelpIcon
label={label}
helpText={helpText}
/>
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control select">
<select
ref={input => {

View File

@@ -1,6 +1,6 @@
//@flow
import React from "react";
import {LabelWithHelpIcon} from "../index";
import { LabelWithHelpIcon } from "../index";
export type SelectItem = {
value: string,
@@ -27,10 +27,7 @@ class Textarea extends React.Component<Props> {
return (
<div className="field">
<LabelWithHelpIcon
label={label}
helpText={helpText}
/>
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control">
<textarea
className="textarea"

View File

@@ -19,11 +19,8 @@ export { default as ProtectedRoute } from "./ProtectedRoute.js";
export { default as Help } from "./Help.js";
export { default as LabelWithHelpIcon } from "./LabelWithHelpIcon.js";
export { apiClient, NOT_FOUND_ERROR, UNAUTHORIZED_ERROR } from "./apiclient.js";
export * from "./buttons";
export * from "./forms";
export * from "./layout";