member props modify

This commit is contained in:
geek 2017-07-20 17:40:00 +09:00
parent 3fcfeb6e43
commit 8e4b42b860
2 changed files with 20 additions and 12 deletions

View File

@ -3,21 +3,21 @@ import Member from '../api/model/Member';
import {
SignUp,
Props as SignUpProps,
State as SignUpState,
StateProps as SignUpStateProps,
DispatchProps as SignUpDispatchProps,
} from './components/SignUp';
import State from '../redux/state/SignUp';
import * as signupActions from '../redux/action/signUp';
export function mapStateToProps(state: any): SignUpProps {
export function mapStateToProps(state: any): SignUpStateProps {
return {
};
}
export function mapDispatchToProps(dispatch: Dispatch<any>): SignUpProps {
export function mapDispatchToProps(dispatch: Dispatch<any>): SignUpDispatchProps {
return {
onSignUp: (member: Member) => {
dispatch(signupActions.request(member));

View File

@ -1,16 +1,23 @@
import *as React from 'react';
import Member from '../../api/model/Member';
import {
InputOnChangeData,
Button,
Grid,
Form,
Container,
Container, ButtonProps,
} from 'semantic-ui-react';
export interface Props {
// onSignUp?():void;
export interface StateProps {
}
export interface DispatchProps {
onSignUp?(member: Member): void;
}
export type Props = StateProps & DispatchProps;
export interface State {
email: string;
name: string;
@ -92,7 +99,7 @@ export class SignUp extends React.Component<Props, State> {
}
} />
<Form.Group>
<Button primary fluid style={{margin:'7'}} onClick={this.onSignUp}> Sign Up </Button>
<Button primary fluid style={{margin:'7'}} onClick={this.signUpClick}> Sign Up </Button>
<Button fluid style={{margin:'7'}}> Cancel </Button>
</Form.Group>
</Form>
@ -105,10 +112,11 @@ export class SignUp extends React.Component<Props, State> {
);
}
//
// private onSignUp():void {
// console.log('');
// }
private signUpClick(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps):void {
// this.props.onSignUp(member);
}
}