parameter modify

This commit is contained in:
geek 2017-08-30 16:20:36 +09:00
parent 50b602a177
commit 788134bd3f
4 changed files with 13 additions and 43 deletions

View File

@ -1,24 +0,0 @@
import * as React from 'react';
import { RouteComponentProps } from 'react-router';
import PWChangeContainer from '@overflow/member/react/PWChange';
export interface Props {
}
export interface State {
}
class EmailConfirm extends React.Component<RouteComponentProps<Props>, State> {
public constructor(props?: RouteComponentProps<Props>, context?: State) {
super(props, context);
}
public render(): JSX.Element {
return (
<PWChangeContainer/>
);
}
}
export default EmailConfirm;

View File

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import { RouteComponentProps } from 'react-router'; import { RouteComponentProps } from 'react-router';
import PWChangeContainer from '@overflow/member/react/PWChange'; import ForgotPasswordContainer from '@overflow/member/react/ForgotPassword';
export interface Props { export interface Props {
} }
@ -15,7 +15,7 @@ class ForgotPassword extends React.Component<RouteComponentProps<Props>, State>
public render(): JSX.Element { public render(): JSX.Element {
return ( return (
<PWChangeContainer/> <ForgotPasswordContainer/>
); );
} }
} }

View File

@ -3,7 +3,7 @@ import {
PWChange, PWChange,
StateProps as PWCangeStateProps, StateProps as PWCangeStateProps,
DispatchProps as PWCangeDispatchProps, DispatchProps as PWCangeDispatchProps,
} from './components/PWChange'; } from './components/ForgotPassword';
import * as pwChangeActions from '../redux/action/pw_change'; import * as pwChangeActions from '../redux/action/pw_change';
@ -17,8 +17,8 @@ export function mapStateToProps(state: any): PWCangeStateProps {
export function mapDispatchToProps(dispatch: Dispatch<any>): PWCangeDispatchProps { export function mapDispatchToProps(dispatch: Dispatch<any>): PWCangeDispatchProps {
return { return {
onResetPassword: (pass: string) => { onForgotPassword: (email: string) => {
dispatch(asyncRequestActions.request('MemberService', 'forgotPassword', pwChangeActions.REQUEST, 'overflow@loafle.com', pass)); dispatch(asyncRequestActions.request('MemberService', 'forgotPassword', pwChangeActions.REQUEST, email));
// dispatch(pwChangeActions.request(pass)); // dispatch(pwChangeActions.request(pass));
}, },
}; };

View File

@ -11,14 +11,13 @@ export interface StateProps {
} }
export interface DispatchProps { export interface DispatchProps {
onResetPassword?(pass:string):void; onForgotPassword?(pass:string):void;
} }
export type Props = StateProps & DispatchProps; export type Props = StateProps & DispatchProps;
export interface State { export interface State {
pass: string; email: string;
passCon: string;
} }
export class PWChange extends React.Component<Props, State> { export class PWChange extends React.Component<Props, State> {
@ -26,8 +25,7 @@ export class PWChange extends React.Component<Props, State> {
super(props, context); super(props, context);
this.state = { this.state = {
pass:null, email:null,
passCon:null,
}; };
} }
@ -35,24 +33,20 @@ export class PWChange extends React.Component<Props, State> {
public render(): JSX.Element { public render(): JSX.Element {
return ( return (
<Form> <Form>
<Form.Input placeholder='Password' type='password' onChange={ <Form.Input placeholder='Email' onChange={
(event: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => { (event: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
this.setState({ pass: data.value }); this.setState({ email: data.value });
}} />
<Form.Input placeholder='Password Confirm' type='password' onChange={
(event: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
this.setState({ passCon: data.value });
}} /> }} />
<Form.Group> <Form.Group>
<Button primary fluid style={{margin:'7'}} onClick={this.passChangeClick}> Submit </Button> <Button primary fluid style={{margin:'7'}} onClick={this.forgotPwClick}> Submit </Button>
<Button fluid style={{margin:'7'}}> Cancel </Button> <Button fluid style={{margin:'7'}}> Cancel </Button>
</Form.Group> </Form.Group>
</Form> </Form>
); );
} }
private passChangeClick(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps):void { private forgotPwClick(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps):void {
this.props.onResetPassword(this.state.pass); this.props.onForgotPassword(this.state.pass);
} }
} }