Skip to content

Commit ea82f69

Browse files
committed
1 parent 6a040b9 commit ea82f69

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

adminforth/spa/src/components/ThreeDotsMenu.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@
4646
<li v-for="action in customActions" :key="action.id">
4747
<div class="wrapper">
4848
<component
49-
v-if="action.customComponent"
5049
:is="(action.customComponent && getCustomComponent(formatComponent(action.customComponent))) || CallActionWrapper"
5150
:meta="formatComponent(action.customComponent).meta"
5251
@callAction="(payload? : Object) => handleActionClick(action, payload)"
5352
>
54-
<a @click.prevent class="block px-4 py-2 hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover">
53+
<a @click.prevent class="block">
5554
<div class="flex items-center gap-2">
5655
<component
5756
v-if="action.icon"
@@ -197,7 +196,10 @@ onUnmounted(() => {
197196

198197
<style lang="scss" scoped>
199198
.wrapper > * {
200-
@apply px-4 py-2;
199+
@apply px-4 py-2
200+
hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover
201+
dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover
202+
cursor-pointer;
201203
}
202204
</style>
203205

adminforth/spa/src/utils/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ export async function callAdminForthApi(
101101
}
102102
}
103103

104-
export function formatComponent(component: AdminForthComponentDeclaration): AdminForthComponentDeclarationFull {
104+
export function formatComponent(component: AdminForthComponentDeclaration | undefined): AdminForthComponentDeclarationFull {
105105
if (typeof component === 'string') {
106106
return { file: component, meta: {} };
107-
} else {
107+
} else if (typeof component === 'object') {
108108
return { file: component.file, meta: component.meta };
109+
} else {
110+
return { file: '', meta: {} };
109111
}
110112
}
111113

0 commit comments

Comments
 (0)