-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(ui): non-closeable modal support #236
feat(ui): non-closeable modal support #236
Conversation
<cvi-ng-icon [name]="'close'" [height]="14"></cvi-ng-icon> | ||
</button> | ||
<ng-template [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="{ $implicit: this, title }"></ng-template> | ||
</div> | ||
<div class="cvi-modal__backdrop" dataAttribute="modal-backdrop" (click)="closeModal()"></div> | ||
<div class="cvi-modal__backdrop" dataAttribute="modal-backdrop" (click)="closeable && closeModal()"></div> |
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.
maybe move the closeable
check into the closeModal() method?
@@ -15,7 +15,7 @@ export const Default = { | |||
<h1>{{ testModalTitle }}</h1> | |||
<p dataAttribute="test-content">Modal content</p> | |||
</ng-template> | |||
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" dataAttribute="test-button">Open modal</cvi-ng-button> | |||
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" closeable="true" dataAttribute="test-button">Open modal</cvi-ng-button> |
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.
Same as in confirmation-modal.component.stories.ts
, this attribute probably should be turned into a live Storybook control using a closeable
arg:
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" closeable="true" dataAttribute="test-button">Open modal</cvi-ng-button> | |
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" [closeable]="closeable" dataAttribute="test-button">Open modal</cvi-ng-button> |
@@ -17,6 +17,7 @@ export class ModalComponent implements OnDestroy { | |||
templateRef!: TemplateRef<any>; | |||
|
|||
title!: string; | |||
closeable!: boolean; |
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.
Should the prop have a default value?
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.
I'll put it to true so those that are using it directly wouldn't have to change anything to have same function they have right now
No description provided.