refactor(ui): title and actions slot on modals

This commit is contained in:
liyasthomas
2021-08-08 12:42:29 +05:30
parent 4d76c83328
commit 42d2dd284f
25 changed files with 114 additions and 137 deletions

View File

@@ -1,9 +1,5 @@
<template>
<SmartModal v-if="show" @close="hideModal">
<template #header>
<h3 class="heading">{{ $t("modal.confirm") }}</h3>
<ButtonSecondary icon="close" @click.native="hideModal" />
</template>
<SmartModal v-if="show" :title="$t('modal.confirm')" @close="hideModal">
<template #body>
<div class="flex flex-col px-2">
<label class="font-semibold">

View File

@@ -48,7 +48,15 @@
"
>
<div class="flex pl-2 items-center justify-between">
<slot name="header"></slot>
<h3 class="heading">{{ title }}</h3>
<span class="flex">
<slot name="actions"></slot>
<ButtonSecondary
v-if="dimissible"
icon="close"
@click.native="close"
/>
</span>
</div>
<div
class="
@@ -97,6 +105,14 @@ export default defineComponent({
type: Boolean,
default: false,
},
title: {
type: String,
default: "",
},
dimissible: {
type: Boolean,
default: true,
},
},
setup() {
const { disableKeybindings, enableKeybindings } = useKeybindingDisabler()