Skip to content

Commit ef4eedb

Browse files
authored
Fix(cookie-banner): fix visuals to adhere to figma prototype (#472)
* fix(cookie-banner): fixed visuals to adhere to figma prototype * chore(cookie-banner): refoactored cookie banner to have similar html structure to other banners
1 parent f924b15 commit ef4eedb

File tree

3 files changed

+16
-36
lines changed

3 files changed

+16
-36
lines changed
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
@if (displayBanner()) {
2-
<div class="cookie-consent-container" @fadeInOut>
3-
<div class="w-full p-message">
4-
<div class="grid flex-row p-message-content">
5-
<div class="col">{{ 'toast.cookie-consent.message' | translate }}</div>
6-
<div class="col-fixed flex justify-content-end">
7-
<p-button
8-
type="button"
9-
[label]="'toast.cookie-consent.accept' | translate"
10-
(onClick)="acceptCookies()"
11-
></p-button>
2+
<div class="p-3">
3+
<p-message styleClass="w-full" severity="warn">
4+
<ng-template #container>
5+
<div class="grid flex-column w-full">
6+
<div class="flex items-center align-items-start gap-2 font-medium">
7+
<osf-icon iconClass="fas fa-triangle-exclamation"></osf-icon>
8+
{{ 'toast.cookie-consent.message' | translate }}
9+
</div>
10+
<div class="row-fixed flex justify-content-end">
11+
<p-button link [label]="'toast.cookie-consent.accept' | translate" (onClick)="acceptCookies()"> </p-button>
12+
</div>
1213
</div>
13-
</div>
14-
</div>
14+
</ng-template>
15+
</p-message>
1516
</div>
1617
}
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
@use "styles/mixins" as mix;
2-
3-
.cookie-consent-container {
4-
padding: 1rem !important;
5-
display: block !important;
6-
7-
.p-message {
8-
background-color: #886d3f;
9-
color: var(--white);
10-
width: 100%;
11-
border-radius: var(--p-message-border-radius, 6px);
12-
outline-width: var(--p-message-border-width, 1px);
13-
outline-style: solid;
14-
15-
.p-message-content {
16-
display: flex;
17-
align-items: center;
18-
padding: var(--p-message-content-padding, 1.5rem);
19-
gap: var(--p-message-content-gap, 0.5rem);
20-
height: 100%;
21-
}
22-
}
23-
}

src/app/core/components/osf-banners/cookie-consent-banner/cookie-consent-banner.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { CookieService } from 'ngx-cookie-service';
22
import { TranslatePipe } from '@ngx-translate/core';
33

44
import { Button } from 'primeng/button';
5+
import { Message } from 'primeng/message';
56

67
import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';
78

89
import { fadeInOutAnimation } from '@core/animations/fade.in-out.animation';
10+
import { IconComponent } from '@shared/components';
911

1012
/**
1113
* Displays a cookie consent banner until the user accepts.
@@ -19,7 +21,7 @@ import { fadeInOutAnimation } from '@core/animations/fade.in-out.animation';
1921
selector: 'osf-cookie-consent-banner',
2022
templateUrl: './cookie-consent-banner.component.html',
2123
styleUrls: ['./cookie-consent-banner.component.scss'],
22-
imports: [Button, TranslatePipe],
24+
imports: [Button, TranslatePipe, IconComponent, Message],
2325
animations: [fadeInOutAnimation],
2426
changeDetection: ChangeDetectionStrategy.OnPush,
2527
})

0 commit comments

Comments
 (0)