1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-29 04:17:41 +02:00

[CL-155] Add support for hiding the close button on banner (#7142)

This commit is contained in:
Oscar Hinton 2023-12-08 17:15:57 +01:00 committed by GitHub
parent c4b31c9f8f
commit 5a3ac7d73e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<ng-content></ng-content>
</span>
<button
*ngIf="showClose"
type="button"
bitIconButton="bwi-close"
buttonType="contrast"

View File

@ -17,6 +17,7 @@ export class BannerComponent implements OnInit {
@Input("bannerType") bannerType: BannerTypes = "info";
@Input() icon: string;
@Input() useAlertRole = true;
@Input() showClose = true;
@Output() onClose = new EventEmitter<void>();

View File

@ -35,6 +35,7 @@ export default {
},
args: {
bannerType: "warning",
showClose: true,
},
argTypes: {
onClose: { action: "onClose" },
@ -50,7 +51,7 @@ export const Premium: Story = {
render: (args: BannerComponent) => ({
props: args,
template: `
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)">
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)" [showClose]=showClose>
Content Really Long Text Lorem Ipsum Ipsum Ipsum
<button bitLink linkType="contrast">Button</button>
</bit-banner>
@ -82,3 +83,10 @@ export const Danger: Story = {
bannerType: "danger",
},
};
export const HideClose: Story = {
...Premium,
args: {
showClose: false,
},
};