Skip to content

Commit a311042

Browse files
committed
fix:
- replace custom spinner to afcl - update spinner visual - add condition for disable upload btn in modal
1 parent 0d9f07c commit a311042

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

custom/imageGenerator.vue

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</div>
5555
</div>
5656
<input ref="fileInput" class="hidden" type="file" @change="handleAddFile" accept="image/*" />
57-
<button v-if="!uploading" @click="fileInput?.click()" type="button" class="relative group hover:border-gray-400 transition border-gray-300 flex items-center justify-center w-14 h-14 border-2 border-dashed rounded-lg">
57+
<button v-if="!uploading" @click="fileInput?.click()" type="button" :disabled="requestAttachmentFilesUrls.length >= 1" class=" upload-btn relative group hover:border-gray-400 disabled:opacity-40 disabled:cursor-not-allowed transition border-gray-300 flex items-center justify-center w-14 h-14 border-2 border-dashed rounded-lg">
5858
<div class="flex flex-col items-center justify-center gap-1">
5959
<IconCloseOutline class="group-hover:text-gray-500 transition rotate-45 w-5 h-5 text-gray-300" />
6060
<p class="text-gray-300 group-hover:text-gray-500 transition text-[10px] leading-none">Ctrl+v</p>
@@ -90,15 +90,11 @@
9090

9191
<div
9292
v-if="loading"
93-
class=" absolute flex items-center justify-center inset-0 z-40 bg-white/80 dark:bg-gray-900/80 rounded-xl">
94-
<svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
95-
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 50.5908Z" fill="currentColor"/>
96-
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
97-
</svg>
98-
<span class="sr-only">{{ $t('Loading...') }}</span>
93+
class="spinner absolute flex items-center justify-center inset-0 z-40 rounded-xl">
94+
<Spinner class="w-8 h-8" />
9995
</div>
100-
<div v-if="loadingTimer" class="absolute inset-0 pt-12 z-40 flex items-center justify-center bg-white/80 dark:bg-gray-900/80 rounded-xl">
101-
<div class="text-gray-800 dark:text-gray-100 text-base font-semibold" v-if="!historicalAverage">
96+
<div v-if="loadingTimer" class=" spinner-description absolute inset-0 z-40 flex items-center justify-center">
97+
<div class="text-gray-800 dark:text-gray-100 text-base font-semibold mt-20" v-if="!historicalAverage">
10298
{{ formatTime(loadingTimer) }} {{ $t('passed...') }}
10399
</div>
104100
<div class="w-48" v-else>
@@ -129,7 +125,7 @@
129125
/>
130126
</div>
131127
<div v-if="images.length === 0" class="w-full h-full flex items-center justify-center border-2 border-dashed border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700">
132-
<span class="text-gray-400 dark:text-gray-500 text-sm">{{ $t('Your generated image will appear here') }}</span>
128+
<span v-if="!loadingTimer" class="text-gray-400 dark:text-gray-500 text-sm">{{ $t('Your generated image will appear here') }}</span>
133129
</div>
134130
</div>
135131
</div>
@@ -212,7 +208,7 @@ import adminforth from '@/adminforth';
212208
import { ProgressBar, Button } from '@/afcl';
213209
import * as Handlebars from 'handlebars';
214210
import { IconCloseOutline } from '@iconify-prerendered/vue-flowbite';
215-
import { Tooltip, Skeleton } from '@/afcl'
211+
import { Tooltip, Skeleton, Spinner } from '@/afcl'
216212
import { useRoute } from 'vue-router';
217213
218214
const { t: $t, t } = useI18n();

0 commit comments

Comments
 (0)