Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Add unclosable modals (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically authored Jun 20, 2023
1 parent 2bdd0a0 commit 61e00f1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 6 additions & 2 deletions lib/components/base/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
noblur: props.noblur,
}"
class="modal-overlay"
@click="hide"
@click="() => (closable ? hide() : {})"
/>
<div class="modal-container" :class="{ shown: actuallyShown }">
<div class="modal-body">
<div v-if="props.header" class="header">
<h1>{{ props.header }}</h1>
<button class="btn icon-only transparent" @click="hide">
<button v-if="closable" class="btn icon-only transparent" @click="hide">
<XIcon />
</button>
</div>
Expand All @@ -38,6 +38,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
closable: {
type: Boolean,
default: true,
},
})
const shown = ref(false)
Expand Down
6 changes: 5 additions & 1 deletion lib/components/base/ModalConfirm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Modal ref="modal" :header="props.title">
<Modal ref="modal" :header="props.title" :noblur="noblur">
<div class="modal-delete">
<div class="markdown-body" v-html="renderString(props.description)" />
<label v-if="props.hasToType" for="confirmation" class="confirmation-label">
Expand Down Expand Up @@ -61,6 +61,10 @@ const props = defineProps({
type: String,
default: 'Proceed',
},
noblur: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['proceed'])
Expand Down
6 changes: 5 additions & 1 deletion lib/components/base/ModalReport.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Modal ref="modal" :header="`Report ${props.itemType}`">
<Modal ref="modal" :header="`Report ${props.itemType}`" :noblur="noblur">
<div class="modal-report">
<div class="markdown-body">
<p>
Expand Down Expand Up @@ -76,6 +76,10 @@ const props = defineProps({
type: Function,
default: () => {},
},
noblur: {
type: Boolean,
default: false,
},
})
const reportType = ref('')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "omorphia",
"type": "module",
"version": "0.4.28",
"version": "0.4.29",
"files": [
"dist",
"lib"
Expand Down

0 comments on commit 61e00f1

Please sign in to comment.