From 89b263253934e2cad8447683ca6de37e642c6910 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 21 Jul 2017 13:49:12 +0900 Subject: [PATCH 1/2] target --- .../@overflow/target/react/TargetDetail.tsx | 19 ++++++++++++++++ .../target/react/components/TargetDetail.tsx | 22 ++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 src/ts/@overflow/target/react/TargetDetail.tsx diff --git a/src/ts/@overflow/target/react/TargetDetail.tsx b/src/ts/@overflow/target/react/TargetDetail.tsx new file mode 100644 index 0000000..c0c11d1 --- /dev/null +++ b/src/ts/@overflow/target/react/TargetDetail.tsx @@ -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): DispatchProps { + return { + }; +} + +export default connect(mapStateToProps, mapDispatchToProps)(TargetDetail); diff --git a/src/ts/@overflow/target/react/components/TargetDetail.tsx b/src/ts/@overflow/target/react/components/TargetDetail.tsx index 45b406d..2f108e7 100644 --- a/src/ts/@overflow/target/react/components/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/components/TargetDetail.tsx @@ -6,20 +6,33 @@ import { DetailContainer } from '@overflow/commons/react/component/DetailContain import Probe from '@overflow/probe/api/model/Probe'; import Target from '@overflow/target/api/model/Target'; -export interface TargetDetailsProps { + +export interface StateProps { probe?: Probe; target?: Target; } -export interface TargetDetailsState { +export interface DispatchProps { } -export class TargetDetails extends React.Component { +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 { + + constructor(props: Props, context: State) { super(props, context); this.state = { + selected: null, + isDetail: false, + list: null, }; } @@ -43,7 +56,6 @@ export class TargetDetails extends React.Component From d26fbfc09698107a95a98ac1c0d2c0c8ed328db6 Mon Sep 17 00:00:00 2001 From: insanity Date: Fri, 21 Jul 2017 13:58:19 +0900 Subject: [PATCH 2/2] target --- src/ts/@overflow/target/react/components/TargetList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/@overflow/target/react/components/TargetList.tsx b/src/ts/@overflow/target/react/components/TargetList.tsx index f5d5f23..5c47d1c 100644 --- a/src/ts/@overflow/target/react/components/TargetList.tsx +++ b/src/ts/@overflow/target/react/components/TargetList.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Table, Button, Modal, Input, Header, Container, InputOnChangeData, ButtonProps } from 'semantic-ui-react'; -import { TargetDetails } from './TargetDetail'; +import { TargetDetail } from './TargetDetail'; import Target from '@overflow/target/api/model/Target'; import Probe from '@overflow/probe/api/model/Probe'; import { ListContainer } from '@overflow/commons/react/component/ListContainer';