From 4bf94a1d304619c6414b6f5a8a06507a57a89570 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 9 Feb 2020 14:10:39 -0500 Subject: [PATCH] feat: social sharing menu --- client/client-app.js | 1 + client/components/common/social-sharing.vue | 106 ++++++++++++++++++++ client/themes/default/components/page.vue | 18 +++- 3 files changed, 120 insertions(+), 5 deletions(-) create mode 100644 client/components/common/social-sharing.vue diff --git a/client/client-app.js b/client/client-app.js index 5847393e..9d53901d 100644 --- a/client/client-app.js +++ b/client/client-app.js @@ -162,6 +162,7 @@ Vue.component('page-selector', () => import(/* webpackPrefetch: true, webpackChu Vue.component('profile', () => import(/* webpackChunkName: "profile" */ './components/profile.vue')) Vue.component('register', () => import(/* webpackChunkName: "register" */ './components/register.vue')) Vue.component('search-results', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/search-results.vue')) +Vue.component('social-sharing', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/social-sharing.vue')) Vue.component('tags', () => import(/* webpackChunkName: "tags" */ './components/tags.vue')) Vue.component('unauthorized', () => import(/* webpackChunkName: "unauthorized" */ './components/unauthorized.vue')) Vue.component('v-card-chin', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-chin.vue')) diff --git a/client/components/common/social-sharing.vue b/client/components/common/social-sharing.vue new file mode 100644 index 00000000..86934337 --- /dev/null +++ b/client/components/common/social-sharing.vue @@ -0,0 +1,106 @@ + + + diff --git a/client/themes/default/components/page.vue b/client/themes/default/components/page.vue index 0e0328c4..9b0b947e 100644 --- a/client/themes/default/components/page.vue +++ b/client/themes/default/components/page.vue @@ -122,10 +122,17 @@ template(v-slot:activator='{ on }') v-btn(icon, tile, v-on='on'): v-icon(color='grey') mdi-bookmark span {{$t('common:page.bookmark')}} - v-tooltip(bottom) - template(v-slot:activator='{ on }') - v-btn(icon, tile, v-on='on'): v-icon(color='grey') mdi-share-variant - span {{$t('common:page.share')}} + v-menu(offset-y, bottom, min-width='300') + template(v-slot:activator='{ on: menu }') + v-tooltip(bottom) + template(v-slot:activator='{ on: tooltip }') + v-btn(icon, tile, v-on='{ ...menu, ...tooltip }'): v-icon(color='grey') mdi-share-variant + span {{$t('common:page.share')}} + social-sharing( + :url='pageUrl' + :title='title' + :description='description' + ) v-tooltip(bottom) template(v-slot:activator='{ on }') v-btn(icon, tile, v-on='on', @click='print'): v-icon(color='grey') mdi-printer @@ -377,7 +384,8 @@ export default { }) return result }, [])) - } + }, + pageUrl () { return window.location.href } }, created() { this.$store.commit('page/SET_AUTHOR_ID', this.authorId)