Skip to content

Commit 5be36ab

Browse files
committed
refactor(web): render redirect prompt as v-menu not v-card
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 878f9e23-78ea-4f5d-aed2-c1381514107f
1 parent b7f7494 commit 5be36ab

1 file changed

Lines changed: 40 additions & 37 deletions

File tree

web/app/components/RedirectPromptPopover.vue

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { computed } from 'vue'
23
import { mdiClose, mdiArrowRight } from '@mdi/js'
34
45
const route = useRoute()
@@ -12,45 +13,47 @@ const showPopover = computed(
1213
!redirectStore.enabled &&
1314
!redirectStore.dismissedThisSession,
1415
)
16+
17+
const menuOpen = computed({
18+
get: () => showPopover.value,
19+
set: (value: boolean) => {
20+
if (!value) redirectStore.dismiss()
21+
},
22+
})
1523
</script>
1624

1725
<template>
18-
<v-card
19-
v-if="showPopover"
20-
class="redirect-prompt pa-4"
21-
elevation="8"
22-
rounded="lg"
23-
max-width="280"
26+
<v-menu
27+
v-model="menuOpen"
28+
activator="parent"
29+
location="bottom end"
30+
offset="8"
31+
:open-on-click="false"
32+
:close-on-content-click="false"
2433
>
25-
<div class="d-flex align-center justify-space-between">
26-
<span class="text-body-1">Skip this page next time?</span>
27-
<v-btn
28-
:icon="mdiClose"
29-
variant="text"
30-
size="small"
31-
color="warning"
32-
density="comfortable"
33-
aria-label="Dismiss"
34-
@click="redirectStore.dismiss()"
35-
/>
36-
</div>
37-
<a
38-
class="text-primary text-decoration-none hover:text-decoration-underline d-inline-flex align-center mt-1"
39-
href="#"
40-
@click.prevent="redirectStore.enable()"
41-
>
42-
Always open dashboard
43-
<v-icon :icon="mdiArrowRight" size="small" class="ml-1" />
44-
</a>
45-
</v-card>
34+
<v-list width="280" class="py-0" rounded="lg" elevation="8">
35+
<v-list-item>
36+
<v-list-item-title class="text-body-1">
37+
Skip this page next time?
38+
</v-list-item-title>
39+
<template #append>
40+
<v-btn
41+
:icon="mdiClose"
42+
variant="text"
43+
size="small"
44+
color="warning"
45+
density="comfortable"
46+
aria-label="Dismiss"
47+
@click="redirectStore.dismiss()"
48+
/>
49+
</template>
50+
</v-list-item>
51+
<v-list-item class="text-primary" @click="redirectStore.enable()">
52+
<v-list-item-title>Always open dashboard</v-list-item-title>
53+
<template #append>
54+
<v-icon :icon="mdiArrowRight" size="small" />
55+
</template>
56+
</v-list-item>
57+
</v-list>
58+
</v-menu>
4659
</template>
47-
48-
<style scoped>
49-
.redirect-prompt {
50-
position: absolute;
51-
right: 0;
52-
top: 100%;
53-
margin-top: 8px;
54-
z-index: 10;
55-
}
56-
</style>

0 commit comments

Comments
 (0)