diff --git a/@overflow/member/component/member-signin.component.ts b/@overflow/member/component/member-signin.component.ts index 29c1ee9..a5a4e08 100644 --- a/@overflow/member/component/member-signin.component.ts +++ b/@overflow/member/component/member-signin.component.ts @@ -2,12 +2,14 @@ import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { Store, select } from '@ngrx/store'; +import { Member } from '@overflow/commons-typescript/model/member'; @Component({ selector: 'of-member-signin', templateUrl: './member-signin.component.html', }) export class MemberSigninComponent implements OnInit { + @Input() member: Member; @Input() signinError: string; @Output() resetPassword = new EventEmitter(); @Output() signup = new EventEmitter(); diff --git a/@overflow/member/container/member-signin-container.component.html b/@overflow/member/container/member-signin-container.component.html index efa3b0a..20ba404 100644 --- a/@overflow/member/container/member-signin-container.component.html +++ b/@overflow/member/container/member-signin-container.component.html @@ -1 +1,5 @@ - + + diff --git a/@overflow/member/container/member-signin-container.component.ts b/@overflow/member/container/member-signin-container.component.ts index 4319483..833de45 100644 --- a/@overflow/member/container/member-signin-container.component.ts +++ b/@overflow/member/container/member-signin-container.component.ts @@ -7,6 +7,7 @@ import { Observable } from 'rxjs'; import { MemberSigninContainerSelector } from '../store'; import * as MemberEntityStore from '../store/entity/member'; +import { Member } from '@overflow/commons-typescript/model/member'; @Component({ selector: 'of-member-signin-container', @@ -14,6 +15,7 @@ import * as MemberEntityStore from '../store/entity/member'; }) export class MemberSigninContainerComponent implements OnInit { @Input() returnURL: string; + member$: Observable; pending$: Observable; error$: Observable; @@ -23,6 +25,7 @@ export class MemberSigninContainerComponent implements OnInit { } ngOnInit() { + this.member$ = this.store.pipe(select(MemberSigninContainerSelector.selectMember)); this.pending$ = this.store.pipe(select(MemberSigninContainerSelector.selectPending)); this.error$ = this.store.pipe(select(MemberSigninContainerSelector.selectError)); } diff --git a/@overflow/member/store/container/signin/member-signin.reducer.ts b/@overflow/member/store/container/signin/member-signin.reducer.ts index 0231ba3..4893265 100644 --- a/@overflow/member/store/container/signin/member-signin.reducer.ts +++ b/@overflow/member/store/container/signin/member-signin.reducer.ts @@ -18,6 +18,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut switch (action.type) { case MemberActionType.Signin: { return { + member: null, pending: true, error: null, }; @@ -25,6 +26,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut case AuthActionType.SigninSuccess: { return { + member: action.payload.domainMember.member, pending: false, error: null, }; @@ -32,6 +34,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut case AuthActionType.SigninFailure: { return { + member: null, pending: false, error: action.payload, }; diff --git a/@overflow/member/store/container/signin/member-signin.state.ts b/@overflow/member/store/container/signin/member-signin.state.ts index 39f65af..4af3d3b 100644 --- a/@overflow/member/store/container/signin/member-signin.state.ts +++ b/@overflow/member/store/container/signin/member-signin.state.ts @@ -1,19 +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 { + member: Member; pending: boolean; error: RESTClientError; } export const initialState: State = { + member: null, pending: false, error: null, }; export function getSelectors(selector: Selector) { return { + 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/commons/component/layout/banner/app.banner.component.html b/src/app/commons/component/layout/banner/app.banner.component.html new file mode 100644 index 0000000..acebae4 --- /dev/null +++ b/src/app/commons/component/layout/banner/app.banner.component.html @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/src/app/commons/component/layout/banner/app.banner.component.ts b/src/app/commons/component/layout/banner/app.banner.component.ts new file mode 100644 index 0000000..3fa3122 --- /dev/null +++ b/src/app/commons/component/layout/banner/app.banner.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; +import { trigger, state, transition, style, animate } from '@angular/animations'; +import { ActivatedRoute, Router } from '@angular/router'; +import { select, Store } from '@ngrx/store'; +import { Observable } from 'rxjs/Observable'; + + +@Component({ + selector: 'of-site-banner-container', + templateUrl: './app.banner.component.html', +}) +export class AppBannerComponent implements OnInit { + + constructor( + private store: Store, + ) { + } + + ngOnInit() { + } +} diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index 936a519..f509dc6 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -8,6 +8,7 @@ import { AppFooterComponent } from '../commons/component/layout/footer/app.foote import { AppBreadcrumbComponent } from '../commons/component/layout/breadcrumb/app.breadcrumb.component'; import { AppRightpanelComponent } from '../commons/component/layout/right-panel/app.rightpanel.component'; import { AppInlineProfileComponent } from '../commons/component/layout/profile/app.profile.component'; +import { AppBannerComponent } from '../commons/component/layout/banner/app.banner.component'; import { BreadcrumbService } from '../commons/service/breadcrumb.service'; import { LocalizationModule, @@ -38,6 +39,7 @@ import { NotificationModule } from '@overflow/notification/notification.module'; AppBreadcrumbComponent, AppRightpanelComponent, AppInlineProfileComponent, + AppBannerComponent, ], providers: [ { provide: LocationStrategy, useClass: HashLocationStrategy },