-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add alert variation with description (#839) ✨
* feat: add property description and noRadius * fix: add test * fix: pr suggestions * fix: pr suggestions --------- Co-authored-by: Madalena Campos <[email protected]> Co-authored-by: Iury Nogueira <[email protected]>
- Loading branch information
1 parent
63024a6
commit 60bd35f
Showing
6 changed files
with
106 additions
and
21 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,27 +1,43 @@ | ||
<div | ||
data-testid="ion-alert" | ||
[class]="'ion-alert ' + type + ' closable-' + closable" | ||
[ngClass]="{ 'without-background': hideBackground }" | ||
[ngClass]="{ | ||
'without-background': hideBackground, | ||
'with-description': description?.length > 0, | ||
'no-radius': noRadius | ||
}" | ||
#ionAlert | ||
> | ||
<ion-icon | ||
data-testid="status-icon" | ||
class="alert-icon" | ||
[type]="iconType" | ||
></ion-icon> | ||
<span *ngIf="hasPlainText; else customBody" data-testid="ion-alert-message">{{ | ||
message | ||
}}</span> | ||
<div class="header"> | ||
<div class="message"> | ||
<ion-icon | ||
data-testid="status-icon" | ||
class="alert-icon" | ||
[type]="iconType" | ||
></ion-icon> | ||
|
||
<ng-template #customBody> | ||
<ng-container [ngTemplateOutlet]="message"></ng-container> | ||
</ng-template> | ||
<span | ||
*ngIf="hasPlainText; else customBody" | ||
data-testid="ion-alert-message" | ||
class="message-text" | ||
>{{ message }}</span | ||
> | ||
|
||
<ion-icon | ||
class="close-icon" | ||
data-testid="close-icon" | ||
type="close" | ||
*ngIf="closable" | ||
(click)="closeEvent()" | ||
></ion-icon> | ||
<ng-template #customBody> | ||
<ng-container [ngTemplateOutlet]="message"></ng-container> | ||
</ng-template> | ||
</div> | ||
|
||
<ion-icon | ||
class="close-icon" | ||
data-testid="close-icon" | ||
type="close" | ||
*ngIf="closable" | ||
(click)="closeEvent()" | ||
></ion-icon> | ||
</div> | ||
|
||
<span *ngIf="description?.length > 0" class="description"> | ||
{{ description }} | ||
</span> | ||
</div> |
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
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
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