Skip to content

Commit

Permalink
adds minor QoL changes
Browse files Browse the repository at this point in the history
sidebar is collapsible, list table is now 2x larger font, page not found page now has GH repo button
  • Loading branch information
mattxwang committed Mar 12, 2018
1 parent 03e9bca commit c0cfbba
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fair-chair",
"productName": "Fair Chair",
"version": "1.0.0",
"version": "1.0.0-beta",
"description": "Fair Chair, a desktop application that making chairing Model United Nations committees easy.",
"main": "src/index.ts",
"scripts": {
Expand Down
13 changes: 11 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ElectronService } from 'ngx-electron';
template: `
<div class="container-fluid">
<div class="row">
<nav class="col-sm-2 d-none d-sm-block bg-dark sidebar">
<nav [hidden]="!showSidebar" class="col-2 bg-dark sidebar">
<img class="sidebar-logo" src="assets/img/logo.png"/>
<h1 class="sidebar-title mt-1">Fair Chair</h1>
<div class="sidebar-subtitle">
Expand Down Expand Up @@ -39,15 +39,24 @@ import { ElectronService } from 'ngx-electron';
<i class="fa fa-fw fa-code"></i> <i class="fa fa-fw fa-heart" style="color:tomato;"></i> <a (click)="openLink('https://github.com/malsf21/fair-chair/')"><i class="fab fa-fw fa-github"></i></a> <span (click)="openLink('https://matthewwang.me')"><u>by Matthew Wang</u></span>
</div>
</nav>
<main role="main" class="col-sm-10 ml-sm-auto mt-3 app-main">
<main role="main" [ngClass]="{'col-10': showSidebar, 'col-12': !showSidebar }" class="ml-auto mt-3 app-main">
<a class="sidebar-toggle-button" (click)="toggleSidebar()">
<div [hidden]="!showSidebar"><i class="fa fa-2x fa-caret-left" style="color:white;"></i></div>
<div [hidden]="showSidebar"><i class="fa fa-2x fa-caret-right"></i></div>
</a>
<router-outlet></router-outlet>
</main>
</div>
</div>
`
})
export class AppComponent {
showSidebar: boolean;
constructor (private electronService: ElectronService){
this.showSidebar = true;
}
toggleSidebar(){
this.showSidebar = !this.showSidebar;
}
openLink(link: string){
this.electronService.shell.openExternal(link);
Expand Down
8 changes: 8 additions & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ body{
margin-right: auto;
}

.sidebar-toggle-button{
position: fixed;
top: 0;
bottom: 0;
left: 0.5em;
z-index: 1000;
}

/*
* Main Views
*/
Expand Down
2 changes: 1 addition & 1 deletion src/pages/lists/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
</div>
<div class="table-responsive">
<table class="table table-striped">
<table class="table table-striped fa-2x">
<thead>
<tr>
<th>#</th>
Expand Down
15 changes: 13 additions & 2 deletions src/pages/not-found/not-found.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import { Component } from '@angular/core';
import { ElectronService } from 'ngx-electron';

@Component({
template: '<h2>Page not found</h2>'
template: `
<h2>Page not found</h2>
<p>This means that something went wrong. If you can, please submit an issue on our GitHub repository.</p>
<button class="btn btn-danger" (click)="openLink('https://github.com/malsf21/fair-chair/')"><i class="fab fa-github"></i> GitHub Repository</button>
`
})
export class PageNotFoundComponent {}
export class PageNotFoundComponent {
constructor (private electronService: ElectronService){
}
openLink(link: string){
this.electronService.shell.openExternal(link);
}
}

0 comments on commit c0cfbba

Please sign in to comment.