diff --git a/src/ts/@overflow/member/react/SignIn.tsx b/src/ts/@overflow/member/react/SignIn.tsx index 74ce8d7..390cf00 100644 --- a/src/ts/@overflow/member/react/SignIn.tsx +++ b/src/ts/@overflow/member/react/SignIn.tsx @@ -7,12 +7,12 @@ import { import State from '../redux/state/SignIn'; import * as signinActions from '../redux/action/signIn'; - +import { push as routerPush } from 'react-router-redux'; import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest'; export function mapStateToProps(state: any, ownProps?: any): SignInStateProps { return { - + isAuthenticated: state.isAuthenticated, }; } @@ -22,6 +22,9 @@ export function mapDispatchToProps(dispatch: Dispatch, ownProps?: any): Sig // dispatch(signinActions.request(signinId, signinPw)); dispatch(asyncRequestActions.request('MemberService', 'signin', signinActions.REQUEST, signinId, signinPw)); }, + onRedirectHome: () => { + dispatch(routerPush('/')); + }, }; } diff --git a/src/ts/@overflow/member/react/components/SignIn.tsx b/src/ts/@overflow/member/react/components/SignIn.tsx index e090a27..51d7175 100644 --- a/src/ts/@overflow/member/react/components/SignIn.tsx +++ b/src/ts/@overflow/member/react/components/SignIn.tsx @@ -16,12 +16,14 @@ const options = [ { key: 'unitedstates', value: '1', text: 'United States(1)' }, ]; export interface StateProps { + isAuthenticated?:boolean; } export interface DispatchProps { onSignIn?(signinId: string, signinPw: string ): void; onSignUp?(): void; onResetPassword?():void; + onRedirectHome():void; } export type Props = StateProps & DispatchProps; @@ -46,54 +48,58 @@ export class SignIn extends React.Component { } public render(): JSX.Element { - return ( -
- + , data: InputOnChangeData) => { this.setState({ email: data.value }); }} /> - , data: InputOnChangeData) => { this.setState({ pass: data.value }); }} /> -
- -
- +
+ +
+ - +
- - Change your password - - Enter email address - - + + Change your password + + Enter email address + + - - - - - - - - + + + + + + + + - - Send Complete - - -
비밀번호 변경이 신청 되었습니다.
-

수신하신 메일의 주소에서 비밀번호 변경을 완료 하시기 바랍니다.

-
-
- - - -
- - ); + + Send Complete + + +
비밀번호 변경이 신청 되었습니다.
+

수신하신 메일의 주소에서 비밀번호 변경을 완료 하시기 바랍니다.

+
+
+ + + +
+ ; + + if( this.props.isAuthenticated ) { + this.props.onRedirectHome(); + } else { + return signinElement; + } } private forgotPopupOpen = () => this.setState({ forgotPopup: true }); diff --git a/src/ts/@overflow/member/redux/reducer/signIn.ts b/src/ts/@overflow/member/redux/reducer/signIn.ts index 367c878..de71a6a 100644 --- a/src/ts/@overflow/member/redux/reducer/signIn.ts +++ b/src/ts/@overflow/member/redux/reducer/signIn.ts @@ -7,8 +7,10 @@ import SigninState, { defaultState as signinDefaultState } from '../state/SignIn const reducer: ReducersMapObject = { [SigninActionTypes.REQUEST_SUCCESS]: (state: SigninState = signinDefaultState, action: Action): SigninState => { - - return state; + return { + ...state, + isAuthenticated: true, + }; }, [SigninActionTypes.REQUEST_FAILURE]: (state: SigninState = signinDefaultState, action: Action): SigninState => { return state;