This commit is contained in:
병준 박 2019-11-13 11:48:48 +09:00
commit 457c22390c
10 changed files with 131 additions and 68 deletions

View File

@ -61,6 +61,7 @@
"@types/webpack": "^4.39.5", "@types/webpack": "^4.39.5",
"@types/webpack-merge": "^4.1.5", "@types/webpack-merge": "^4.1.5",
"@types/webpack-node-externals": "^1.6.3", "@types/webpack-node-externals": "^1.6.3",
"angular-split": "^3.0.2",
"awesome-node-loader": "^1.1.1", "awesome-node-loader": "^1.1.1",
"awesome-typescript-loader": "^5.2.1", "awesome-typescript-loader": "^5.2.1",
"classlist.js": "^1.1.20150312", "classlist.js": "^1.1.20150312",

View File

@ -1,3 +1,17 @@
<div>
<span>{{ selectedRightDrawer }}</span>
<span>
<button
mat-button
matSuffix
mat-icon-button
aria-label="Close"
(click)="onClickClose()"
>
<mat-icon>close</mat-icon>
</button>
</span>
</div>
<ng-container *ngIf="selectedRightDrawer" [ngSwitch]="selectedRightDrawer"> <ng-container *ngIf="selectedRightDrawer" [ngSwitch]="selectedRightDrawer">
<app-layout-chat-right-drawer-file-box *ngSwitchCase="RightDrawer.FileBox"> <app-layout-chat-right-drawer-file-box *ngSwitchCase="RightDrawer.FileBox">
</app-layout-chat-right-drawer-file-box> </app-layout-chat-right-drawer-file-box>

View File

@ -20,6 +20,8 @@ export class RightDrawerComponent implements OnInit {
openProfile = new EventEmitter< openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>(); >();
@Output()
closeRightDrawer = new EventEmitter();
RightDrawer = RightDrawer; RightDrawer = RightDrawer;
@ -30,4 +32,8 @@ export class RightDrawerComponent implements OnInit {
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit(userInfo); this.openProfile.emit(userInfo);
} }
onClickClose() {
this.closeRightDrawer.emit();
}
} }

View File

@ -1,38 +1,57 @@
<div class="container"> <div class="container">
<div class="left-side"> <as-split
<app-layout-messenger-left-side unit="pixel"
(openProfile)="onClickOpenProfile($event)" gutterSize="5"
></app-layout-messenger-left-side> useTransition="true"
</div> gutterDblClickDuration="300"
<mat-drawer-container class="contents" autosize> (dragEnd)="onGutterDragEnd($event)"
<!-- <mat-drawer #drawer mode="over"> (gutterDblClick)="onGutterDblClick($event)"
<p>Auto-resizing sidenav</p> >
</mat-drawer> --> <as-split-area
<div class="messages"> #asSplitLeft
<app-layout-messenger-intro [size]="leftSideComponentWidth"
*ngIf="!(this.selectedChat$ | async)" minSize="300"
></app-layout-messenger-intro> maxSize="500"
<!-- <app-layout-messenger-intro
*ngIf="!(this.selectedChat$ | async)"
></app-layout-messenger-intro> -->
<app-layout-messenger-messages
*ngIf="!!(this.selectedChat$ | async)"
(openProfile)="onClickOpenProfile($event)"
></app-layout-messenger-messages>
</div>
<mat-drawer
#rightDrawer
mode="side"
position="end"
(openedChange)="onOpenedChange($event)"
> >
<app-layout-messenger-right-drawer <div class="left-side">
[selectedRightDrawer]="selectedRightDrawer$ | async" <app-layout-messenger-left-side
(openProfile)="onClickOpenProfile($event)" (openProfile)="onClickOpenProfile($event)"
> ></app-layout-messenger-left-side>
</app-layout-messenger-right-drawer> </div>
</mat-drawer> </as-split-area>
</mat-drawer-container> <as-split-area size="*">
<mat-drawer-container class="contents" autosize>
<!-- <mat-drawer #drawer mode="over">
<p>Auto-resizing sidenav</p>
</mat-drawer> -->
<div class="messages">
<app-layout-messenger-intro
*ngIf="!(this.selectedChat$ | async)"
></app-layout-messenger-intro>
<!-- <app-layout-messenger-intro
*ngIf="!(this.selectedChat$ | async)"
></app-layout-messenger-intro> -->
<app-layout-messenger-messages
*ngIf="!!(this.selectedChat$ | async)"
(openProfile)="onClickOpenProfile($event)"
></app-layout-messenger-messages>
</div>
<mat-drawer
#rightDrawer
mode="side"
position="end"
(openedChange)="onOpenedChange($event)"
>
<app-layout-messenger-right-drawer
[selectedRightDrawer]="selectedRightDrawer$ | async"
(openProfile)="onClickOpenProfile($event)"
(closeRightDrawer)="onCloseRightDrawer($event)"
>
</app-layout-messenger-right-drawer>
</mat-drawer>
</mat-drawer-container>
</as-split-area>
</as-split>
<!-- <div class="right-side"> <!-- <div class="right-side">
<app-layout-messenger-right-side></app-layout-messenger-right-side> <app-layout-messenger-right-side></app-layout-messenger-right-side>

