Skip to content

Commit e0c6f0d

Browse files
authored
Merge pull request #27 from devforth/feature/AdminForth/1761/fix-mobile-upload
fix: add modal support
2 parents f286235 + d5699f7 commit e0c6f0d

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

custom/imageGenerator.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<!-- Modal content -->
77
<div class="relative bg-white rounded-xl shadow-2xl dark:bg-gray-800">
88
<!-- Header -->
9-
<div class="flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700">
10-
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">
9+
<div class="flex items-center justify-between px-4 py-3 sm:px-6 sm:py-4 border-b border-gray-200 dark:border-gray-700">
10+
<h3 class="text-base sm:text-lg font-semibold text-gray-900 dark:text-white">
1111
{{ $t('Generate image with AI') }}
1212
</h3>
1313
<button type="button"
@@ -20,7 +20,7 @@
2020
</button>
2121
</div>
2222
<!-- Modal body -->
23-
<div class="px-6 py-5 space-y-4">
23+
<div class="px-4 py-4 sm:px-6 sm:py-5 space-y-4">
2424
<!-- PROMPT TEXTAREA -->
2525
<!-- Textarea -->
2626
<textarea
@@ -63,10 +63,12 @@
6363
<Skeleton v-else type="image" class="w-14 h-14" />
6464
</div>
6565

66+
<div class="grid grid-cols-[1fr_32px_1fr] sm:grid-cols-[1fr_52px_1fr]">
67+
<span class="pb-2 text-xs sm:text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Original image') }}</span>
6668
<div class=" image-container grid grid-cols-[1fr_52px_1fr]">
6769
<span class="pb-2 text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Original image') }}</span>
6870
<div></div>
69-
<span class="pb-2 text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Generated image') }}</span>
71+
<span class="pb-2 text-xs sm:text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Generated image') }}</span>
7072
<div
7173
class="rounded-xl overflow-hidden bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 aspect-[4/3] flex items-center justify-center"
7274
:class="requestAttachmentFilesUrls.length ? 'cursor-zoom-in' : ''"
@@ -77,7 +79,7 @@
7779
:src="requestAttachmentFilesUrls[0]"
7880
class="w-full h-full object-cover"
7981
/>
80-
<span v-else class="text-gray-400 dark:text-gray-500 text-sm">{{ $t('No image') }}</span>
82+
<span v-else class="text-gray-400 dark:text-gray-500 text-xs sm:text-sm px-2 text-center">{{ $t('No image') }}</span>
8183
</div>
8284

8385
<div class="flex items-center justify-center">
@@ -131,7 +133,7 @@
131133
/>
132134
</div>
133135
<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">
134-
<span v-if="!loadingTimer" class="text-gray-400 dark:text-gray-500 text-sm">{{ $t('Your generated image will appear here') }}</span>
136+
<span v-if="!loadingTimer" class="text-gray-400 dark:text-gray-500 text-xs sm:text-sm px-2 text-center">{{ $t('Your generated image will appear here') }}</span>
135137
</div>
136138
</div>
137139
</div>
@@ -161,22 +163,25 @@
161163
</div>
162164
</div>
163165
<!-- Modal footer -->
164-
<div class="flex items-center justify-between px-6 py-4 border-t border-gray-200 dark:border-gray-700">
166+
<div class="flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2 px-4 py-3 sm:px-6 sm:py-4 border-t border-gray-200 dark:border-gray-700">
165167
<div class="flex items-center gap-2">
166168
<Button
167169
@click="confirmImage"
168170
:disabled="loading || images.length === 0"
169171
variant="primary"
172+
class="flex-1 sm:flex-none"
170173
>{{ $t('Use image') }}</Button>
171174
<Button
172175
@click="() => { stopGeneration = true; emit('close') }"
173176
variant="secondary"
177+
class="flex-1 sm:flex-none"
174178
>{{ $t('Cancel') }}</Button>
175179
</div>
176180
<Button
177181
@click="generateImages"
178182
:disabled="loading"
179183
variant="primary"
184+
class="w-full sm:w-auto"
180185
>{{ $t('Generate images') }}</Button>
181186
</div>
182187

0 commit comments

Comments
 (0)