-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): update design to inform user of smaller screen about compa…
…tible device
- Loading branch information
Mathieu Hermann
committed
Nov 14, 2024
1 parent
af72b5c
commit 85e22ea
Showing
7 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
<router-outlet /> | ||
@if(!screenCompatible()) { | ||
<app-notification> | ||
Your screen height is incompatible with Retroski. Please switch to portrait | ||
mode or use a device with a screen height of at least 500 pixels. | ||
</app-notification> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import { Component, Signal, signal } from '@angular/core'; | ||
import { Component, Signal, signal, WritableSignal } from '@angular/core'; | ||
import { RouterOutlet } from '@angular/router'; | ||
import { NotificationComponent } from "./common/components/notification/notification.component"; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
standalone: true, | ||
imports: [RouterOutlet], | ||
imports: [RouterOutlet, NotificationComponent], | ||
templateUrl: './app.component.html', | ||
styleUrl: './app.component.scss' | ||
}) | ||
export class AppComponent { | ||
protected screenCompatible: WritableSignal<boolean>; | ||
|
||
constructor() { | ||
this.screenCompatible = signal(screen.height >= 500); | ||
|
||
addEventListener('resize', () => this.screenCompatible.set(screen.height >= 500)); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/app/common/components/notification/notification.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ng-content></ng-content> |
10 changes: 10 additions & 0 deletions
10
src/app/common/components/notification/notification.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
:host { | ||
display: block; | ||
max-width: 75dvw; | ||
padding: 1rem; | ||
border-radius: var(--border-radius-large); | ||
background-color: var(--color-error-lightest); | ||
color: var(--color-error-darkest); | ||
|
||
font-size: var(--text-small); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/app/common/components/notification/notification.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-notification', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './notification.component.html', | ||
styleUrl: './notification.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class NotificationComponent { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters