diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 75eeea8..2f9fc22 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,15 +33,19 @@ export class AppComponent { private updates: SwUpdate, private changeDetector: ChangeDetectorRef, ) { + const unauthenticatedRoutes = [ + '/', + '/login', + '/register' + ] if (this.cookieService.check('Authorization')) { this.twigsService.getProfile().subscribe(user => { this.user.next(user); - if (this.activatedRoute.snapshot.url.length == 0) { + if (this.router.url == '/') { this.router.navigateByUrl("/budgets"); } }); - } else if (this.activatedRoute.snapshot.url.length > 0) { - console.log(this.activatedRoute.snapshot.url) + } else if (unauthenticatedRoutes.indexOf(this.router.url) == -1) { this.router.navigateByUrl("/login"); } diff --git a/src/app/budgets/budget-details/budget-details.component.css b/src/app/budgets/budget-details/budget-details.component.css index b9cbae0..50c1800 100644 --- a/src/app/budgets/budget-details/budget-details.component.css +++ b/src/app/budgets/budget-details/budget-details.component.css @@ -3,7 +3,7 @@ display: flex; flex-wrap: wrap; justify-content: center; - padding: 1em; + padding: 0 1em; } .dashboard>mat-card { @@ -73,14 +73,24 @@ a.view-all { @media (min-width: 1160px) { mat-card { box-sizing: border-box; - height: 386px; } - app-category-list { + .category-info { + height: 313px; overflow: auto; } } +@media (max-width: 610px) { + .dashboard { + padding: 0; + } + + .dashboard>mat-card { + margin: 1em auto; + } +} + @media (prefers-color-scheme: dark) { .dashboard { color: #F1F1F1;