Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update navbar #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ import { ArticleService } from './services/article.service';
import { QuillModule } from 'ngx-quill';
import { CreateArticleComponent } from './secure/create-article/create-article.component';
import { EditArticleComponent } from './secure/edit-article/edit-article.component';
import { ProfileComponent } from './public/profile/profile.component';

const router: Routes = [
{ path: 'sign-in' , component: SignInComponent},
{ path: 'sign-up' , component: SignUpComponent},
{ path: 'createarticle', component: CreateArticleComponent},
{ path: 'create-article', component: CreateArticleComponent},
{ path: 'home' , component: HomeComponent},
{ path: 'article' , component: ArticleComponent},
{ path: 'article/:id' , component: ArticleComponent},
{ path: '' , redirectTo: '/home' , pathMatch: 'full'}
{ path: 'profile', component: ProfileComponent},
{ path: '' , redirectTo: '/home' , pathMatch: 'full'},
{ path: '**', redirectTo: '/home'}
];

@NgModule({
Expand All @@ -42,6 +44,7 @@ const router: Routes = [
ArticleComponent,
CreateArticleComponent,
EditArticleComponent,
ProfileComponent,
],
imports: [
BrowserModule,
Expand Down
3 changes: 3 additions & 0 deletions src/app/public/profile/profile.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>
profile works!
</p>
Empty file.
25 changes: 25 additions & 0 deletions src/app/public/profile/profile.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ProfileComponent } from './profile.component';

describe('ProfileComponent', () => {
let component: ProfileComponent;
let fixture: ComponentFixture<ProfileComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ProfileComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ProfileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions src/app/public/profile/profile.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.scss']
})
export class ProfileComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
5 changes: 4 additions & 1 deletion src/app/shared/top-nav/top-nav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
</ul>
<ul class="nav navbar-nav nav-flex-icons ml-auto ie-double-nav" *ngIf="user">
<li class="nav-item">
<a class="nav-link waves-light" mdbWavesEffect><i class="fa fa-user"></i> <span class="clearfix d-none d-sm-inline-block">Account</span></a>
<a routerLink="/create-article" class="nav-link waves-light" mdbWavesEffect><i class="fa fa-plus-square"></i><span class="clearfix d-none d-sm-inline-block">&nbsp;New blog</span></a>
</li>
<li class="nav-item">
<a routerLink="/profile" class="nav-link waves-light" mdbWavesEffect><i class="fa fa-user"></i><span class="clearfix d-none d-sm-inline-block">&nbsp;Account</span></a>
</li>
<li class="nav-item dropdown btn-group" dropdown>
<a dropdownToggle type="button" class="nav-link dropdown-toggle waves-light" mdbWavesEffect>
Expand Down