From 743f135df33146b04f4fce3366962213838e1ee1 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 20 Jul 2017 12:21:24 +0900 Subject: [PATCH] commons lint --- .../temp/react/components/Probes.tsx | 1 - .../components/commons/DetailContainer.tsx | 16 ++++++-- .../components/commons/ListContainer.tsx | 20 +++++++--- .../temp/react/components/commons/Tab.tsx | 38 ------------------- 4 files changed, 26 insertions(+), 49 deletions(-) delete mode 100644 src/ts/@overflow/temp/react/components/commons/Tab.tsx diff --git a/src/ts/@overflow/temp/react/components/Probes.tsx b/src/ts/@overflow/temp/react/components/Probes.tsx index 094894d..38b61c8 100644 --- a/src/ts/@overflow/temp/react/components/Probes.tsx +++ b/src/ts/@overflow/temp/react/components/Probes.tsx @@ -13,7 +13,6 @@ export interface State { list: object[]; } - export class Probes extends React.Component { private data: any; diff --git a/src/ts/@overflow/temp/react/components/commons/DetailContainer.tsx b/src/ts/@overflow/temp/react/components/commons/DetailContainer.tsx index 50c6b16..fcff810 100644 --- a/src/ts/@overflow/temp/react/components/commons/DetailContainer.tsx +++ b/src/ts/@overflow/temp/react/components/commons/DetailContainer.tsx @@ -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 { constructor(props: any, context: any) { @@ -10,17 +18,17 @@ export class DetailContainer extends React.Component { }; } - 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 { ); } -} \ No newline at end of file +} diff --git a/src/ts/@overflow/temp/react/components/commons/ListContainer.tsx b/src/ts/@overflow/temp/react/components/commons/ListContainer.tsx index 37a9d88..1078f9e 100644 --- a/src/ts/@overflow/temp/react/components/commons/ListContainer.tsx +++ b/src/ts/@overflow/temp/react/components/commons/ListContainer.tsx @@ -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 { private found: boolean = false; @@ -12,7 +20,7 @@ export class ListContainer extends React.Component { } - 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 { 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 { } } - isString(val: any): boolean { + public isString(val: any): boolean { if (typeof val === 'string') { return true; } return false; } - render() { + public render(): JSX.Element { return ( @@ -71,4 +79,4 @@ export class ListContainer extends React.Component { ); } -} \ No newline at end of file +} diff --git a/src/ts/@overflow/temp/react/components/commons/Tab.tsx b/src/ts/@overflow/temp/react/components/commons/Tab.tsx deleted file mode 100644 index c8dd248..0000000 --- a/src/ts/@overflow/temp/react/components/commons/Tab.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react'; -import { Menu, Segment } from 'semantic-ui-react'; - -export class Tab extends React.Component { - - 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 ( -
- - {this.props.panes.map((pane: any, index: number) => ( - - ))} - - - - {this.showContents()} - -
- ); - } -} \ No newline at end of file