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 {
return (
<SensorListContainer/>
<SensorListContainer />
);
}

View File

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