Fix some styles and initial routing (again)
This commit is contained in:
parent
ff18e47036
commit
2c48722dec
2 changed files with 20 additions and 6 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue