Skip to content

Commit

Permalink
feat: changes to appBanner component
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Mar 4, 2025
1 parent ee887d7 commit 744097a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div *ngIf="message" style="top: 0" class="absolute text-wrap bg-white mt-4">
<div
*ngIf="message && bannerOpen"
class="absolute top-0 text-wrap bg-white mt-4"
>
<div
class="flex flex-row py-2.5 px-5 gap-5 justify-start items-center border"
[ngClass]="classList"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
} from '@ng-icons/core'
import {
matCloseOutline,
matInfoOutline,
matWarningAmberOutline,
} from '@ng-icons/material-icons/outline'
import { matWarning } from '@ng-icons/material-icons/baseline'

@Component({
selector: 'gn-ui-application-banner',
Expand All @@ -20,7 +22,9 @@ import {
providers: [
provideIcons({
matWarningAmberOutline,
matInfoOutline,
matCloseOutline,
matWarning,
}),
provideNgIconsConfig({ size: '1.5em' }),
],
Expand All @@ -30,23 +34,25 @@ export class ApplicationBannerComponent {
@Input() title: string
@Input() closeEnabled = false
@Input() extraClass = ''
@Input() icon = 'matWarningAmberOutline'
@Input() icon = ''
msgClass = ''
bannerOpen = true

@Input() set type(value: 'primary' | 'secondary' | 'light') {
switch (value) {
case 'primary':
this.msgClass = 'bg-primary-darkest border-primary text-white'
break
case 'secondary':
this.msgClass = 'bg-primary-opacity-50 border-primary-darker text-black'
this.icon = 'matWarning'
break
case 'light':
this.msgClass =
'bg-primary-opacity-10 border-primary-lightest text-black'
this.icon = 'matInfoOutline'
break
case 'secondary':
default:
this.msgClass = 'bg-primary-opacity-50 border-primary-darker text-black'
this.icon = 'matWarningAmberOutline'
break
}
}
Expand All @@ -56,6 +62,6 @@ export class ApplicationBannerComponent {
}

closeMessage() {
this.message = ''
this.bannerOpen = false
}
}

0 comments on commit 744097a

Please sign in to comment.