-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): sidebar for sprint 2 (#34)
- Loading branch information
Showing
23 changed files
with
192 additions
and
166 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import './icon-styles.css'; | ||
import { IconColor, IconSize } from '../types.ts'; | ||
export let color = IconColor.Default; | ||
export let size = IconSize.Normal; | ||
export let alt = ''; | ||
// Replace the next lines to generate an icon. | ||
const iconUrl = new URL('../../assets/icons/menu.svg', import.meta.url); | ||
</script> | ||
|
||
<img class="{color} {size}" {alt} src="{iconUrl.pathname}" on:click on:keydown /> |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<script> | ||
import active from 'svelte-spa-router/active'; | ||
export let show = false; | ||
</script> | ||
|
||
<nav class:show={show}> | ||
<section> | ||
<a href="#/inbox" use:active>Inbox</a> | ||
<a href="#/outbox" use:active>Outbox</a> | ||
<a href="#/drafts" use:active>Drafts</a> | ||
<a href="#/barcodes" use:active>Manage Barcodes</a> | ||
<a href="#/invites" use:active>Manage Invites</a> | ||
<a href="#/staff" use:active>Manage Staff</a> | ||
<a href="#/admin" use:active>Manage Administrators</a> | ||
<a href="#/metrics" use:active>Metrics</a> | ||
<a href="#/settings" use:active>Settings</a> | ||
</section> | ||
<form method="POST" action="/auth/logout"> | ||
<input type="submit" value="Logout" /> | ||
</form> | ||
</nav> | ||
|
||
<style> | ||
@import url('../../../pages/vars.css'); | ||
nav { | ||
background-color: var(--dashboard-bg); | ||
display: flex; | ||
flex-direction: column; | ||
font-family: inherit; | ||
height: 100%; | ||
justify-content: space-between; | ||
max-width: 300px; | ||
left: -100%; | ||
position: absolute; | ||
transition: left var(--animation-length); | ||
} | ||
.show { | ||
left: 0; | ||
} | ||
a { | ||
border-right: var(--spacing-small) solid transparent; | ||
color: initial; | ||
display: block; | ||
padding: var(--spacing-normal); | ||
text-decoration: none; | ||
transition: background-color var(--animation-length), border-right var(--animation-length); | ||
} | ||
input[type="submit"] { | ||
background-color: var(--dashboard-bg); | ||
border-top: 0; | ||
border-bottom: 0; | ||
border-left: 0; | ||
border-right: var(--spacing-small) solid transparent; | ||
cursor: pointer; | ||
font-family: inherit; | ||
margin: 0; | ||
outline: 0; | ||
padding: var(--spacing-normal); | ||
text-align: initial; | ||
transition: background-color var(--animation-length), border-right var(--animation-length); | ||
width: 100%; | ||
} | ||
a:hover, input[type="submit"]:hover, :global(a.active) { | ||
background-color: var(--hover-color); | ||
border-right: var(--spacing-small) solid var(--primary-color); | ||
} | ||
</style> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script lang="ts"> | ||
import type { User } from '../../../../../model/src/user.ts'; | ||
import Hamburger from '../../icons/Menu.svelte'; | ||
export let show = false; | ||
export let user: User; | ||
</script> | ||
|
||
<nav> | ||
<div> | ||
<span id="icon"><Hamburger on:click={() => show = !show} /></span> | ||
<span>Hello, {user.name}!</span> | ||
</div> | ||
<img src={user.picture} alt="{user.name}" /> | ||
</nav> | ||
|
||
<style> | ||
@import url('../../../pages/vars.css'); | ||
nav { | ||
align-content: center; | ||
background-color: var(--primary-color); | ||
box-shadow: 0 1px var(--spacing-normal) var(--shadow-color); | ||
display: flex; | ||
justify-content: space-between; | ||
padding: var(--spacing-small); | ||
} | ||
#icon { | ||
cursor: pointer; | ||
} | ||
img { | ||
border-radius: 50%; | ||
display: block; | ||
height: 1.25rem; | ||
} | ||
</style> |
This file contains 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,22 +1,41 @@ | ||
<script lang="ts"> | ||
import Router, { push, pop, replace } from 'svelte-spa-router'; | ||
<script> | ||
import Router from 'svelte-spa-router'; | ||
import TopBar from '../../components/ui/navigationbar/TopBar.svelte'; | ||
import SideDrawer from '../../components/ui/navigationbar/SideDrawer.svelte'; | ||
import routes from './views/index.ts'; | ||
import { register } from '../register.ts'; | ||
import { Session } from '../../api/session.ts'; | ||
import Navbar from '../../components/ui/Navbar.svelte'; | ||
import Button from '../../components/ui/Button.svelte' | ||
import routes from './routes.ts'; | ||
let toggleDrawer = false; | ||
</script> | ||
|
||
<main> | ||
{#await register()} | ||
Waiting for service worker... | ||
{:then} | ||
<Navbar /> | ||
<!-- Sample navigation of pages. Implement in drawer | ||
<Button on:click={() => push('/inbox')}>Inbox</Button> | ||
<Button on:click={() => push('/outbox')}>Outbox</Button> | ||
--> | ||
<Router {routes} /> | ||
{#await Session.getUser()} | ||
Loading user... | ||
{:then user} | ||
<TopBar {user} bind:show={toggleDrawer} /> | ||
<section> | ||
<SideDrawer show={toggleDrawer} /> | ||
<Router {routes} /> | ||
</section> | ||
{/await} | ||
{/await} | ||
</main> | ||
|
||
<style> | ||
main { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
} | ||
section { | ||
height: 100%; | ||
position: relative; | ||
} | ||
</style> |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Manage Admins!</p> |
This file contains 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 @@ | ||
<div> | ||
<p>Barcodes</p> | ||
</div> | ||
|
||
|
||
<style> | ||
div{ | ||
text-align: center; | ||
} | ||
</style> | ||
<p>Barcodes!</p> |
This file contains 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 @@ | ||
<div> | ||
<p>Drafts</p> | ||
</div> | ||
|
||
|
||
<style> | ||
div{ | ||
text-align: center; | ||
} | ||
</style> | ||
<p>Drafts!</p> |
This file contains 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 @@ | ||
<div> | ||
<p>Inbox</p> | ||
</div> | ||
|
||
|
||
<style> | ||
div{ | ||
text-align: center; | ||
} | ||
</style> | ||
<p>Inbox!</p> |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Invites!</p> |
10 changes: 0 additions & 10 deletions
10
client/src/pages/dashboard/views/ManageAdministrators.svelte
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
client/src/pages/dashboard/views/ManageGlobalSettings.svelte
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 @@ | ||
<div> | ||
<p>Metrics</p> | ||
</div> | ||
|
||
|
||
<style> | ||
div{ | ||
text-align: center; | ||
} | ||
</style> | ||
<p>Metrics!</p> |
This file contains 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 @@ | ||
<div> | ||
<p>Outbox</p> | ||
</div> | ||
|
||
|
||
<style> | ||
div{ | ||
text-align: center; | ||
} | ||
</style> | ||
<p>Outbox!</p> |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Manage Settings!</p> |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Manage Staff!</p> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Barcodes from './Barcodes.svelte'; | ||
import Drafts from './Drafts.svelte'; | ||
import Inbox from './Inbox.svelte'; | ||
import ManageAdministrators from './Admins.svelte'; | ||
import ManageGlobalSettings from './Settings.svelte'; | ||
import ManageInvites from './Invites.svelte'; | ||
import ManageStaff from './Staff.svelte'; | ||
import Metrics from './Metrics.svelte'; | ||
import Outbox from './Outbox.svelte'; | ||
|
||
export default { | ||
'/barcodes': Barcodes, | ||
'/drafts': Drafts, | ||
'/inbox': Inbox, | ||
'/admin': ManageAdministrators, | ||
'/settings': ManageGlobalSettings, | ||
'/invites': ManageInvites, | ||
'/staff': ManageStaff, | ||
'/metrics': Metrics, | ||
'/outbox': Outbox, | ||
}; |
Oops, something went wrong.