diff --git a/.angular-cli.json b/.angular-cli.json
index 49dbe99..a15ae5f 100644
--- a/.angular-cli.json
+++ b/.angular-cli.json
@@ -20,7 +20,8 @@
"prefix": "app",
"styles": [
"theme/variables.scss",
- "styles.scss"
+ "styles.scss",
+ "../node_modules/font-awesome/scss/font-awesome.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
diff --git a/package.json b/package.json
index db6e1f8..499bbaf 100644
--- a/package.json
+++ b/package.json
@@ -28,6 +28,7 @@
"core-js": "^2.4.1",
"global": "^4.3.2",
"graphql-tag": "^2.2.0",
+ "font-awesome": "^4.7.0",
"ionic-angular": "^3.2.1",
"ionicons": "^3.0.0",
"moment": "^2.18.1",
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 57dcc7b..af45f69 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -6,14 +6,15 @@ import { IonicApp, IonicModule } from 'ionic-angular';
import { AppComponent } from './app.component';
import { AppRouting } from './app.routing';
-import { LoginComponent } from './components/login/login.component';
-import { ChatComponent } from './components/chat/chat.component';
+import { LoginPageComponent } from './components/login-page/login-page.component';
+import { ChatPageComponent } from './components/chat-page/chat-page.component';
import { AuthGuard } from './services/auth-guard.service';
import { AuthenticationService } from './services/authentication.service';
import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component';
-import { ChannelComponent } from './components/channel/channel.component';
+import { ChannelViewComponent } from './components/channel-view/channel-view.component';
import { WelcomePageComponent } from './components/welcome-page/welcome-page.component';
import { ChatMessageComponent } from './components/chat-message/chat-message.component';
+import { ChannelItemComponent } from './components/channel-item/channel-item.component';
import { ApolloModule } from 'apollo-angular';
import { getClient } from './graphql/client/apollo-client';
import { GetChatDummyService } from './graphql/get-chat-dummy.service';
@@ -21,22 +22,24 @@ import { GetChatDummyService } from './graphql/get-chat-dummy.service';
@NgModule({
declarations: [
AppComponent,
- LoginComponent,
- ChatComponent,
+ LoginPageComponent,
+ ChatPageComponent,
PageNotFoundComponent,
- ChannelComponent,
+ ChannelViewComponent,
WelcomePageComponent,
ChatMessageComponent,
+ ChannelItemComponent,
],
imports: [
+ IonicModule.forRoot(AppComponent, { mode: 'md' }),
+ ApolloModule.forRoot(getClient),
BrowserModule,
FormsModule,
HttpModule,
- IonicModule.forRoot(AppComponent),
- ApolloModule.forRoot(getClient),
AppRouting,
],
providers: [AuthGuard, AuthenticationService, GetChatDummyService],
bootstrap: [IonicApp]
})
-export class AppModule { }
+export class AppModule {
+}
diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts
index 423b27b..170b9e4 100644
--- a/src/app/app.routing.ts
+++ b/src/app/app.routing.ts
@@ -1,19 +1,19 @@
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from './services/auth-guard.service';
-import { LoginComponent } from './components/login/login.component';
-import { ChatComponent } from './components/chat/chat.component';
+import { LoginPageComponent } from './components/login-page/login-page.component';
+import { ChatPageComponent } from './components/chat-page/chat-page.component';
import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component';
-import { ChannelComponent } from './components/channel/channel.component';
+import { ChannelViewComponent } from './components/channel-view/channel-view.component';
import { WelcomePageComponent } from './components/welcome-page/welcome-page.component';
const appRoutes: Routes = [
{
- path: 'chat', component: ChatComponent, canActivate: [AuthGuard], canActivateChild: [AuthGuard],
+ path: 'chat', component: ChatPageComponent, canActivate: [AuthGuard], canActivateChild: [AuthGuard],
children: [
{
path: 'channel/:id',
- component: ChannelComponent
+ component: ChannelViewComponent
},
{
path: 'welcome-page',
@@ -26,7 +26,7 @@ const appRoutes: Routes = [
}
]
},
- { path: 'login', component: LoginComponent },
+ { path: 'login', component: LoginPageComponent },
{ path: '', redirectTo: 'chat', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent }
];
diff --git a/src/app/components/channel-item/channel-item.component.html b/src/app/components/channel-item/channel-item.component.html
new file mode 100644
index 0000000..7f12f5f
--- /dev/null
+++ b/src/app/components/channel-item/channel-item.component.html
@@ -0,0 +1,11 @@
+
+
+
+ {{channel.title}}
+
+
+
+
+
+
+
diff --git a/src/app/components/channel-item/channel-item.component.scss b/src/app/components/channel-item/channel-item.component.scss
new file mode 100644
index 0000000..c92e102
--- /dev/null
+++ b/src/app/components/channel-item/channel-item.component.scss
@@ -0,0 +1,38 @@
+.channel-item {
+ display: flex;
+ justify-content: space-between;
+ font-size: 15px;
+ padding: 5px 10px 5px 5px;
+}
+
+.channel-item:hover {
+ background-color: rgba(0,0,0,0.2);
+}
+
+.channel-icon {
+ color: rgba(255, 255, 255, 0.3);
+ font-size: 14px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 16px;
+ margin: 3px;
+}
+
+.channel-title {
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+}
+
+.hide-channel-icon, .exit-channel-icon {
+ font-size: 14px;
+ color: rgba(255, 255, 255, 0.3);
+ &:hover {
+ color: rgba(255, 255, 255, 0.6);
+ }
+}
+
+.hide-channel-icon {
+ margin-right: 10px;
+}
diff --git a/src/app/components/channel-item/channel-item.component.ts b/src/app/components/channel-item/channel-item.component.ts
new file mode 100644
index 0000000..89959bd
--- /dev/null
+++ b/src/app/components/channel-item/channel-item.component.ts
@@ -0,0 +1,42 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
+
+@Component({
+ selector: 'channel-item',
+ templateUrl: './channel-item.component.html',
+ styleUrls: ['./channel-item.component.scss']
+})
+export class ChannelItemComponent implements OnInit {
+ @Input()
+ channel: any;
+ channelSymbol: string;
+
+
+ constructor(private router: Router, private route: ActivatedRoute) {
+ }
+
+ gotoChannel(channelId) {
+ this.router.navigate(['channel', channelId], { relativeTo: this.route });
+ }
+
+ ngOnInit(): void {
+ if (this.channel.direct) {
+ this.channelSymbol = 'at';
+ }
+ else if (this.channel.privateChannel) {
+ this.channelSymbol = 'lock';
+ }
+ else {
+ this.channelSymbol = 'hashtag';
+ }
+ }
+
+ exitChannel() {
+
+ }
+
+ hideChannel() {
+
+ }
+
+}
diff --git a/src/app/components/channel/channel.component.html b/src/app/components/channel-view/channel-view.component.html
similarity index 77%
rename from src/app/components/channel/channel.component.html
rename to src/app/components/channel-view/channel-view.component.html
index c7da56d..09b15ab 100644
--- a/src/app/components/channel/channel.component.html
+++ b/src/app/components/channel-view/channel-view.component.html
@@ -1,4 +1,7 @@
-
+
@@ -18,7 +21,7 @@
-
diff --git a/src/app/components/channel-view/channel-view.component.scss b/src/app/components/channel-view/channel-view.component.scss
new file mode 100644
index 0000000..79a4f01
--- /dev/null
+++ b/src/app/components/channel-view/channel-view.component.scss
@@ -0,0 +1,25 @@
+.channel-view-header {
+ display: flex;
+ flex-direction: row-reverse;
+}
+
+.menu-button {
+ width: 48px;
+}
+
+.menu-button:hover{
+ background-color: rgb(200,200,200);
+}
+
+.message-row {
+ display: flex;
+}
+
+.message-input {
+
+}
+
+.send-button {
+ background: #f4f4f4;
+ width: 48px;
+}
diff --git a/src/app/components/channel/channel.component.ts b/src/app/components/channel-view/channel-view.component.ts
similarity index 91%
rename from src/app/components/channel/channel.component.ts
rename to src/app/components/channel-view/channel-view.component.ts
index e78f563..1f12d48 100644
--- a/src/app/components/channel/channel.component.ts
+++ b/src/app/components/channel-view/channel-view.component.ts
@@ -3,10 +3,10 @@ import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'channel',
- templateUrl: './channel.component.html',
- styleUrls: ['./channel.component.scss'],
+ templateUrl: './channel-view.component.html',
+ styleUrls: ['./channel-view.component.scss'],
})
-export class ChannelComponent implements OnInit, OnDestroy {
+export class ChannelViewComponent implements OnInit, OnDestroy {
@ViewChild('chatContent') chatContent: any;
public channel;
diff --git a/src/app/components/channel/channel.component.scss b/src/app/components/channel/channel.component.scss
deleted file mode 100644
index 84df6a7..0000000
--- a/src/app/components/channel/channel.component.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-.message-row {
-}
-
-.message-input {
-
-}
-
-.send-button {
- background: #f4f4f4;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 50px;
-}
diff --git a/src/app/components/chat/chat.component.html b/src/app/components/chat-page/chat-page.component.html
similarity index 64%
rename from src/app/components/chat/chat.component.html
rename to src/app/components/chat-page/chat-page.component.html
index 5d7c2b1..d1f5dc9 100644
--- a/src/app/components/chat/chat.component.html
+++ b/src/app/components/chat-page/chat-page.component.html
@@ -4,7 +4,8 @@