PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / trunk
Hostinger Reach – AI-Powered Email Marketing for WordPress vtrunk
1.8.0 1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / frontend / vue / components / Modals / Base / BaseModal.vue
hostinger-reach / frontend / vue / components / Modals / Base Last commit date
BaseModal.vue 4 days ago
BaseModal.vue
98 lines
1 <script lang="ts" setup>
2 import { onMounted, onUnmounted } from 'vue';
3
4 import { useScrollLock } from '@/composables/useScrollLock';
5
6 interface Props {
7 title?: string;
8 subtitle?: string;
9 titleAlignment?: 'centered' | 'left';
10 disableScroll?: boolean;
11 }
12
13 const props = withDefaults(defineProps<Props>(), {
14 titleAlignment: 'left',
15 disableScroll: true
16 });
17
18 const { lockScroll, unlockScroll } = useScrollLock();
19
20 onMounted(() => {
21 if (props.disableScroll) {
22 lockScroll();
23 }
24 });
25
26 onUnmounted(() => {
27 if (props.disableScroll) {
28 unlockScroll();
29 }
30 });
31 </script>
32
33 <template>
34 <div class="base-modal">
35 <div class="base-modal__header">
36 <slot name="back-button"></slot>
37 <span
38 class="base-modal__title-container"
39 :class="{
40 'base-modal__title-container--centered': titleAlignment === 'centered'
41 }"
42 >
43 <slot name="title-icon"></slot>
44 <h2 v-if="title" class="base-modal__title">{{ title }}</h2>
45 </span>
46 <slot name="header-content"></slot>
47 </div>
48 <p
49 v-if="subtitle"
50 class="base-modal__subtitle"
51 :class="{
52 'base-modal__subtitle--centered': titleAlignment === 'centered'
53 }"
54 >
55 {{ subtitle }}
56 </p>
57 <slot></slot>
58 </div>
59 </template>
60
61 <style lang="scss" scoped>
62 .base-modal {
63 &__header {
64 position: relative;
65 margin-bottom: 8px;
66 margin-top: -4px;
67 }
68
69 &__title-container {
70 display: flex;
71 align-items: center;
72 justify-content: flex-start;
73
74 &--centered {
75 justify-content: center;
76 }
77 }
78
79 &__title {
80 font-size: 20px;
81 color: var(--neutral--700);
82 margin: 0;
83 font-weight: 700;
84 }
85
86 &__subtitle {
87 font-size: 14px;
88 margin-top: 4px;
89 margin-bottom: 24px;
90 color: var(--neutral--500);
91
92 &--centered {
93 text-align: center;
94 }
95 }
96 }
97 </style>
98