@@ -55,14 +55,6 @@ export default class IgcMessageAttachmentsComponent extends LitElement {
5555 registerIconFromText ( 'more' , moreIcon , 'material' ) ;
5656 }
5757
58- private openImagePreview ( attachment : IgcMessageAttachment ) {
59- this . previewImage = this . getURL ( attachment ) ;
60- }
61-
62- private closeImagePreview ( ) {
63- this . previewImage = '' ;
64- }
65-
6658 private handleToggle ( e : CustomEvent , attachment : IgcMessageAttachment ) {
6759 this . _chatState ?. emitEvent ( 'igcAttachmentClick' , { detail : attachment } ) ;
6860 e . preventDefault ( ) ;
@@ -106,34 +98,13 @@ export default class IgcMessageAttachmentsComponent extends LitElement {
10698 </ div > ` ;
10799 }
108100
109- private renderAttachmentHeaderActions ( attachment : IgcMessageAttachment ) {
101+ private renderAttachmentHeaderActions ( ) {
110102 return html `< div class ="actions ">
111103 ${ this . _chatState ?. options ?. templates ?. attachmentActionsTemplate
112104 ? this . _chatState . options . templates . attachmentActionsTemplate (
113105 this . attachments
114106 )
115- : html `
116- < slot name ="attachment-actions ">
117- ${ attachment . type === 'image' ||
118- attachment . file ?. type . startsWith ( 'image/' )
119- ? html ` < igc-icon-button
120- name ="preview "
121- collection ="material "
122- variant ="flat "
123- class ="small "
124- tabIndex ="-1 "
125- @click =${ ( ) => this . openImagePreview ( attachment ) }
126- > </ igc-icon-button > `
127- : nothing }
128- < igc-icon-button
129- name ="more "
130- collection ="material "
131- variant ="flat "
132- class ="small "
133- tabIndex ="-1 "
134- > </ igc-icon-button >
135- </ slot >
136- ` }
107+ : nothing }
137108 </ div > ` ;
138109 }
139110
@@ -170,32 +141,14 @@ export default class IgcMessageAttachmentsComponent extends LitElement {
170141 >
171142 < div slot ="title " class ="attachment ">
172143 ${ this . renderAttachmentHeaderText ( attachment ) }
173- ${ this . renderAttachmentHeaderActions ( attachment ) }
144+ ${ this . renderAttachmentHeaderActions ( ) }
174145 </ div >
175146
176147 ${ this . renderAttachmentContent ( attachment ) }
177148 </ igc-expansion-panel > `
178149 ) } `;
179150 }
180151
181- private renderImagePreview ( ) {
182- return html ` ${ this . previewImage
183- ? html `
184- < div class ="image-overlay " @click =${ this . closeImagePreview } >
185- < img class ="overlay-image " src =${ this . previewImage } / >
186- < igc-icon-button
187- name ="close "
188- collection ="material "
189- variant ="contained "
190- class ="small "
191- tabIndex ="-1 "
192- @click =${ this . closeImagePreview }
193- > </ igc-icon-button >
194- </ div >
195- `
196- : nothing } `;
197- }
198-
199152 protected override render ( ) {
200153 return html `
201154 < div class ="attachments-container ">
@@ -205,8 +158,6 @@ export default class IgcMessageAttachmentsComponent extends LitElement {
205158 )
206159 : this . renderDefaultAttachmentsTemplate ( ) }
207160 </ div >
208-
209- ${ this . renderImagePreview ( ) }
210161 ` ;
211162 }
212163}
0 commit comments