parameter modify
This commit is contained in:
parent
50b602a177
commit
788134bd3f
|
@ -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;
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { RouteComponentProps } from 'react-router';
|
||||
import PWChangeContainer from '@overflow/member/react/PWChange';
|
||||
import ForgotPasswordContainer from '@overflow/member/react/ForgotPassword';
|
||||
|
||||
export interface Props {
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class ForgotPassword extends React.Component<RouteComponentProps<Props>, State>
|
|||
|
||||
public render(): JSX.Element {
|
||||
return (
|
||||
<PWChangeContainer/>
|
||||
<ForgotPasswordContainer/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
PWChange,
|
||||
StateProps as PWCangeStateProps,
|
||||
DispatchProps as PWCangeDispatchProps,
|
||||
} from './components/PWChange';
|
||||
} from './components/ForgotPassword';
|
||||
|
||||
|
||||
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 {
|
||||
return {
|
||||
onResetPassword: (pass: string) => {
|
||||
dispatch(asyncRequestActions.request('MemberService', 'forgotPassword', pwChangeActions.REQUEST, 'overflow@loafle.com', pass));
|
||||
onForgotPassword: (email: string) => {
|
||||
dispatch(asyncRequestActions.request('MemberService', 'forgotPassword', pwChangeActions.REQUEST, email));
|
||||
// dispatch(pwChangeActions.request(pass));
|
||||
},
|
||||
};
|
|
@ -11,14 +11,13 @@ export interface StateProps {
|
|||
}
|
||||
|
||||
export interface DispatchProps {
|
||||
onResetPassword?(pass:string):void;
|
||||
onForgotPassword?(pass:string):void;
|
||||
}
|
||||
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
||||
export interface State {
|
||||
pass: string;
|
||||
passCon: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export class PWChange extends React.Component<Props, State> {
|
||||
|
@ -26,8 +25,7 @@ export class PWChange extends React.Component<Props, State> {
|
|||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
pass:null,
|
||||
passCon:null,
|
||||
email:null,
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -35,24 +33,20 @@ export class PWChange extends React.Component<Props, State> {
|
|||
public render(): JSX.Element {
|
||||
return (
|
||||
<Form>
|
||||
<Form.Input placeholder='Password' type='password' onChange={
|
||||
<Form.Input placeholder='Email' onChange={
|
||||
(event: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
|
||||
this.setState({ pass: data.value });
|
||||
}} />
|
||||
<Form.Input placeholder='Password Confirm' type='password' onChange={
|
||||
(event: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
|
||||
this.setState({ passCon: data.value });
|
||||
this.setState({ email: data.value });
|
||||
}} />
|
||||
<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>
|
||||
</Form.Group>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
private passChangeClick(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps):void {
|
||||
this.props.onResetPassword(this.state.pass);
|
||||
private forgotPwClick(event: React.SyntheticEvent<HTMLButtonElement>, data: ButtonProps):void {
|
||||
this.props.onForgotPassword(this.state.pass);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user