Skip to content

Commit

Permalink
new homescreen I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Jun 7, 2023
1 parent 47c849a commit c8c01f9
Show file tree
Hide file tree
Showing 28 changed files with 342 additions and 219 deletions.
12 changes: 12 additions & 0 deletions client/package-lock.json

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

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"@angular/service-worker": "^16.0.0",
"@auth0/angular-jwt": "^5.1.2",
"@capacitor/app": "5.0.2",
"@capacitor/core": "5.0.4",
"@capacitor/haptics": "5.0.2",
Expand Down
16 changes: 11 additions & 5 deletions client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { AuthGuard } from './auth.guard';

const routes: Routes = [
{
path: '',
redirectTo: 'folder/Inbox',
pathMatch: 'full'
canActivate: [AuthGuard],
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
{
path: 'login',
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
},
{
path: 'folder/:id',
loadChildren: () => import('./folder/folder.module').then( m => m.FolderPageModule)
}
path: '**',
redirectTo: '',
pathMatch: 'full'
},
];

@NgModule({
Expand Down
16 changes: 4 additions & 12 deletions client/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<ion-split-pane contentId="main-content">
<ion-menu contentId="main-content" type="overlay">
<ion-content>
<ion-list id="inbox-list">
<ion-list-header>Inbox</ion-list-header>
<ion-note>[email protected]</ion-note>
<ion-list>
<ion-list-header class="hero-header">
Eat Oats, Nerd
</ion-list-header>

<ion-menu-toggle auto-hide="false" *ngFor="let p of appPages; let i = index">
<ion-item routerDirection="root" [routerLink]="[p.url]" lines="none" detail="false" routerLinkActive="selected">
Expand All @@ -13,15 +14,6 @@
</ion-item>
</ion-menu-toggle>
</ion-list>

<ion-list id="labels-list">
<ion-list-header>Labels</ion-list-header>

<ion-item *ngFor="let label of labels" lines="none">
<ion-icon aria-hidden="true" slot="start" ios="bookmark-outline" md="bookmark-sharp"></ion-icon>
<ion-label>{{ label }}</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<ion-router-outlet id="main-content"></ion-router-outlet>
Expand Down
119 changes: 2 additions & 117 deletions client/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,119 +1,4 @@
ion-menu ion-content {
--background: var(--ion-item-background, var(--ion-background-color, #fff));
}

ion-menu.md ion-content {
--padding-start: 8px;
--padding-end: 8px;
--padding-top: 20px;
--padding-bottom: 20px;
}

ion-menu.md ion-list {
padding: 20px 0;
}

ion-menu.md ion-note {
margin-bottom: 30px;
}

ion-menu.md ion-list-header,
ion-menu.md ion-note {
padding-left: 10px;
}

ion-menu.md ion-list#inbox-list {
border-bottom: 1px solid var(--ion-color-step-150, #d7d8da);
}

ion-menu.md ion-list#inbox-list ion-list-header {
font-size: 22px;
font-weight: 600;

min-height: 20px;
}

ion-menu.md ion-list#labels-list ion-list-header {
font-size: 16px;

margin-bottom: 18px;

color: #757575;

min-height: 26px;
}

ion-menu.md ion-item {
--padding-start: 10px;
--padding-end: 10px;
border-radius: 4px;
}

ion-menu.md ion-item.selected {
--background: rgba(var(--ion-color-primary-rgb), 0.14);
}

ion-menu.md ion-item.selected ion-icon {
color: var(--ion-color-primary);
}

ion-menu.md ion-item ion-icon {
color: #616e7e;
.hero-header {
min-height: 300px;
}

ion-menu.md ion-item ion-label {
font-weight: 500;
}

ion-menu.ios ion-content {
--padding-bottom: 20px;
}

ion-menu.ios ion-list {
padding: 20px 0 0 0;
}

ion-menu.ios ion-note {
line-height: 24px;
margin-bottom: 20px;
}

ion-menu.ios ion-item {
--padding-start: 16px;
--padding-end: 16px;
--min-height: 50px;
}

ion-menu.ios ion-item.selected ion-icon {
color: var(--ion-color-primary);
}

ion-menu.ios ion-item ion-icon {
font-size: 24px;
color: #73849a;
}

ion-menu.ios ion-list#labels-list ion-list-header {
margin-bottom: 8px;
}

ion-menu.ios ion-list-header,
ion-menu.ios ion-note {
padding-left: 16px;
padding-right: 16px;
}

ion-menu.ios ion-note {
margin-bottom: 8px;
}

ion-note {
display: inline-block;
font-size: 16px;

color: var(--ion-color-medium-shade);
}

ion-item.selected {
--color: var(--ion-color-primary);
}
22 changes: 14 additions & 8 deletions client/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { Component } from '@angular/core';

interface IMenuItem {
title: string;
url: string;
icon: string;
}

@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
public appPages = [
{ title: 'Inbox', url: '/folder/inbox', icon: 'mail' },
{ title: 'Outbox', url: '/folder/outbox', icon: 'paper-plane' },
{ title: 'Favorites', url: '/folder/favorites', icon: 'heart' },
{ title: 'Archived', url: '/folder/archived', icon: 'archive' },
{ title: 'Trash', url: '/folder/trash', icon: 'trash' },
{ title: 'Spam', url: '/folder/spam', icon: 'warning' },
public appPages: IMenuItem[] = [
{
title: 'Home',
url: '',
icon: 'home'
}
];
public labels = ['Family', 'Friends', 'Notes', 'Work', 'Travel', 'Reminders'];

constructor() {}
}
13 changes: 13 additions & 0 deletions client/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { HttpClientModule } from "@angular/common/http";
import { NgModule, isDevMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { JwtModule } from "@auth0/angular-jwt";

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { NgxsReduxDevtoolsPluginModule } from '@ngxs/devtools-plugin';
Expand All @@ -15,12 +17,23 @@ import { AppComponent } from './app.component';
const Migrations: Record<any, any> = {};
const allStores: any[] = [];

export function getAuthToken() {
return localStorage.getItem('authToken');
}

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule,
HttpClientModule,
JwtModule.forRoot({
config: {
tokenGetter: getAuthToken,
allowedDomains: ["ateoat.com"],
},
}),
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: !isDevMode(),
// Register the ServiceWorker as soon as the application is stable
Expand Down
19 changes: 19 additions & 0 deletions client/src/app/auth.guard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from './auth.service';

@Injectable({
providedIn: 'root'
})
export class AuthGuard {
constructor(public auth: AuthService, public router: Router) {}

canActivate(): boolean {
if (!this.auth.isAuthenticated()) {
this.router.navigate(['login']);
return false;
}

return true;
}
}
23 changes: 23 additions & 0 deletions client/src/app/auth.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Injectable } from '@angular/core';
import { JwtHelperService } from '@auth0/angular-jwt';

@Injectable({
providedIn: 'root'
})
export class AuthService {

constructor(public jwtHelper: JwtHelperService) { }

public isAuthenticated(): boolean {
const token = localStorage.getItem('token');
return !this.jwtHelper.isTokenExpired(token);
}

public login(email: string, password: string): void {

}

public register(email: string, password: string, username: string): void {

}
}
21 changes: 0 additions & 21 deletions client/src/app/folder/folder.page.html

This file was deleted.

28 changes: 0 additions & 28 deletions client/src/app/folder/folder.page.scss

This file was deleted.

17 changes: 0 additions & 17 deletions client/src/app/folder/folder.page.ts

This file was deleted.

Loading

0 comments on commit c8c01f9

Please sign in to comment.