targetdetail
This commit is contained in:
parent
5c28e542c7
commit
dc3941def7
|
@ -5,6 +5,8 @@ import {
|
|||
DispatchProps as DispatchProps,
|
||||
} from './components/TargetDetail';
|
||||
|
||||
import * as targetDetailActions from '../redux/action/read';
|
||||
|
||||
export function mapStateToProps(state: any): StateProps {
|
||||
return {
|
||||
probe: state.probe,
|
||||
|
@ -13,6 +15,9 @@ export function mapStateToProps(state: any): StateProps {
|
|||
|
||||
export function mapDispatchToProps(dispatch: Dispatch<any>): DispatchProps {
|
||||
return {
|
||||
onRead: (id: string) => {
|
||||
dispatch(targetDetailActions.request(id));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export interface StateProps {
|
|||
}
|
||||
|
||||
export interface DispatchProps {
|
||||
|
||||
onRead(id: string): void;
|
||||
}
|
||||
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
|
|
@ -23,7 +23,7 @@ export interface State {
|
|||
|
||||
export class TargetList extends React.Component<Props, State> {
|
||||
|
||||
private data: any;
|
||||
private data: any;
|
||||
constructor(props: Props, context: State) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
|
@ -34,7 +34,6 @@ export class TargetList extends React.Component<Props, State> {
|
|||
}
|
||||
|
||||
public handleAddTarget(event: React.MouseEvent<HTMLButtonElement>, data: ButtonProps): void {
|
||||
alert('test');
|
||||
this.setState({
|
||||
openAddTarget: true,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user