refactor: update share request flow (#3805)

This commit is contained in:
Nivedin
2024-02-05 23:50:15 +05:30
committed by GitHub
parent 0028f6e878
commit 3911c9cd1f
5 changed files with 66 additions and 16 deletions

View File

@@ -29,6 +29,7 @@
class="flex flex-col focus:outline-none"
tabindex="0"
@keyup.r="renameAction?.$el.click()"
@keyup.s="shareRequestAction?.$el.click()"
@keyup.d="duplicateAction?.$el.click()"
@keyup.w="closeAction?.$el.click()"
@keyup.x="closeOthersAction?.$el.click()"
@@ -58,6 +59,19 @@
}
"
/>
<HoppSmartItem
ref="shareRequestAction"
:icon="IconShare2"
:label="t('tab.share_tab_request')"
:shortcut="['S']"
:new="true"
@click="
() => {
emit('share-tab-request')
hide()
}
"
/>
<HoppSmartItem
v-if="isRemovable"
ref="closeAction"
@@ -99,6 +113,7 @@ import IconXCircle from "~icons/lucide/x-circle"
import IconXSquare from "~icons/lucide/x-square"
import IconFileEdit from "~icons/lucide/file-edit"
import IconCopy from "~icons/lucide/copy"
import IconShare2 from "~icons/lucide/share-2"
import { HoppTab } from "~/services/tab"
import { HoppRESTDocument } from "~/helpers/rest/document"
@@ -114,6 +129,7 @@ const emit = defineEmits<{
(event: "close-tab"): void
(event: "close-other-tabs"): void
(event: "duplicate-tab"): void
(event: "share-tab-request"): void
}>()
const tippyActions = ref<TippyComponent | null>(null)
@@ -123,4 +139,5 @@ const renameAction = ref<HTMLButtonElement | null>(null)
const closeAction = ref<HTMLButtonElement | null>(null)
const closeOthersAction = ref<HTMLButtonElement | null>(null)
const duplicateAction = ref<HTMLButtonElement | null>(null)
const shareRequestAction = ref<HTMLButtonElement | null>(null)
</script>