diff --git a/components/modal/ModalContainer.vue b/components/modal/ModalContainer.vue index fecf3f13..25ba1d62 100644 --- a/components/modal/ModalContainer.vue +++ b/components/modal/ModalContainer.vue @@ -5,6 +5,7 @@ import { isCommandPanelOpen, isConfirmDialogOpen, isEditHistoryDialogOpen, + isFavouritedBoostedByDialogOpen, isMediaPreviewOpen, isPreviewHelpOpen, isPublishDialogOpen, @@ -43,6 +44,10 @@ const handleConfirmChoice = (choice: ConfirmDialogChoice) => { confirmDialogChoice.value = choice isConfirmDialogOpen.value = false } + +const handleFavouritedBoostedByClose = () => { + isFavouritedBoostedByDialogOpen.value = false +} @@ -81,5 +86,12 @@ const handleConfirmChoice = (choice: ConfirmDialogChoice) => { + + + diff --git a/components/status/StatusActionsMore.vue b/components/status/StatusActionsMore.vue index 697d2c51..8365ac5f 100644 --- a/components/status/StatusActionsMore.vue +++ b/components/status/StatusActionsMore.vue @@ -111,6 +111,10 @@ async function editStatus() { editingStatus: status, }, true) } + +const showFavoritedAndBoostedBy = () => { + openFavoridedBoostedByDialog(status.id) +} @@ -162,6 +166,13 @@ async function editStatus() { /> + + +import { favouritedBoostedByStatusId } from '~/composables/dialog' + +const type = ref<'favourited-by' | 'boosted-by'>('favourited-by') + +function load() { + return useMasto().v1.statuses[type.value === 'favourited-by' ? 'listFavouritedBy' : 'listRebloggedBy'](favouritedBoostedByStatusId.value!) +} + +const paginator = $computed(() => load()) + +function showFavouritedBy() { + type.value = 'favourited-by' +} + +function showRebloggedBy() { + type.value = 'boosted-by' +} + +const { t } = useI18n() +const tabs = [ + { + name: 'favourited-by', + display: t('status.favourited_by'), + onClick: showFavouritedBy, + }, + { + name: 'boosted-by', + display: t('status.boosted_by'), + onClick: showRebloggedBy, + }, +] + + + + + + + {{ + option.display + }} + + + + + diff --git a/composables/dialog.ts b/composables/dialog.ts index 5aab8372..46f9e08a 100644 --- a/composables/dialog.ts +++ b/composables/dialog.ts @@ -22,9 +22,12 @@ export const isEditHistoryDialogOpen = ref(false) export const isPreviewHelpOpen = ref(isFirstVisit.value) export const isCommandPanelOpen = ref(false) export const isConfirmDialogOpen = ref(false) +export const isFavouritedBoostedByDialogOpen = ref(false) export const lastPublishDialogStatus = ref(null) +export const favouritedBoostedByStatusId = ref(null) + export function openSigninDialog() { isSigninDialogOpen.value = true } @@ -62,6 +65,11 @@ export async function openPublishDialog(draftKey = 'dialog', draft?: Draft, over await until(isPublishDialogOpen).toBe(false) } +export async function openFavoridedBoostedByDialog(statusId: string) { + isFavouritedBoostedByDialogOpen.value = true + favouritedBoostedByStatusId.value = statusId +} + if (isPreviewHelpOpen.value) { watch(isPreviewHelpOpen, () => { isFirstVisit.value = false diff --git a/locales/en-US.json b/locales/en-US.json index e7891d62..8b2e81a5 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -146,6 +146,7 @@ "open_in_original_site": "Open in original site", "pin_on_profile": "Pin on profile", "share_post": "Share this post", + "show_favourited_and_boosted_by": "Show who favourited and boosted", "show_reblogs": "Show boosts from {0}", "show_untranslated": "Show untranslated", "toggle_theme": { @@ -346,7 +347,9 @@ "uploading": "Uploading..." }, "status": { + "boosted_by": "Boosted By", "edited": "Edited {0}", + "favourited_by": "Favorited By", "filter_hidden_phrase": "Filtered by", "filter_removed_phrase": "Removed by filter", "filter_show_anyway": "Show anyway",