Skip to content

Commit

Permalink
Add prettier config file & format all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav2070 committed Feb 2, 2024
1 parent 8ce777c commit 73e32ad
Show file tree
Hide file tree
Showing 68 changed files with 7,265 additions and 5,449 deletions.
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tabWidth": 3,
"useTabs": true,
"semi": false,
"trailingComma": "none",
"arrowParens": "avoid",
"singleQuote": false
}
102 changes: 79 additions & 23 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
<nav class="navbar navbar-expand-md navbar-dark bg-primary default-font mat-elevation-z10" id="calendo-navbar">
<a class="navbar-brand ml-3" routerLink="/" style="font-size: 25px">Calendo</a>
<nav
class="navbar navbar-expand-md navbar-dark bg-primary default-font mat-elevation-z10"
id="calendo-navbar"
>
<a class="navbar-brand ml-3" routerLink="/" style="font-size: 25px"
>Calendo</a
>

<div class="collapse navbar-collapse" id="navbar-items" [ngClass]="dataService.smallWindow ? '' : 'd-flex justify-content-center'" style="font-size: 20px;">
<div
class="collapse navbar-collapse"
id="navbar-items"
[ngClass]="dataService.smallWindow ? '' : 'd-flex justify-content-center'"
style="font-size: 20px"
>
<ul class="navbar-nav text-white">
<li class="nav-item mx-3 my-auto">
<a routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" class="nav-link">{{ locale.start }}</a>
<a
routerLink="/"
routerLinkActive="active"
[routerLinkActiveOptions]="{ exact: true }"
class="nav-link"
>{{ locale.start }}</a
>
</li>
<li class="nav-item mx-3 my-auto">
<a routerLink="/calendar" routerLinkActive="active" class="nav-link">{{ locale.calendar }}</a>
<a
routerLink="/calendar"
routerLinkActive="active"
class="nav-link"
>{{ locale.calendar }}</a
>
</li>
<li class="nav-item mx-3 my-auto">
<a routerLink="/todos" routerLinkActive="active" class="nav-link">{{ locale.todos }}</a>
<a routerLink="/todos" routerLinkActive="active" class="nav-link">{{
locale.todos
}}</a>
</li>
<li class="nav-item mx-3 my-auto">
<a routerLink="/appointments" routerLinkActive="active" class="nav-link">{{ locale.appointments }}</a>
<a
routerLink="/appointments"
routerLinkActive="active"
class="nav-link"
>{{ locale.appointments }}</a
>
</li>
</ul>
</div>

<calendo-user-menu style="margin-right: -6px"></calendo-user-menu>
</nav>

Expand All @@ -28,37 +56,65 @@
<div
id="bottom-navigation-bar"
class="bg-primary d-flex flex-row"
*ngIf="dataService.smallWindow">

*ngIf="dataService.smallWindow"
>
<button
mat-flat-button
class="bottom-navigation-button flex-fill"
routerLink="/">
<img src="/assets/svgs/home-white-outlined.svg" [style.display]="currentUrl == '/' ? 'none' : ''">
<img src="/assets/svgs/home-white-filled.svg" [style.display]="currentUrl == '/' ? '' : 'none'">
routerLink="/"
>
<img
src="/assets/svgs/home-white-outlined.svg"
[style.display]="currentUrl == '/' ? 'none' : ''"
/>
<img
src="/assets/svgs/home-white-filled.svg"
[style.display]="currentUrl == '/' ? '' : 'none'"
/>
</button>

<button
mat-flat-button
class="bottom-navigation-button flex-fill"
routerLink="/calendar">
<img src="/assets/svgs/event_note-white-outlined.svg" [style.display]="currentUrl == '/calendar' ? 'none' : ''">
<img src="/assets/svgs/event_note-white-filled.svg" [style.display]="currentUrl == '/calendar' ? '' : 'none'">
routerLink="/calendar"
>
<img
src="/assets/svgs/event_note-white-outlined.svg"
[style.display]="currentUrl == '/calendar' ? 'none' : ''"
/>
<img
src="/assets/svgs/event_note-white-filled.svg"
[style.display]="currentUrl == '/calendar' ? '' : 'none'"
/>
</button>

<button
mat-flat-button
class="bottom-navigation-button flex-fill"
routerLink="/todos">
<img src="/assets/svgs/check_box-white-outlined.svg" [style.display]="currentUrl == '/todos' ? 'none' : ''">
<img src="/assets/svgs/check_box-white-filled.svg" [style.display]="currentUrl == '/todos' ? '' : 'none'">
routerLink="/todos"
>
<img
src="/assets/svgs/check_box-white-outlined.svg"
[style.display]="currentUrl == '/todos' ? 'none' : ''"
/>
<img
src="/assets/svgs/check_box-white-filled.svg"
[style.display]="currentUrl == '/todos' ? '' : 'none'"
/>
</button>

