Skip to content

Commit

Permalink
Merge pull request #91 from mansurskTarento/marketplace-provider-ui
Browse files Browse the repository at this point in the history
Marketplace provider UI
  • Loading branch information
abhishek-K-P authored Nov 20, 2024
2 parents e5a1bd6 + 2bcd5b2 commit c455504
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,23 @@ export class ProviderDetailsComponent implements OnInit, OnChanges {
const fileName = event.name.replace(/[^A-Za-z0-9_.]/g, '')
if (this.thumbnailFile) {
if (fileName.toLowerCase().endsWith('.svg') || fileName.toLowerCase().endsWith('.png')) {
const reader = new FileReader()
reader.onload = (e: any) => {
const img = new Image()
img.onload = () => {
this.cropImage(img)
const fileSizeInKB = this.thumbnailFile.size / 1000
const minSizeKB = 300
const maxSizeMB = 2
const maxSizeKB = maxSizeMB * 1000
if (fileSizeInKB >= minSizeKB && fileSizeInKB <= maxSizeKB) {
const reader = new FileReader()
reader.onload = (e: any) => {
const img = new Image()
img.onload = () => {
this.cropImage(img)
}
img.src = e.target.result
}
img.src = e.target.result
reader.readAsDataURL(this.thumbnailFile)
} else {
this.showSnackBar('Please upload image sized between 300 KB and 2 MB')
}
reader.readAsDataURL(this.thumbnailFile)
} else {
this.showSnackBar('Please upload svg or png image')
}
Expand Down Expand Up @@ -411,6 +419,8 @@ export class ProviderDetailsComponent implements OnInit, OnChanges {
this.showSnackBar(errmsg)
},
})
} else {
this.showSnackBar('Please fill all the mandator fields with proper data')
}
}

Expand Down Expand Up @@ -447,6 +457,8 @@ export class ProviderDetailsComponent implements OnInit, OnChanges {
this.showSnackBar(errmsg)
},
})
} else {
this.showSnackBar('Please fill all the mandator fields with proper data')
}
}

Expand Down

0 comments on commit c455504

Please sign in to comment.