Skip to content

Commit

Permalink
Merge pull request #3314 from Bnyro/share-video-item
Browse files Browse the repository at this point in the history
feat: add share button to video items and improve share dialog ui
  • Loading branch information
Bnyro authored Jan 10, 2024
2 parents 7766404 + 7cf8c22 commit c8e05c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/ShareModal.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<ModalComponent>
<h2 v-t="'actions.share'" />
<h2 v-t="'actions.share'" class="mb-5" />
<div class="flex justify-between">
<label v-t="'actions.piped_link'" />
<input v-model="pipedLink" type="checkbox" @change="onChange" />
</div>
<hr />
<div v-if="hasPlaylist" class="flex justify-between">
<label v-t="'actions.with_playlist'" />
<input v-model="withPlaylist" type="checkbox" @change="onChange" />
Expand All @@ -17,6 +18,7 @@
<label v-t="'actions.time_code'" />
<input v-model="timeStamp" class="input w-12" type="text" @change="onChange" />
</div>
<hr />
<a :href="generatedLink" target="_blank">
<h3 class="mt-4" v-text="generatedLink" />
</a>
Expand Down
21 changes: 16 additions & 5 deletions src/components/VideoItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@
>
<font-awesome-icon icon="headphones" />
</router-link>
<button :title="$t('actions.add_to_playlist')" @click="showModal = !showModal">
<button :title="$t('actions.add_to_playlist')" @click="showPlaylistModal = !showPlaylistModal">
<font-awesome-icon icon="circle-plus" />
</button>
<button :title="$t('actions.share')" @click="showShareModal = !showShareModal">
<font-awesome-icon icon="share" />
</button>
<button
v-if="admin"
ref="removeButton"
Expand All @@ -125,10 +128,16 @@
@confirm="removeVideo(item.url.substr(-11))"
/>
<PlaylistAddModal
v-if="showModal"
v-if="showPlaylistModal"
:video-id="item.url.substr(-11)"
:video-info="item"
@close="showModal = !showModal"
@close="showPlaylistModal = false"
/>
<ShareModal
v-if="showShareModal"
:video-id="item.url.substr(-11)"
:current-time="0"
@close="showShareModal = false"
/>
</div>
</div>
Expand All @@ -137,10 +146,11 @@

<script>
import PlaylistAddModal from "./PlaylistAddModal.vue";
import ShareModal from "./ShareModal.vue";
import ConfirmModal from "./ConfirmModal.vue";
export default {
components: { PlaylistAddModal, ConfirmModal },
components: { PlaylistAddModal, ConfirmModal, ShareModal },
props: {
item: {
type: Object,
Expand All @@ -162,7 +172,8 @@ export default {
emits: ["remove"],
data() {
return {
showModal: false,
showPlaylistModal: false,
showShareModal: false,
showVideo: true,
showConfirmRemove: false,
};
Expand Down

0 comments on commit c8e05c2

Please sign in to comment.