Skip to content

Commit

Permalink
remove fix top bar
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Spanos committed Jun 1, 2024
1 parent 82793f4 commit 7d7d764
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
29 changes: 23 additions & 6 deletions src/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { TopBarComponent } from './top-bar/top-bar.component';
import { AsyncPipe, NgStyle } from '@angular/common';
import { Component, computed } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute, NavigationEnd, Router, RouterOutlet } from '@angular/router';
import { LoaderComponent } from './shared/ui/loader/loader.component';
import { LoaderService } from './shared/ui/loader/loader.service';
import { AsyncPipe } from '@angular/common';
import { TopBarComponent } from './top-bar/top-bar.component';

@Component({
selector: 'ppo-root',
standalone: true,
imports: [RouterOutlet, TopBarComponent, LoaderComponent, AsyncPipe],
imports: [RouterOutlet, TopBarComponent, LoaderComponent, AsyncPipe, NgStyle],
template: `
<section [ngStyle]="rootStyles()">
<ppo-top-bar></ppo-top-bar>
<router-outlet></router-outlet>
@if (loading$ | async) {
<ppo-loader></ppo-loader>
}
</section>
`,
})
export class AppComponent {
constructor(private loaderService: LoaderService) { }
event = toSignal(this.router.events);
rootStyles = computed(() => {
const e = this.event();
if (e instanceof NavigationEnd && e.url === '/') {
return {
'background': "url('/assets/home-background.png')",
'background-size': 'cover'
};
} else {
return {
'background-color': 'var(--neutral--900)'
};
}
});
constructor(private loaderService: LoaderService, private route: ActivatedRoute, private router: Router) { }
loading$ = this.loaderService.loading$;
}
3 changes: 0 additions & 3 deletions src/ui/src/app/home/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ import { Router } from '@angular/router';
styles: [`
:host {
flex-grow: 1;
background: url('/assets/home-background.png');
background-size: cover;
min-height: 100vh;
}
.homepage-content {
padding-top: 92px;
display: flex;
flex-direction: column;
align-items: center;
Expand Down
1 change: 0 additions & 1 deletion src/ui/src/app/play/play.component.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
:host {
flex: 1;
display: flex;
background-color: var(--neutral--900);
}
1 change: 0 additions & 1 deletion src/ui/src/styles/components/top-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
justify-content: space-between;
align-items: center;
padding: var(--padding);
position: fixed;
}
.top-bar .link {
font-weight: 600;
Expand Down

0 comments on commit 7d7d764

Please sign in to comment.