View File

@ -3,11 +3,11 @@
display: flex; display: flex;
flex-flow: row; flex-flow: row;
padding-top: 30px; padding-top: 30px;
border:3px solid #4f4f4f; border: 3px solid #4f4f4f;
border-top:none; border-top: none;
.left-side { .left-side {
width: 380px; width: 100%;
height: 100%; height: 100%;
flex: 0 0 auto; flex: 0 0 auto;
position: relative; position: relative;

View File

@ -1,37 +1,38 @@
import { map, tap } from "rxjs/operators"; import { map, tap } from 'rxjs/operators';
import { Component, OnInit, Inject, OnDestroy, ViewChild } from "@angular/core"; import { Component, OnInit, Inject, OnDestroy, ViewChild } from '@angular/core';
import { Store, select } from "@ngrx/store"; import { Store, select } from '@ngrx/store';
import * as AppSotre from "@app/store"; import * as AppSotre from '@app/store';
import * as ChatStore from "@app/store/messenger/chat"; import * as ChatStore from '@app/store/messenger/chat';
import { Observable, Subscription } from "rxjs"; import { Observable, Subscription } from 'rxjs';
import { import {
WindowIdle, WindowIdle,
UCAP_NATIVE_SERVICE, UCAP_NATIVE_SERVICE,
NativeService NativeService,
} from "@ucap-webmessenger/native"; } from '@ucap-webmessenger/native';
import { UserInfo } from "@ucap-webmessenger/protocol-sync"; import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import { import {
UserInfoSS, UserInfoSS,
UserInfoF, UserInfoF,
UserInfoDN UserInfoDN,
} from "@ucap-webmessenger/protocol-query"; } from '@ucap-webmessenger/protocol-query';
import { StatusProtocolService } from "@ucap-webmessenger/protocol-status"; import { StatusProtocolService } from '@ucap-webmessenger/protocol-status';
import { StatusType, StatusCode } from "@ucap-webmessenger/core"; import { StatusType, StatusCode } from '@ucap-webmessenger/core';
import { DialogService } from "@ucap-webmessenger/ui"; import { DialogService } from '@ucap-webmessenger/ui';
import { import {
ProfileDialogComponent, ProfileDialogComponent,
ProfileDialogData, ProfileDialogData,
ProfileDialogResult ProfileDialogResult,
} from "@app/layouts/messenger/dialogs/profile/profile.dialog.component"; } from '@app/layouts/messenger/dialogs/profile/profile.dialog.component';
import { MatSidenav, MatDrawer } from "@angular/material"; import { MatSidenav, MatDrawer } from '@angular/material';
import { SplitAreaDirective } from 'angular-split';
@Component({ @Component({
selector: "app-page-messenger-main", selector: 'app-page-messenger-main',
templateUrl: "./main.page.component.html", templateUrl: './main.page.component.html',
styleUrls: ["./main.page.component.scss"] styleUrls: ['./main.page.component.scss'],
}) })
export class MainPageComponent implements OnInit { export class MainPageComponent implements OnInit {
selectedChat$: Observable<string | null>; selectedChat$: Observable<string | null>;
@ -39,7 +40,10 @@ export class MainPageComponent implements OnInit {
idleStateChangedSubscription: Subscription; idleStateChangedSubscription: Subscription;
chatOpenRoomSubscription: Subscription; chatOpenRoomSubscription: Subscription;
@ViewChild("rightDrawer", { static: true }) rightDrawer: MatDrawer; defaultLeftSideComponentWidth = 380;
leftSideComponentWidth = this.defaultLeftSideComponentWidth;
@ViewChild('rightDrawer', { static: true }) rightDrawer: MatDrawer;
constructor( constructor(
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
@ -75,7 +79,7 @@ export class MainPageComponent implements OnInit {
console.log(action); console.log(action);
let statusType: StatusCode; let statusType: StatusCode;
if (action === "IDLE") { if (action === 'IDLE') {
// away // away
statusType = StatusCode.Away; statusType = StatusCode.Away;
} else { } else {
@ -86,7 +90,7 @@ export class MainPageComponent implements OnInit {
this.statusProtocolService.status({ this.statusProtocolService.status({
statusDivisionType: StatusType.Messenger, statusDivisionType: StatusType.Messenger,
statusType, statusType,
statusMessage: "" statusMessage: '',
}); });
}); });
@ -111,12 +115,19 @@ export class MainPageComponent implements OnInit {
if (!event) { if (!event) {
this.store.dispatch( this.store.dispatch(
ChatStore.selectedRightDrawer({ ChatStore.selectedRightDrawer({
req: null req: null,
}) })
); );
} }
} }
onGutterDragEnd(e: { gutterNum: number; sizes: Array<number> }) {
this.leftSideComponentWidth = e.sizes[0];
}
onGutterDblClick(e: { gutterNum: number; sizes: Array<number> }) {
this.leftSideComponentWidth = this.defaultLeftSideComponentWidth;
}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.dialogService.open< this.dialogService.open<
ProfileDialogComponent, ProfileDialogComponent,
@ -124,8 +135,12 @@ export class MainPageComponent implements OnInit {
ProfileDialogResult ProfileDialogResult
>(ProfileDialogComponent, { >(ProfileDialogComponent, {
data: { data: {
userInfo userInfo,
} },
}); });
} }
onCloseRightDrawer() {
this.rightDrawer.close();
}
} }

View File

@ -11,15 +11,19 @@ import { AppMessengerRoutingPageModule } from './messenger-routing.page.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { AngularSplitModule } from 'angular-split';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
FlexLayoutModule, FlexLayoutModule,
MatSidenavModule, MatSidenavModule,
AppMessengerLayoutModule, AppMessengerLayoutModule,
AppMessengerRoutingPageModule AppMessengerRoutingPageModule,
AngularSplitModule.forRoot(),
], ],
declarations: [...COMPONENTS], declarations: [...COMPONENTS],
entryComponents: [] entryComponents: [],
}) })
export class AppMessengerPageModule {} export class AppMessengerPageModule {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -26,7 +26,9 @@
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title <mat-panel-title
>즐겨찾기 >즐겨찾기
<span>({{ favoritBuddyList.length }}명)</span></mat-panel-title <span class="text-accent-color number"
>({{ favoritBuddyList.length }}명)</span
></mat-panel-title
> >
<mat-panel-description> </mat-panel-description> <mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
@ -48,8 +50,10 @@
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title class="panel-title"> <mat-panel-title class="panel-title">
<div class="title-name ellipsis">{{ groupBuddy.group.name }}</div> <div class="title-name ellipsis">{{ groupBuddy.group.name }}</div>
<span class="text-accent-color number">({{ groupBuddy.buddyList.length }}명)</span> <span class="text-accent-color number"
</mat-panel-title> >({{ groupBuddy.buddyList.length }}명)</span
>
</mat-panel-title>
<mat-panel-description> <mat-panel-description>
<span class="more-spacer"></span> <span class="more-spacer"></span>
<button <button