refactor to ui components

This commit is contained in:
2023-05-26 16:43:12 +02:00
parent a642fcd1fb
commit c3bd807bff
13 changed files with 122 additions and 125 deletions

View File

@@ -12,35 +12,31 @@ const emit = defineEmits<{
<h1 class="flex flex-grow items-center rounded-md text-3xl font-semibold hover:bg-gray-200">
<slot name="title"></slot>
</h1>
<div class="btn-group flex items-center" v-if="!props.note.isRoot">
<Modal>
<UIButtonGroup class="flex items-center" v-if="!props.note.isRoot">
<UIModal>
<template #activator="{ open }">
<button class="btn-toolbar btn-sm btn" @click="open">
<i class="fas fa-fw fa-trash" />
</button>
<UIButton size="sm" @click="open"><i class="fas fa-fw fa-trash" /></UIButton>
</template>
<template #title>Delete note</template>
<template #default>Are you sure you want to delete this note?</template>
<template #actions="{ close }">
<button class="btn-primary btn-sm btn" @click="emit('delete', close)">Delete note</button>
<button class="btn-sm btn" @click="close">Cancel</button>
<UIButton size="sm" color="primary" @click="emit('delete', close)">Delete notes</UIButton>
<UIButton size="sm" @click="close">Cancel</UIButton>
</template>
</Modal>
<Modal>
</UIModal>
<UIModal>
<template #activator="{ open }">
<button class="btn-toolbar btn-sm btn" @click="open">
<i class="fas fa-fw fa-sitemap" />
</button>
<UIButton size="sm" @click="open"><i class="fas fa-fw fa-sitemap" /></UIButton>
</template>
<template #title>Set root note</template>
<template #default>Are you sure you want to set this note as root note?</template>
<template #actions="{ close }">
<button class="btn-sm btn" @click="close">Cancel</button>
<button class="btn-primary btn-sm btn" @click="emit('setRoot', close)">
<UIButton size="sm" @click="close">Cancel</UIButton>
<UIButton size="sm" color="primary" @click="emit('setRoot', close)">
Set current note as root
</button>
</UIButton>
</template>
</Modal>
</div>
</UIModal>
</UIButtonGroup>
</div>
</template>