mirror of
https://github.com/colanode/colanode.git
synced 2025-12-16 19:57:46 +01:00
Mark preview tab as opened in double click
This commit is contained in:
@@ -20,12 +20,14 @@ import { MessageContainerTab } from '@/renderer/components/messages/message-cont
|
||||
interface ContainerTabTriggerProps {
|
||||
tab: ContainerTab;
|
||||
onClose: () => void;
|
||||
onOpen: () => void;
|
||||
onMove: (before: string | null) => void;
|
||||
}
|
||||
|
||||
export const ContainerTabTrigger = ({
|
||||
tab,
|
||||
onClose,
|
||||
onOpen,
|
||||
onMove,
|
||||
}: ContainerTabTriggerProps) => {
|
||||
const [, dragRef] = useDrag<string>({
|
||||
@@ -76,6 +78,11 @@ export const ContainerTabTrigger = ({
|
||||
onClose();
|
||||
}
|
||||
}}
|
||||
onDoubleClick={() => {
|
||||
if (tab.preview) {
|
||||
onOpen();
|
||||
}
|
||||
}}
|
||||
ref={dragDropRef as React.LegacyRef<HTMLButtonElement>}
|
||||
>
|
||||
<div className="overflow-hidden truncate">
|
||||
|
||||
@@ -13,6 +13,7 @@ interface ContainerTabsProps {
|
||||
onTabChange: (value: string) => void;
|
||||
onFocus: () => void;
|
||||
onClose: (value: string) => void;
|
||||
onOpen: (value: string) => void;
|
||||
onMove: (tab: string, before: string | null) => void;
|
||||
}
|
||||
|
||||
@@ -21,6 +22,7 @@ export const ContainerTabs = ({
|
||||
onTabChange,
|
||||
onFocus,
|
||||
onClose,
|
||||
onOpen,
|
||||
onMove,
|
||||
}: ContainerTabsProps) => {
|
||||
const activeTab = tabs.find((t) => t.active)?.path;
|
||||
@@ -54,6 +56,7 @@ export const ContainerTabs = ({
|
||||
key={tab.path}
|
||||
tab={tab}
|
||||
onClose={() => onClose(tab.path)}
|
||||
onOpen={() => onOpen(tab.path)}
|
||||
onMove={(before) => onMove(tab.path, before)}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -101,6 +101,7 @@ export const Layout = () => {
|
||||
onFocus={() => {
|
||||
handleFocus('left');
|
||||
}}
|
||||
onOpen={handleOpenLeft}
|
||||
onClose={handleCloseLeft}
|
||||
onTabChange={handleActivateLeft}
|
||||
onMove={handleMoveLeft}
|
||||
@@ -142,6 +143,7 @@ export const Layout = () => {
|
||||
onFocus={() => {
|
||||
handleFocus('right');
|
||||
}}
|
||||
onOpen={handleOpenRight}
|
||||
onTabChange={handleActivateRight}
|
||||
onClose={handleCloseRight}
|
||||
onMove={handleMoveRight}
|
||||
|
||||
@@ -97,7 +97,6 @@ export type EmailPasswordResetInitInput = {
|
||||
export type EmailPasswordResetCompleteInput = {
|
||||
id: string;
|
||||
otp: string;
|
||||
email: string;
|
||||
password: string;
|
||||
platform: string;
|
||||
version: string;
|
||||
|
||||
Reference in New Issue
Block a user