This commit is contained in:
insanity 2017-07-21 13:49:12 +09:00
parent 7e2d9eee39
commit 89b2632539
2 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,19 @@
import { connect, Dispatch } from 'react-redux';
import {
TargetDetail,
StateProps as StateProps,
DispatchProps as DispatchProps,
} from './components/TargetDetail';
export function mapStateToProps(state: any): StateProps {
return {
probe: state.probe,
};
}
export function mapDispatchToProps(dispatch: Dispatch<any>): DispatchProps {
return {
};
}
export default connect(mapStateToProps, mapDispatchToProps)(TargetDetail);

View File

@ -6,20 +6,33 @@ import { DetailContainer } from '@overflow/commons/react/component/DetailContain
import Probe from '@overflow/probe/api/model/Probe'; import Probe from '@overflow/probe/api/model/Probe';
import Target from '@overflow/target/api/model/Target'; import Target from '@overflow/target/api/model/Target';
export interface TargetDetailsProps {
export interface StateProps {
probe?: Probe; probe?: Probe;
target?: Target; target?: Target;
} }
export interface TargetDetailsState { export interface DispatchProps {
} }
export class TargetDetails extends React.Component<TargetDetailsProps, TargetDetailsState> { export type Props = StateProps & DispatchProps;
constructor(props: TargetDetailsProps, context: TargetDetailsState) { export interface State {
selected: Probe;
isDetail: boolean;
list: Probe[];
}
export class TargetDetail extends React.Component<Props, State> {
constructor(props: Props, context: State) {
super(props, context); super(props, context);
this.state = { this.state = {
selected: null,
isDetail: false,
list: null,
}; };
} }
@ -43,7 +56,6 @@ export class TargetDetails extends React.Component<TargetDetailsProps, TargetDet
]; ];
return ( return (
// <DetailContainer panes={items}/>
<Container fluid> <Container fluid>
<TargetBasicInfo probe={this.props.probe} /> <TargetBasicInfo probe={this.props.probe} />
<SensorList target={this.props.target} /> <SensorList target={this.props.target} />