aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_popover
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-06-20 23:57:44 +0300
committerHenry Jameson <me@hjkos.com>2022-06-20 23:57:44 +0300
commit01e56a3e10b9d77e2f5a7fa7c13ce3afbed468d4 (patch)
tree3365827000d96abd1e1c8e869cafc99593d8bec1 /src/components/user_popover
parentcb89646c56288f42896d34e3b405621e08c88575 (diff)
parent60571685c2e42e44b75157c3d52f162bf39c4bab (diff)
Merge remote-tracking branch 'origin/disjointed-popovers' into disjointed-popovers
* origin/disjointed-popovers: popover controls for user-card unify user popovers into a separate component
Diffstat (limited to 'src/components/user_popover')
-rw-r--r--src/components/user_popover/user_popover.js14
-rw-r--r--src/components/user_popover/user_popover.vue33
2 files changed, 47 insertions, 0 deletions
diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js
new file mode 100644
index 00000000..bffd5962
--- /dev/null
+++ b/src/components/user_popover/user_popover.js
@@ -0,0 +1,14 @@
+import { defineAsyncComponent } from 'vue'
+
+const UserPopover = {
+ name: 'UserPopover',
+ props: [
+ 'userId', 'overlayCenters', 'disabled'
+ ],
+ components: {
+ UserCard: defineAsyncComponent(() => import('../user_card/user_card.vue')),
+ Popover: defineAsyncComponent(() => import('../popover/popover.vue'))
+ }
+}
+
+export default UserPopover
diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue
new file mode 100644
index 00000000..c998e298
--- /dev/null
+++ b/src/components/user_popover/user_popover.vue
@@ -0,0 +1,33 @@
+<template>
+<Popover
+ trigger="click"
+ popover-class="popover-default user-popover"
+ overlay-centers-selector=".user-info-avatar-link .Avatar"
+ :overlay-centers="overlayCenters"
+ :disabled="disabled"
+>
+ <template v-slot:trigger>
+ <slot />
+ </template>
+ <template v-slot:content={close}>
+ <UserCard
+ class="user-popover"
+ :user-id="userId"
+ :hide-bio="true"
+ :allow-zooming-avatar="true"
+ :onClose="close"
+ />
+ </template>
+</Popover>
+</template>
+
+<script src="./user_popover.js" ></script>
+
+<style lang="scss">
+@import '../../_variables.scss';
+
+/* popover styles load on-demand, so we need to override */
+.user-popover.popover {
+}
+
+</style>