feat: add custom file input for images
This commit is contained in:
20
src/app/components/image-uploader/image-uploader.html
Normal file
20
src/app/components/image-uploader/image-uploader.html
Normal file
@@ -0,0 +1,20 @@
|
||||
@if (imgUrl()) {
|
||||
<div class="image-preview__container">
|
||||
<img [src]="imgUrl()" [alt]="fileName()" width="300" height="300" />
|
||||
</div>
|
||||
}
|
||||
<input
|
||||
(change)="onFileSelected($event)"
|
||||
#fileUpload
|
||||
accept=".jpeg, .jpg, .png, .webp, .gif"
|
||||
class="file-input"
|
||||
type="file"
|
||||
/>
|
||||
<div class="file-upload">
|
||||
<div class="file-upload__description" title="{{ fileName() }}">
|
||||
{{ fileName() || 'common.no_file_yet' | translate | upperfirst }}
|
||||
</div>
|
||||
<button matMiniFab color="primary" class="upload-btn" (click)="fileUpload.click()">
|
||||
<mat-icon>attach_file</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user