Skip to content

Commit

Permalink
[CL-155] Add support for hiding the close button on banner (#7142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton authored Dec 8, 2023
1 parent c4b31c9 commit 5a3ac7d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/components/src/banner/banner.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ng-content></ng-content>
</span>
<button
*ngIf="showClose"
type="button"
bitIconButton="bwi-close"
buttonType="contrast"
Expand Down
1 change: 1 addition & 0 deletions libs/components/src/banner/banner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>();

Expand Down
10 changes: 9 additions & 1 deletion libs/components/src/banner/banner.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default {
},
args: {
bannerType: "warning",
showClose: true,
},
argTypes: {
onClose: { action: "onClose" },
Expand All @@ -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>
Expand Down Expand Up @@ -82,3 +83,10 @@ export const Danger: Story = {
bannerType: "danger",
},
};

export const HideClose: Story = {
...Premium,
args: {
showClose: false,
},
};

0 comments on commit 5a3ac7d

Please sign in to comment.