Skip to content

Commit

Permalink
Applu full height on details modal on mobile and add close button
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu MARTIN committed Nov 12, 2024
1 parent da3bdba commit 9d2ca2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ p {
}

.desktop_menu {
@apply hidden lg:block lg:flex lg:justify-between;
@apply hidden lg:flex lg:justify-between;
@apply mt-4 pb-4;
@apply border-b border-gray-700;
}
Expand All @@ -100,8 +100,8 @@ p {
}

.description-modal {
@apply w-full bg-darkness-900 overflow-scroll shadow-xl transform transition-all h-[80%] px-4;
@apply lg:mx-auto lg:border-0 lg:max-w-7xl;
@apply w-full bg-darkness-900 overflow-scroll shadow-xl transform transition-all h-full px-4;
@apply lg:mx-auto lg:h-[90%] lg:max-w-[80%];
}

.description-modal h1 {
Expand Down
16 changes: 13 additions & 3 deletions resources/js/Components/Modals/DetailsModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import {computed, onMounted, onUnmounted, watch} from 'vue';
import {onMounted, onUnmounted, watch} from 'vue';
import {useModalStore} from "@/Stores/modalStore.js";
Expand Down Expand Up @@ -50,7 +50,10 @@ onUnmounted(() => {
<template>
<Teleport to="body">
<Transition leave-active-class="duration-200">
<div v-show="show" class="fixed inset-0 overflow-y-auto sm:px-0 z-50" scroll-region>
<div
v-show="show"
class="fixed inset-0 overflow-y-auto sm:px-0 z-50"
>
<Transition
enter-active-class="ease-out duration-300"
enter-from-class="opacity-0"
Expand All @@ -60,7 +63,7 @@ onUnmounted(() => {
leave-to-class="opacity-0"
>
<div v-show="show" class="fixed inset-0 transform transition-all" @click="close">
<div class="absolute inset-0 bg-gray-700 opacity-75"/>
<div class="absolute inset-0 bg-gray-400 opacity-75"/>
</div>
</Transition>

Expand All @@ -76,6 +79,13 @@ onUnmounted(() => {
v-show="show"
class="description-modal"
>
<button
class="p-2 bg-blood-500 text-white text-sm rounded-xl absolute top-4 right-4"
@click="close"
>
Fermer
</button>

<h1>{{ modalStore.details.name }}</h1>

<p v-html="modalStore.details?.description?.text"></p>
Expand Down

0 comments on commit 9d2ca2e

Please sign in to comment.