Skip to content

Commit

Permalink
Move NModal component outside of header for better structure. (#550)
Browse files Browse the repository at this point in the history
* Move `NModal` component outside of header for better structure.

* Adjust margin-right for search button in snapshot view.
  • Loading branch information
swuecho authored Oct 21, 2024
1 parent 339c2da commit 250278c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions web/src/views/snapshot/all.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { useDialog, useMessage } from 'naive-ui'
import { useDialog, useMessage, NModal } from 'naive-ui'
import Search from './components/Search.vue'
import { fetchSnapshotAll, fetchSnapshotDelete } from '@/api'
import { HoverButton, SvgIcon } from '@/components/common'
Expand Down Expand Up @@ -70,11 +70,13 @@ function handleDelete(post: Snapshot.PostLink) {
<HoverButton @click="searchVisible = true">
<SvgIcon icon="ic:round-search" class="text-2xl" />
</HoverButton>
<NModal v-model:show="searchVisible" preset="dialog">
<Search />
</NModal>

</div>

</header>
<NModal v-model:show="searchVisible" preset="dialog">
<Search />
</NModal>
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
<Permission :visible="needPermission" />
<div v-if="!needPermission" class="max-w-screen-xl px-4 py-8 mx-auto">
Expand All @@ -89,7 +91,7 @@ function handleDelete(post: Snapshot.PostLink) {
<div class="flex">
<time :datetime="post.date" class="mb-1 text-sm font-medium text-gray-600">{{
post.date
}}</time>
}}</time>
<div class="ml-2 text-sm" @click="handleDelete(post)">
<SvgIcon icon="ic:baseline-delete-forever" />
</div>
Expand Down

0 comments on commit 250278c

Please sign in to comment.