Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
feat(consultation): disable button conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Oct 10, 2022
1 parent f8fee91 commit 37dfd75
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,27 @@
</button>
</form>

<div v-if="hasExtracted" class="preview-file">
<h6>{{ filename }}</h6>
<img :src="previewFile"/>
<div v-if="hasExtracted" class="preview-file mt-5">
<div class="preview-img-container">
<img class="preview-img max-w-30" :src="previewFile"/>
<small class="preview-title max-w-30 text-xs">
{{ filename }}
</small>
</div>
</div>
</template>
<template #footer>
<button
class="btn btn-back"
class="btn back-btn"
type="button"
@click="emitClose">
Back
</button>
<button class="btn btn-primary" type="button">
<button
:disabled="!hasExtracted"
class="send-btn btn btn-primary"
type="button"
@click="sendFile">
Send
</button>
</template>
Expand Down Expand Up @@ -104,8 +112,8 @@ function sendFile(event: Event): void {
function extractFile(event: Event) {
const target = event.target as HTMLInputElement
const rawFilename = target.files?.item(0)?.name as ""
const file = target.files?.item(0)
const rawFilename = file?.name as ""
previewFile.value = file ? URL.createObjectURL(file) : ""
filename.value = rawFilename
Expand Down

0 comments on commit 37dfd75

Please sign in to comment.