commons lint

This commit is contained in:
insanity 2017-07-20 12:21:24 +09:00
parent f01f185ed6
commit 743f135df3
4 changed files with 26 additions and 49 deletions

View File

@ -13,7 +13,6 @@ export interface State {
list: object[];
}
export class Probes extends React.Component<Props, State> {
private data: any;

View File

@ -1,6 +1,14 @@
import * as React from 'react';
import { Grid, Menu, Segment } from 'semantic-ui-react';
export interface Props {
}
export interface State {
active: number;
}
export class DetailContainer extends React.Component<any, any> {
constructor(props: any, context: any) {
@ -10,17 +18,17 @@ export class DetailContainer extends React.Component<any, any> {
};
}
showContents() {
public showContents(): JSX.Element {
return this.props.panes[this.state.active].child;
}
handleClick(index: number) {
public handleClick(index: number): void {
this.setState({
active: index,
});
}
render() {
public render(): JSX.Element {
const activeItem = this.state.activeItem;
return (
@ -41,4 +49,4 @@ export class DetailContainer extends React.Component<any, any> {
</Grid>
);
}
}
}

View File

@ -1,6 +1,14 @@
import * as React from 'react';
import { Grid, Input, Form, Checkbox, Divider } from 'semantic-ui-react';
export interface Props {
}
export interface State {
}
export class ListContainer extends React.Component<any, any> {
private found: boolean = false;
@ -12,7 +20,7 @@ export class ListContainer extends React.Component<any, any> {
}
handleSearch(e: any, data: any) {
public handleSearch(e: any, data: any): void {
let searchWord = data.value;
let items: object[];
items = this.props.data;
@ -30,13 +38,13 @@ export class ListContainer extends React.Component<any, any> {
this.props.onSearch(result);
}
handleSearchInput(e: any, data: any) {
public handleSearchInput(e: any, data: any): void {
this.setState({
searchWord: data.value,
});
}
search(item: any, searchWord: string) {
public search(item: any, searchWord: string): void {
let key: any;
for (key in item) {
if (this.isString(item[key])) {
@ -49,14 +57,14 @@ export class ListContainer extends React.Component<any, any> {
}
}
isString(val: any): boolean {
public isString(val: any): boolean {
if (typeof val === 'string') {
return true;
}
return false;
}
render() {
public render(): JSX.Element {
return (
<Grid>
<Grid.Column width={4}>
@ -71,4 +79,4 @@ export class ListContainer extends React.Component<any, any> {
</Grid>
);
}
}
}

View File

@ -1,38 +0,0 @@
import * as React from 'react';
import { Menu, Segment } from 'semantic-ui-react';
export class Tab extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
this.state = {
active: 0,
};
}
showContents() {
return this.props.panes[this.state.active].child;
}
handleClick(index: number) {
this.setState({
active: index,
});
}
render() {
return (
<div>
<Menu pointing secondary>
{this.props.panes.map((pane: any, index: number) => (
<Menu.Item key={index} name={pane.name} onClick={this.handleClick.bind(this, index)} active={this.state.active === index} />
))}
</Menu>
<Segment vertical>
{this.showContents()}
</Segment>
</div>
);
}
}