<button
mat-flat-button
class="bottom-navigation-button flex-fill"
routerLink="/appointments">
<img src="/assets/svgs/event-white-outlined.svg" [style.display]="currentUrl == '/appointments' ? 'none' : ''">
<img src="/assets/svgs/event-white-filled.svg" [style.display]="currentUrl == '/appointments' ? '' : 'none'">
routerLink="/appointments"
>
<img
src="/assets/svgs/event-white-outlined.svg"
[style.display]="currentUrl == '/appointments' ? 'none' : ''"
/>
<img
src="/assets/svgs/event-white-filled.svg"
[style.display]="currentUrl == '/appointments' ? '' : 'none'"
/>
</button>
</div>
</div>
10 changes: 5 additions & 5 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.default-font{
font-family: 'Roboto', sans-serif;
.default-font {
font-family: "Roboto", sans-serif;
}

#bottom-navigation-bar{
#bottom-navigation-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 56px;
}

.bottom-navigation-button{
.bottom-navigation-button {
border-radius: 0px;
color: white;
background-color: var(--primary);
height: 56px;
}
}
27 changes: 0 additions & 27 deletions src/app/app.component.spec.ts

This file was deleted.

70 changes: 41 additions & 29 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import { Component, HostListener } from '@angular/core'
import { Router, NavigationStart } from '@angular/router'
import { Dav, Environment, TableObject } from 'dav-js'
import { environment } from '../environments/environment'
import { enUS } from '../locales/locales'
import { DataService } from './services/data-service'
import { ConvertTableObjectToAppointment } from './models/Appointment'
import { ConvertTableObjectToTodo } from './models/Todo'
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons'
import { TodoList, ConvertTableObjectToTodoList } from './models/TodoList'
import { Component, HostListener } from "@angular/core"
import { Router, NavigationStart } from "@angular/router"
import { Dav, Environment, TableObject } from "dav-js"
import { environment } from "../environments/environment"
import { enUS } from "../locales/locales"
import { DataService } from "./services/data-service"
import { ConvertTableObjectToAppointment } from "./models/Appointment"
import { ConvertTableObjectToTodo } from "./models/Todo"
import { initializeIcons } from "office-ui-fabric-react/lib/Icons"
import { TodoList, ConvertTableObjectToTodoList } from "./models/TodoList"

const smallWindowMaxSize = 768

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [
'./app.component.scss'
]
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"]
})
export class AppComponent {
locale = enUS.navbar
windowWidth: number = 500
currentUrl: string = "/"

constructor(
public dataService: DataService,
private router: Router
) {
constructor(public dataService: DataService, private router: Router) {
this.locale = this.dataService.GetLocale().navbar
initializeIcons()

Expand All @@ -48,24 +43,35 @@ export class AppComponent {

// Initialize dav
new Dav({
environment: environment.production ? Environment.Production : Environment.Development,
environment: environment.production
? Environment.Production
: Environment.Development,
appId: environment.appId,
tableIds: [environment.todoTableId, environment.todoListTableId, environment.appointmentTableId],
tableIds: [
environment.todoTableId,
environment.todoListTableId,
environment.appointmentTableId
],
notificationOptions: {
icon: "/assets/icons/icon-192x192.png",
badge: "/assets/icons/badge-128x128.png"
},
callbacks: {
UpdateAllOfTable: (tableId: number) => this.UpdateAllOfTable(tableId),
UpdateTableObject: (tableObject: TableObject, downloaded: boolean) => this.UpdateTableObject(tableObject, downloaded),
DeleteTableObject: (tableObject: TableObject) => this.DeleteTableObject(tableObject)
UpdateAllOfTable: (tableId: number) =>
this.UpdateAllOfTable(tableId),
UpdateTableObject: (
tableObject: TableObject,
downloaded: boolean
) => this.UpdateTableObject(tableObject, downloaded),
DeleteTableObject: (tableObject: TableObject) =>
this.DeleteTableObject(tableObject)
}
})
}

@HostListener('window:resize')
@HostListener("window:resize")
setSize() {
this.dataService.smallWindow = (window.innerWidth < smallWindowMaxSize)
this.dataService.smallWindow = window.innerWidth < smallWindowMaxSize
this.windowWidth = window.innerWidth
}

Expand All @@ -78,7 +84,10 @@ export class AppComponent {
}
}

async UpdateTableObject(tableObject: TableObject, downloaded: boolean = false) {
async UpdateTableObject(
tableObject: TableObject,
downloaded: boolean = false
) {
if (tableObject.TableId == environment.appointmentTableId) {
// Update appointment
var appointment = ConvertTableObjectToAppointment(tableObject)
Expand Down Expand Up @@ -174,7 +183,10 @@ export class AppComponent {
a: 255
}

let titleBar = window["Windows"].UI.ViewManagement.ApplicationView.getForCurrentView().titleBar
let titleBar =
window[
"Windows"
].UI.ViewManagement.ApplicationView.getForCurrentView().titleBar
titleBar.foregroundColor = themeColor
titleBar.backgroundColor = themeColor
titleBar.buttonBackgroundColor = themeColor
Expand All @@ -183,4 +195,4 @@ export class AppComponent {
titleBar.inactiveBackgroundColor = themeColor
}
}
}
}
Loading

0 comments on commit 73e32ad

Please sign in to comment.