This repository was archived by the owner on Oct 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Sidenav design #16
Merged
+94
−43
Merged
Sidenav design #16
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,24 @@ | ||
| <md-sidenav-container fullscreen> | ||
| <div class="app-fullpage"> | ||
| <md-toolbar color="accent" class="mat-elevation-z6"> | ||
| <button md-icon-button (click)="sidenav.toggle()"> | ||
| <md-icon> | ||
| menu | ||
| </md-icon> | ||
| </button> | ||
| <md-icon> | ||
| menu | ||
| </md-icon> | ||
| </button> | ||
| <span class="title"> RxJS Docs </span> | ||
| </md-toolbar> | ||
| <md-sidenav #sidenav> | ||
| <md-toolbar> | ||
| <span> | ||
| <button md-button routerLink="/"> | ||
| Home | ||
| </button> | ||
| </span> | ||
| <md-toolbar-row> | ||
| <button md-button routerLink="/operators"> | ||
| Operators | ||
| </button> | ||
| </md-toolbar-row> | ||
| <md-toolbar-row> | ||
| <button md-button routerLink="/companies"> | ||
| Companies | ||
| </button> | ||
| </md-toolbar-row> | ||
| <md-toolbar-row> | ||
| <button md-button routerLink="/team"> | ||
| Team | ||
| </button> | ||
| </md-toolbar-row> | ||
| </md-toolbar> | ||
| </md-sidenav> | ||
| <div class="body-margin"> | ||
| <router-outlet></router-outlet> | ||
| </div> | ||
| </md-sidenav-container> | ||
| <md-sidenav-container> | ||
| <md-sidenav #sidenav> | ||
| <md-nav-list (click)="sidenav.toggle()"> | ||
| <a *ngFor="let menu of menus" md-list-item routerLinkActive="active" | ||
| [routerLinkActiveOptions]="menu.options" | ||
| [routerLink]="menu.link"> | ||
| {{menu.title}} | ||
| </a> | ||
| </md-nav-list> | ||
| </md-sidenav> | ||
| <div class="body-margin"> | ||
| <router-outlet></router-outlet> | ||
| </div> | ||
| </md-sidenav-container> | ||
| </div> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,37 @@ | ||
| import { Component } from '@angular/core'; | ||
|
|
||
| class Menu { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we update this to an interface?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @feloy thoughts?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll do that |
||
| title: string; | ||
| link: string; | ||
| options: { exact: boolean }; | ||
| } | ||
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| templateUrl: './app.component.html', | ||
| styleUrls: ['./app.component.scss'] | ||
| }) | ||
| export class AppComponent { | ||
| title = 'app'; | ||
| menus: Menu[] = [ | ||
| { | ||
| title: 'Home', | ||
| link: '/', | ||
| options: { exact: true } | ||
| }, | ||
| { | ||
| title: 'Operators', | ||
| link: '/operators', | ||
| options: { exact: false } | ||
| }, | ||
| { | ||
| title: 'Companies', | ||
| link: '/companies', | ||
| options: { exact: false } | ||
| }, | ||
| { | ||
| title: 'Team', | ||
| link: '/team', | ||
| options: { exact: false } | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,46 @@ | ||
| @import '~@angular/material/prebuilt-themes/indigo-pink.css'; | ||
| @import "~@angular/material/theming"; | ||
| @include mat-core(); | ||
|
|
||
| // Define the theme. | ||
| $primary: mat-palette($mat-indigo); | ||
| $accent: mat-palette($mat-pink); | ||
| $theme: mat-light-theme($primary, $accent); | ||
| @include angular-material-theme($theme); | ||
|
|
||
| body { | ||
| font-family: Roboto; | ||
| margin: 0px; | ||
| } | ||
| font-family: Roboto, sans-serif; | ||
| } | ||
|
|
||
| html, body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .app-fullpage { | ||
| position: absolute; | ||
| top: 0; | ||
| bottom: 0; | ||
| left: 0; | ||
| right: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| md-sidenav-container { | ||
| flex: 1 1 auto; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| md-sidenav { | ||
| width: 200px; | ||
| } | ||
|
|
||
| md-sidenav a.active .mat-list-item-content { | ||
| color: mat-color($accent); | ||
| } | ||
|
|
||
| .body-margin { | ||
| margin: 50px; | ||
| } | ||
| .body-margin { | ||
| margin: 50px; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make the toolbar sticky, thoughts? @ladyleet @feloy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look how to do this. Previous solution wasn't perfect because sidenav was on top of toolbar.
It seems that "md-sidenav-container fullscreen" is not usable with a toolbar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact the toolbar is already sticky, isn't it? At least on Chrome and Firefox on Linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, just tested again and it looks great! 👍