This commit is contained in:
insanity 2017-07-20 18:14:59 +09:00
commit 9f8cfe93f0
2 changed files with 11 additions and 15 deletions

View File

@ -17,7 +17,7 @@ class SensorList extends React.Component<RouteComponentProps<object>, object> {
public render(): JSX.Element { public render(): JSX.Element {
return ( return (
<SensorListContainer/> <SensorListContainer />
); );
} }

View File

@ -14,28 +14,28 @@ export interface DispatchProps {
onReadAllByTarget?(target: Target): void; onReadAllByTarget?(target: Target): void;
} }
export type Props = StateProps & DispatchProps; export type SensorListProps = StateProps & DispatchProps;
export interface State { export interface SensorListState {
isDetail: boolean; isDetail: boolean;
selected: Sensor; selected: Sensor;
} }
export class SensorList extends React.Component<Props, State> { export class SensorList extends React.Component<SensorListProps, SensorListState> {
private data: any; private data: any;
constructor(props: Props, context: State) { constructor(props: SensorListProps, context: SensorListState) {
super(props, context); super(props, context);
// this.state = { this.state = {
// selected: null, selected: null,
// isDetail: false, // temp isDetail: false, // temp
// }; };
} }
public componentWillMount(): void { public componentWillMount(): void {
super.componentWillMount(); // super.componentWillMount();
this.data = [ this.data = [
{ {
'id': '111', 'id': '111',
@ -116,7 +116,7 @@ export class SensorList extends React.Component<Props, State> {
public render(): JSX.Element { public render(): JSX.Element {
if (this.state.isDetail) { if (this.state.isDetail) {
return <SensorDetail sensor={this.state.selected} />; return (<SensorDetail sensor={this.state.selected} />);
} }
return ( return (
<Container fluid> <Container fluid>
@ -152,10 +152,6 @@ export class SensorList extends React.Component<Props, State> {
); );
} }
private onReadAllByTarget(): void {
console.log('');
}
} }