MOBILE-4458 design: Renew empty box styles

main
Pau Ferrer Ocaña 2024-02-22 11:38:38 +01:00
parent 4e282938af
commit 75afcb1534
6 changed files with 29 additions and 26 deletions

View File

@ -1,4 +1,7 @@
<img *ngIf="image && !icon" [src]="image" role="presentation" alt="">
<ion-icon *ngIf="icon" [name]="icon" aria-hidden="true" />
@if (icon) {
<ion-icon [name]="icon" aria-hidden="true" />
} @else if (image) {
<img [src]="image" role="presentation" alt="">
}
<p *ngIf="message">{{ message }}</p>
<ng-content />

View File

@ -1,8 +1,16 @@
@use "theme/globals" as *;
:host {
--image-size: 120px;
--icon-color: var(--subdued-text-color);
--image-size: 80px;
--icon-color: var(--core-empty-box-icon-color);
&.core-empty-box-clickable {
z-index: 0;
}
&.dimmed {
--text-color: var(--gray-700);
}
display: flex;
flex-direction: column;
@ -22,31 +30,16 @@
img {
height: var(--image-size);
}
p {
font-size: 120%;
}
&.core-empty-box-clickable {
z-index: 0;
p,
::ng-deep p {
font-size: var(--heading-6-font-size);
color: var(--text-color);
}
&.dimmed {
--icon-color: var(--gray-400);
--text-color: var(--gray-700);
}
}
:host-context(html.dark) {
&.dimmed {
--text-color: var(--gray-300);
}
}
@include media-breakpoint-down(sm) {
:host {
--image-size: 100px;
}
}

View File

@ -25,7 +25,7 @@ import { Component, HostBinding, Input } from '@angular/core';
@Component({
selector: 'core-empty-box',
templateUrl: 'core-empty-box.html',
styleUrls: ['empty-box.scss'],
styleUrl: 'empty-box.scss',
})
export class CoreEmptyBoxComponent {
@ -33,7 +33,10 @@ export class CoreEmptyBoxComponent {
@Input() dimmed = false; // Wether the box is dimmed or not.
@Input() icon?: string; // Name of the icon to use.
@Input() image?: string; // Image source. If an icon is provided, image won't be used.
@Input() flipIconRtl = false; // Whether to flip the icon in RTL. Defaults to false.
/**
* @deprecated since 4.4. Not used anymore.
*/
@Input() flipIconRtl = false;
@HostBinding('class.dimmed')
get isDimmed(): boolean {

View File

@ -2,4 +2,4 @@
<ng-content />
</ion-content>
<ion-router-outlet class="content-outlet" />
<core-empty-box class="content-placeholder" icon="fas-circle-arrow-left" [message]="placeholderText | translate" [flipIconRtl]="true" />
<core-empty-box class="content-placeholder" icon="fas-circle-arrow-left" [message]="placeholderText | translate" />

View File

@ -97,6 +97,8 @@ html.dark {
--core-progressbar-text-color: var(--gray-100);
--core-empty-box-icon-color: var(--gray-700);
--ion-item-background: #{$ion-item-background-dark};
--ion-item-icon-color: var(--medium);
--ion-item-detail-icon-color: var(--dark);

View File

@ -272,6 +272,8 @@ html {
--core-progressbar-text-color: var(--medium);
--core-progressbar-background: var(--primary-tint);
--core-empty-box-icon-color: var(--gray-300);
--ion-item-background: #{$ion-item-background};
--ion-item-icon-color: var(--medium);
--ion-item-detail-icon-color: var(--dark);