-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: cleaned alert component #54
Conversation
<div [class]="getAlertClass()" [class.--is-handset]="isHandset()"> | ||
<mat-icon [class]="getIconClass()">{{ iconName() }}</mat-icon> | ||
<div class="message" [class.--is-handset]="isHandset()"> | ||
<div class="sdg-alert-container" [class]="getAlertClass()"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est quoi le plus value pour ce tag container?
Si on est capable d'utiliser le host au lieu d'un tag en extra on est mieux d'utiliser le host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crois qu'il est nécessaire pour appliquer la classe .--general
ou .--warning
(le background-color)
projects/demo/src/app/pages/components/showcases/alert/alert.component.scss
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je vais pousser un commit avec ce que je pense l'idéal, tu vérifieras si c'est bien correct pour la structure et la suppression du containerClass
<mat-icon [class]="getIconClass()">{{ iconName() }}</mat-icon> | ||
<div class="message" [class.--is-handset]="isHandset()"> | ||
<div class="sdg-alert-container" [class]="typeClass()"> | ||
<div [class]="containerClass()"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi le containerClass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai reverté une partie, pour remettre le containerClass
styleUrls: ['./alert.component.scss'] | ||
styleUrls: ['./alert.component.scss'], | ||
host: { | ||
'[class]': 'typeClass()' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LAMM26 , on peut utiliser le host pour ajouter, entre autres, des classes. Ça l'évite d'ajouter des tags a nos composantes et de complexifier la structure du dom.
🎉 This PR is included in version 1.0.0-next.50 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Nettoyage du composant, renommage des classes.