<template>
<Modal
ref="modal"
- :class="{ 'border-l-theme-danger border border-l-4': isDanger }"
+ :title="title"
+ :class="{ 'border border-l-4 border-l-theme-danger': isDanger }"
:closeHandler="cancelHandler"
>
- <!-- Title -->
- <div class="mb-6 text-xl">{{ title }}</div>
<!-- Message -->
<div class="mb-6">{{ message }}</div>
<!-- Buttons -->
<!-- Mask -->
<div
v-if="isVisible"
- class="fixed left-0 top-0 z-50 flex h-dvh w-dvw items-center justify-center backdrop-blur-sm"
+ class="fixed left-0 top-0 z-50 flex h-dvh w-dvw items-center justify-center bg-slate-950/40 backdrop-blur-sm"
>
<!-- Modal -->
<div
:class="$attrs.class"
>
<CustomButton
+ v-if="props.showClose"
:iconPath="mdiWindowClose"
@click="close"
class="absolute right-1 top-1"
/>
+ <!-- Title -->
+ <div class="mb-6 text-xl">{{ title }}</div>
<slot></slot>
</div>
</div>
</template>
<script setup>
-import { ref } from "vue";
import { mdiWindowClose } from "@mdi/js";
+import { ref } from "vue";
defineOptions({
inheritAttrs: false,
});
const props = defineProps({
+ title: { type: String, default: "Confirm" },
+ showClose: { type: Boolean },
closeHandler: Function,
modalClasses: String,
});
<form class="flex w-full" @submit.prevent="search">
<TextInput
v-model="searchTerm"
- placeholder="Search"
+ :placeholder="props.hidePlaceholder ? '' : 'Search'"
class="rounded-r-none"
ref="textInput"
/>
<script setup>
import { mdilMagnify } from "@mdi/light-js";
import { useToast } from "primevue/usetoast";
-import { ref, onMounted } from "vue";
+import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
import * as constants from "../constants";
import TextInput from "../components/TextInput.vue";
import { getToastOptions } from "../helpers.js";
-const props = defineProps({ initialSearchTerm: String });
+const props = defineProps({
+ initialSearchTerm: String,
+ hidePlaceholder: Boolean,
+});
const emit = defineEmits(["search"]);
const router = useRouter();
<template>
- <Modal ref="modal" class="flex flex-col items-center">
- <Logo class="mb-4" />
- <SearchInput @search="toggle" />
+ <Modal ref="modal" title="Search">
+ <SearchInput @search="toggle" class="mb-4" hidePlaceholder />
+ <div class="flex justify-end">
+ <CustomButton label="Close" @click="toggle" />
+ </div>
</Modal>
</template>
<script setup>
import { ref } from "vue";
+import CustomButton from "../components/CustomButton.vue";
import Modal from "../components/Modal.vue";
import SearchInput from "./SearchInput.vue";
-import Logo from "../components/Logo.vue";
const modal = ref();