diff --git a/@overflow/member/component/member-signup.component.html b/@overflow/member/component/member-signup.component.html index 451c4ab..3994c5b 100644 --- a/@overflow/member/component/member-signup.component.html +++ b/@overflow/member/component/member-signup.component.html @@ -17,20 +17,7 @@ - -
Membership is welcome.
-
- - - -
+
@@ -178,3 +165,8 @@ + +
+ sdklsdlkfklsdfklsdklfskldfjk + {{member.email}} +
diff --git a/@overflow/member/component/member-signup.component.ts b/@overflow/member/component/member-signup.component.ts index dee4dd2..d8aac22 100644 --- a/@overflow/member/component/member-signup.component.ts +++ b/@overflow/member/component/member-signup.component.ts @@ -14,9 +14,8 @@ import { Member } from '@overflow/commons-typescript/model/member'; }) export class MemberSignupComponent implements OnInit, OnDestroy { @Output() signup = new EventEmitter<{member: Member, password: string}>(); - @Output() doneSignup = new EventEmitter(); - @Input() signupComplete; + @Input() member; signupForm: FormGroup; email: AbstractControl; @@ -134,10 +133,6 @@ export class MemberSignupComponent implements OnInit, OnDestroy { this.policyDisplay = true; } - closeSignup() { - this.doneSignup.emit(); - } - onScriptLoad() { console.log('Google reCAPTCHA loaded and is ready for use!'); } diff --git a/@overflow/member/container/member-signup-container.component.html b/@overflow/member/container/member-signup-container.component.html index 8e2dd6c..9db433e 100644 --- a/@overflow/member/container/member-signup-container.component.html +++ b/@overflow/member/container/member-signup-container.component.html @@ -1 +1 @@ - + diff --git a/@overflow/member/container/member-signup-container.component.ts b/@overflow/member/container/member-signup-container.component.ts index 0d0caf7..312e18a 100644 --- a/@overflow/member/container/member-signup-container.component.ts +++ b/@overflow/member/container/member-signup-container.component.ts @@ -8,7 +8,7 @@ import {select, Store} from '@ngrx/store'; import * as MemberEntityStore from '../store/entity/member'; import { MemberSignupContainerSelector } from '../store'; -import {Observable} from 'rxjs'; +import { Observable } from 'rxjs'; @Component({ selector: 'of-member-signup-container', @@ -16,16 +16,14 @@ import {Observable} from 'rxjs'; }) export class MemberSignupContainerComponent implements OnInit, OnDestroy { - @Output() doneSignup = new EventEmitter(); - - signupComplete$: Observable; + member$: Observable; constructor( private store: Store, ) { } ngOnInit() { - this.signupComplete$ = this.store.pipe(select(MemberSignupContainerSelector.selectSignupComplete)); + this.member$ = this.store.pipe(select(MemberSignupContainerSelector.selectMember)); } ngOnDestroy() { @@ -35,7 +33,4 @@ export class MemberSignupContainerComponent implements OnInit, OnDestroy { this.store.dispatch(new MemberEntityStore.Signup(info)); } - onDoneSignup() { - this.doneSignup.emit(); - } } diff --git a/@overflow/member/store/container/signup/member-signup.reducer.ts b/@overflow/member/store/container/signup/member-signup.reducer.ts index 099cae5..8eda857 100644 --- a/@overflow/member/store/container/signup/member-signup.reducer.ts +++ b/@overflow/member/store/container/signup/member-signup.reducer.ts @@ -12,7 +12,7 @@ export function reducer(state = initialState, action: Actions): State { switch (action.type) { case ActionType.Signup: { return { - signupComplete: false, + member: null, pending: true, error: null, }; @@ -20,7 +20,7 @@ export function reducer(state = initialState, action: Actions): State { case ActionType.SignupSuccess: { return { - signupComplete: true, + member: action.payload, pending: false, error: null, }; @@ -28,7 +28,7 @@ export function reducer(state = initialState, action: Actions): State { case ActionType.SignupFailure: { return { - signupComplete: false, + member: null, pending: false, error: action.payload, }; diff --git a/@overflow/member/store/container/signup/member-signup.state.ts b/@overflow/member/store/container/signup/member-signup.state.ts index 2a84abc..4af3d3b 100644 --- a/@overflow/member/store/container/signup/member-signup.state.ts +++ b/@overflow/member/store/container/signup/member-signup.state.ts @@ -1,22 +1,23 @@ import { Selector, createSelector } from '@ngrx/store'; import { RESTClientError } from '@loafer/ng-rest'; +import { Member } from '@overflow/commons-typescript/model/member'; export interface State { - signupComplete: boolean; + member: Member; pending: boolean; error: RESTClientError; } export const initialState: State = { - signupComplete: false, + member: null, pending: false, error: null, }; export function getSelectors(selector: Selector) { return { - selectSignupComplete: createSelector(selector, (state: State) => state.signupComplete), + selectMember: createSelector(selector, (state: State) => state.member), selectPending: createSelector(selector, (state: State) => state.pending), selectError: createSelector(selector, (state: State) => state.error), }; diff --git a/src/app/pages/auth/signup/signup-page.component.html b/src/app/pages/auth/signup/signup-page.component.html index 0c0a77d..41df3b0 100644 --- a/src/app/pages/auth/signup/signup-page.component.html +++ b/src/app/pages/auth/signup/signup-page.component.html @@ -1,6 +1,6 @@
- +
diff --git a/src/app/pages/auth/signup/signup-page.component.ts b/src/app/pages/auth/signup/signup-page.component.ts index 1c935f4..138a3cc 100644 --- a/src/app/pages/auth/signup/signup-page.component.ts +++ b/src/app/pages/auth/signup/signup-page.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'of-pages-auth-signup', @@ -10,7 +10,6 @@ export class SignupPageComponent implements OnInit { returnURL: string; constructor( - private router: Router, private activatedRoute: ActivatedRoute, ) { } @@ -20,8 +19,4 @@ export class SignupPageComponent implements OnInit { initForm() { } - - signupComplete() { - this.router.navigate(['/auth/signin']); - } }