Skip to content

Commit

Permalink
feat: add share button for projects and studies
Browse files Browse the repository at this point in the history
  • Loading branch information
NRayya committed Oct 17, 2023
1 parent 27f8998 commit b55d13d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
6 changes: 0 additions & 6 deletions resources/js/Pages/Study/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
:model="model"
called-from="studyView"
/>
<ToolTip
class="inline h-4 w-12 ml-0"
text="The avatars (left) correspond to the users with whom the study is shared. Click there to edit sharing options."
></ToolTip>
<a
class="cursor-pointer inline-flex items-center"
@click="toggleDetails"
Expand Down Expand Up @@ -406,7 +402,6 @@ import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
import AccessDialogue from "@/Shared/AccessDialogue.vue";
import Citation from "@/Shared/Citation.vue";
import { router } from "@inertiajs/vue3";
import ToolTip from "@/Shared/ToolTip.vue";
export default {
components: {
Expand All @@ -430,7 +425,6 @@ export default {
StarIcon,
AccessDialogue,
Citation,
ToolTip,
},
props: [
"study",
Expand Down
41 changes: 19 additions & 22 deletions resources/js/Shared/AccessDialogue.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
<template>
<div
class="cursor-pointer flex flex-row-reverse justify-end"
class="cursor-pointer flex flex-row-reverse justify-end mr-2"
@click="open = true"
>
<img
<div
v-if="members.length > 0"
class="w-8 h-8 -ml-4 rounded-full border-2 border-white"
src="https://ui-avatars.com/api/?name=+&color=7F9CF5&background=EBF4FF"
class="tooltip w-8 h-8 -ml-.5 rounded-full border-2 border-white bg-gray-100"
alt=""
/>
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-4 w-4 m-1.5 text-gray-400"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"
/>
</svg>
<span
class="bg-gray-900 text-center text-white px-2 py-1 shadow-lg rounded-md tooltiptextbottom"
>Click here to edit sharing options.</span
>
</div>
<img
v-for="user in members"
:key="user.id"
Expand All @@ -29,23 +43,6 @@
:src="team.owner.profile_photo_url"
:alt="team.owner.first_name"
/>
<span v-if="members.length == 0 && !team">
<button
type="button"
class="inline-flex items-center px-0 py-2 ronded-md font-medium text-dark sm:text-sm"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"
/></svg
>&nbsp; SHARE
</button>
</span>
</div>
<TransitionRoot :show="open" as="template" appear @after-leave="query = ''">
<Dialog as="div" class="relative z-10 p-4" @close="open = false">
Expand Down

0 comments on commit b55d13d

Please sign in to comment.