Skip to content

Commit 5d27d68

Browse files
committed
fix: add correct support of mobiles for the afcl modal
1 parent 74802a1 commit 5d27d68

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

adminforth/spa/src/afcl/Modal.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
v-show="isModalOpen"
1111
v-if="!removeFromDom"
1212
@click="backdropClick"
13-
class="bg-black/50 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full h-full md:inset-0 h-1rem max-h-full flex"
13+
class="bg-black/50 overflow-y-auto overscroll-contain overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full h-full md:inset-0 h-1rem max-h-full flex"
1414
:class="props.backgroundCustomClasses"
1515
>
1616
<!-- Modal content -->
17-
<div v-bind="$attrs" class="relative bg-lightDialogBackgorund rounded-lg shadow-sm dark:bg-darkDialogBackgorund">
17+
<div v-bind="$attrs" class="relative bg-lightDialogBackgorund rounded-lg shadow-sm dark:bg-darkDialogBackgorund mx-4 sm:mx-0">
1818

1919
<!-- Modal body -->
2020
<div class="text-lightDialogBodyText dark:text-darkDialogBodyText">
@@ -28,22 +28,22 @@
2828
:class="props.modalCustomClasses"
2929
>
3030
<div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-lg max-w-sm w-full">
31-
<h2 class="text-lg font-semibold mb-4 text-lightDialogHeaderText dark:text-darkDialogHeaderText">Confirm Close</h2>
31+
<h2 class="text-lg font-semibold mb-4 text-lightDialogHeaderText dark:text-darkDialogHeaderText">{{ t('Confirm Close') }}</h2>
3232
<p class="mb-6 text-lightDialogBodyText dark:text-darkDialogBodyText">{{ props.closeConfirmationText }}</p>
3333
<div class="flex justify-end">
3434
<Button
3535
class="me-3 !bg-gray-50 dark:!bg-gray-700 !text-lightDialogBodyText dark:!text-darkDialogBodyText hover:!bg-gray-100 dark:hover:!bg-gray-600 !border-gray-200 dark:!border-gray-600"
3636
@click="showConfirmationOnClose = false"
3737
>
38-
Cancel
38+
{{ t('Cancel') }}
3939
</Button>
4040
<Button
4141
@click="
4242
showConfirmationOnClose = false;
4343
close();
4444
"
4545
>
46-
Confirm
46+
{{ t('Confirm') }}
4747
</Button>
4848
</div>
4949
</div>
@@ -56,8 +56,10 @@
5656
<script setup lang="ts">
5757
import Button from "./Button.vue";
5858
import { ref, onMounted, nextTick, onUnmounted, computed, type Ref } from 'vue';
59+
import { useI18n } from 'vue-i18n';
5960
6061
const isModalOpen = ref(false);
62+
const { t } = useI18n();
6163
6264
const removeFromDom = computed(() => {
6365
return props.removeFromDomOnClose && !isModalOpen.value;

adminforth/spa/src/components/AcceptModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
backgroundCustomClasses="z-[998]"
77
modalCustomClasses="z-[999] flex items-center justify-center"
88
>
9-
<div class="relative p-6 sm:p-8 w-[440px] bg-white rounded-lg shadow-xl dark:bg-gray-800" >
9+
<div class="relative p-6 sm:p-8 sm:w-[440px] rounded-lg shadow-xl dark:bg-gray-800" >
1010

1111
<button type="button" @click="modalStore.togleModal()" class="absolute top-4 right-4 text-gray-400 hover:text-gray-900 transition-colors dark:hover:text-white" >
1212
<svg class="w-3.5 h-3.5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">

dev-demo/custom/AfComponents.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22

3-
<div class="flex gap-10">
3+
<div class="flex flex-wrap gap-10 max-w-screen">
44
<div class="flex flex-col max-w-[200px] m-10 mt-20 gap-10">
55
<Checkbox :disabled="false"><p>afdsdfsdfsdgsdgsgdsggdg</p> </Checkbox>
66
<Button @click="doSmth"

0 commit comments

Comments
 (0)