Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

fix: sidebar and topbar now hold the two alternative versions #47

Merged
merged 2 commits into from
May 29, 2020
Merged
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
11 changes: 1 addition & 10 deletions src/actions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const CLOSE_SNACKBAR = 'CLOSE_SNACKBAR';

export const navigate = path => dispatch => {
// Extract the page name from path.
const page = path === '/' ? 'view1' : path.slice(1);
const page = path === '/' ? 'oae' : path.slice(1);

// Any other info you might want to extract from the path (like page type),
// you can do here
Expand All @@ -28,15 +28,6 @@ export const navigate = path => dispatch => {

const loadPage = page => dispatch => {
switch (page) {
case 'view1':
import('../components/my-view1.js').then((module) /* eslint-disable-line no-unused-vars */ => {
// Put code in here that you want to run every time when
// navigating to view1 after my-view1.js is loaded.
});
break;
case 'view2':
import('../components/my-view2.js');
break;
case 'oae':
import('../components/oae.js');
break;
Expand Down
4 changes: 2 additions & 2 deletions src/components/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import dashboardStyles from '../../style/dashboard.scss';
import dashboardButtonsStyles from '../../style/dashboard-filter.scss';
import { PageViewElement } from './page-view-element.js';
import '@polymer/iron-icons/iron-icons.js';
import './sidebarV2.js';
import './top-navV2.js';
import './top-nav.js';
import './sidebar.js';
import './info-card.js';
import './tag-card.js';
import './news-feed.js';
Expand Down
4 changes: 2 additions & 2 deletions src/components/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sharedStyles from '../../style/app.scss';
import groupStyles from '../../style/groups.scss';
import groupButtonStyles from '../../style/groups-filter.scss';
import { PageViewElement } from './page-view-element.js';
import './sidebarV2.js';
import './top-navV2.js';
import './top-nav.js';
import './sidebar.js';
import './groups-feed.js';
import './groups-about.js';
import './news-feed.js';
Expand Down
4 changes: 2 additions & 2 deletions src/components/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import sharedStyles from '../../style/app.scss';
import library from '../../style/library.scss';
import { PageViewElement } from './page-view-element.js';
import '@polymer/iron-icons/iron-icons.js';
import './sidebarV2.js';
import './top-navV2.js';
import './sidebar.js';
import './top-nav.js';
import './info-card.js';
import './tag-card.js';
import './news-feed.js';
Expand Down
41 changes: 1 addition & 40 deletions src/components/my-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class MyApp extends connect(store)(LitElement) {
}

.main-content {
padding-top: 64px;
min-height: 100vh;
}

Expand Down Expand Up @@ -175,10 +174,6 @@ class MyApp extends connect(store)(LitElement) {
display: none;
}

.main-content {
padding-top: 107px;
}

/* The drawer button isn't shown in the wide layout, so we don't
need to offset the title */
[main-title] {
Expand All @@ -193,40 +188,7 @@ class MyApp extends connect(store)(LitElement) {
// Anything that's related to rendering should be done in here.
return html`
<!-- Header -->
<app-header condenses reveals effects="waterfall">
<app-toolbar class="toolbar-top">
<button class="menu-btn" title="Menu" @click="${this._menuButtonClicked}">${menuIcon}</button>
<div main-title>${this.appTitle}</div>
</app-toolbar>

<!-- This gets hidden on a small screen-->
<nav class="toolbar-list">
<a ?selected="${this._page === 'view1'}" href="/view1">View One</a>
<a ?selected="${this._page === 'view2'}" href="/view2">View Two</a>
<a ?selected="${this._page === 'view3'}" href="/view3">View Three</a>
<a ?selected="${this._page === 'oae'}" href="/oae">OAE</a>
<a ?selected="${this._page === 'dashboard'}" href="/dashboard">Dashboard</a>
<a ?selected="${this._page === 'homepage'}" href="/homepage">Homepage</a>
<a ?selected="${this._page === 'library'}" href="/library">Library</a>
<a ?selected="${this._page === 'discussions'}" href="/discussions">Discussions</a>
<a ?selected="${this._page === 'groups'}" href="/groups">Groups</a>
</nav>
</app-header>

<!-- Drawer content -->
<app-drawer .opened="${this._drawerOpened}" @opened-changed="${this._drawerOpenedChanged}">
<nav class="drawer-list">
<a ?selected="${this._page === 'view1'}" href="/view1">View One</a>
<a ?selected="${this._page === 'view2'}" href="/view2">View Two</a>
<a ?selected="${this._page === 'view3'}" href="/view3">View Three</a>
<a ?selected="${this._page === 'oae'}" href="/oae">OAE</a>
<a ?selected="${this._page === 'dashboard'}" href="/dashboard">Dashboard</a>
<a ?selected="${this._page === 'homepage'}" href="/homepage">Homepage</a>
<a ?selected="${this._page === 'library'}" href="/library">Library</a>
<a ?selected="${this._page === 'discussions'}" href="/discussions">Discussions</a>
<a ?selected="${this._page === 'groups'}" href="/groups">Groups</a>
</nav>
</app-drawer>
<app-header condenses reveals effects="waterfall"> </app-header>

<!-- Main content -->
<main role="main" class="main-content">
Expand All @@ -241,7 +203,6 @@ class MyApp extends connect(store)(LitElement) {
<user-groups class="page" ?active="${this._page === 'groups'}"></user-groups>
</main>


<snack-bar ?active="${this._snackbarOpened}">
You are now ${this._offline ? 'offline' : 'online'}.
</snack-bar>
Expand Down
82 changes: 0 additions & 82 deletions src/components/my-view1.js

This file was deleted.

90 changes: 0 additions & 90 deletions src/components/my-view2.js

This file was deleted.

56 changes: 55 additions & 1 deletion src/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ class Sidebar extends LitElement {
}

render() {
return html`
let version2 = html`
<aside class="menu">
<div class="navbar-brand sidebar-brand">
<a class="navbar-item" href="http://0.0.0.0:8080/oae">
<img src="/images/logo-oae2.svg" width="112" height="28" />
</a>
</div>
<ul class="menu-list">
<li>
<span class="icon sidebar-icon">
Expand Down Expand Up @@ -57,6 +62,55 @@ class Sidebar extends LitElement {
</ul>
</aside>
`;

let version1 = html`
<aside class="menu">
<ul class="menu-list">
<li>
<span class="icon sidebar-icon">
<iron-icon icon="dashboard"></iron-icon>
</span>
<a class="dashboard">
Dashboard
</a>
</li>
<li>
<span class="icon sidebar-icon">
<iron-icon icon="av:library-books"></iron-icon>
</span>
<a class="library">
Library
</a>
</li>
<li>
<span class="icon sidebar-icon">
<iron-icon icon="content-paste"></iron-icon>
</span>
<a class="discussions">
Discussions
</a>
</li>
<li>
<span class="icon sidebar-icon">
<iron-icon icon="social:people-outline"></iron-icon>
</span>
<a class="groups">
Groups
</a>
</li>
<li>
<span class="icon sidebar-icon">
<iron-icon icon="social:public"></iron-icon>
</span>
<a class="network">
Network
</a>
</li>
</ul>
</aside>
`;

return version2;
}
}

Expand Down
Loading