Skip to content

Commit bb49660

Browse files
committed
fix: add modal support
1 parent e4b85c0 commit bb49660

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

custom/imageGenerator.vue

Lines changed: 12 additions & 9 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,10 @@
6363
<Skeleton v-else type="image" class="w-14 h-14" />
6464
</div>
6565

66-
<div class="grid grid-cols-[1fr_52px_1fr]">
67-
<span class="pb-2 text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Original image') }}</span>
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>
6868
<div></div>
69-
<span class="pb-2 text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Generated image') }}</span>
69+
<span class="pb-2 text-xs sm:text-sm font-medium text-gray-500 dark:text-gray-400">{{ $t('Generated image') }}</span>
7070
<div
7171
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"
7272
:class="requestAttachmentFilesUrls.length ? 'cursor-zoom-in' : ''"
@@ -77,7 +77,7 @@
7777
:src="requestAttachmentFilesUrls[0]"
7878
class="w-full h-full object-cover"
7979
/>
80-
<span v-else class="text-gray-400 dark:text-gray-500 text-sm">{{ $t('No image') }}</span>
80+
<span v-else class="text-gray-400 dark:text-gray-500 text-xs sm:text-sm px-2 text-center">{{ $t('No image') }}</span>
8181
</div>
8282

8383
<div class="flex items-center justify-center">
@@ -125,7 +125,7 @@
125125
/>
126126
</div>
127127
<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">
128-
<span v-if="!loadingTimer" 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-xs sm:text-sm px-2 text-center">{{ $t('Your generated image will appear here') }}</span>
129129
</div>
130130
</div>
131131
</div>
@@ -155,22 +155,25 @@
155155
</div>
156156
</div>
157157
<!-- Modal footer -->
158-
<div class="flex items-center justify-between px-6 py-4 border-t border-gray-200 dark:border-gray-700">
158+
<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">
159159
<div class="flex items-center gap-2">
160160
<Button
161161
@click="confirmImage"
162162
:disabled="loading || images.length === 0"
163163
variant="primary"
164+
class="flex-1 sm:flex-none"
164165
>{{ $t('Use image') }}</Button>
165166
<Button
166167
@click="() => { stopGeneration = true; emit('close') }"
167168
variant="secondary"
169+
class="flex-1 sm:flex-none"
168170
>{{ $t('Cancel') }}</Button>
169171
</div>
170172
<Button
171173
@click="generateImages"
172174
:disabled="loading"
173175
variant="primary"
176+
class="w-full sm:w-auto"
174177
>{{ $t('Generate images') }}</Button>
175178
</div>
176179

0 commit comments

Comments
 (0)