mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
feat(web): align session action menus (#1061)
This commit is contained in:
@@ -5,6 +5,7 @@ import { useLongPress } from '@/hooks/useLongPress'
|
||||
import { usePlatform } from '@/hooks/usePlatform'
|
||||
import { useSessionActions } from '@/hooks/mutations/useSessionActions'
|
||||
import { SessionActionMenu } from '@/components/SessionActionMenu'
|
||||
import { SessionExportDialog } from '@/components/SessionExportDialog'
|
||||
import { RenameSessionDialog } from '@/components/RenameSessionDialog'
|
||||
import { ConfirmDialog } from '@/components/ui/ConfirmDialog'
|
||||
import { CopyIcon, CheckIcon, ScheduleIcon } from '@/components/icons'
|
||||
@@ -595,6 +596,7 @@ function SessionItem(props: {
|
||||
const [menuOpen, setMenuOpen] = useState(false)
|
||||
const [menuAnchorPoint, setMenuAnchorPoint] = useState<{ x: number; y: number }>({ x: 0, y: 0 })
|
||||
const [renameOpen, setRenameOpen] = useState(false)
|
||||
const [exportOpen, setExportOpen] = useState(false)
|
||||
const [archiveOpen, setArchiveOpen] = useState(false)
|
||||
const [deleteOpen, setDeleteOpen] = useState(false)
|
||||
const {
|
||||
@@ -748,6 +750,7 @@ function SessionItem(props: {
|
||||
onClose={() => setMenuOpen(false)}
|
||||
sessionActive={s.active}
|
||||
onRename={() => setRenameOpen(true)}
|
||||
onExport={() => setExportOpen(true)}
|
||||
onArchive={() => setArchiveOpen(true)}
|
||||
onReopen={cursorReopenDisabledReason ? undefined : handleReopen}
|
||||
reopenDisabledReason={cursorReopenDisabledReason}
|
||||
@@ -776,6 +779,15 @@ function SessionItem(props: {
|
||||
isPending={isPending}
|
||||
/>
|
||||
|
||||
{exportOpen ? (
|
||||
<SessionExportDialog
|
||||
isOpen={true}
|
||||
onClose={() => setExportOpen(false)}
|
||||
sessionId={s.id}
|
||||
api={api}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<ConfirmDialog
|
||||
isOpen={archiveOpen}
|
||||
onClose={() => setArchiveOpen(false)}
|
||||
|
||||
Reference in New Issue
Block a user