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

View File

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