260727_02_ENH: 통화중 이동 최대한 막기

This commit is contained in:
2026-07-27 17:13:58 +09:00
parent 157ba6155d
commit ce5a402253
5 changed files with 82 additions and 37 deletions

View File

@@ -9,6 +9,7 @@ import type { LoginUser } from "@kri/common";
interface AppHeaderProps {
isMain: boolean;
isContactPage: boolean;
menuOpen: boolean;
activeTopId: string;
topMenus: TopMenuItem[];
@@ -24,6 +25,7 @@ interface AppHeaderProps {
export function AppHeader({
isMain,
isContactPage,
menuOpen,
activeTopId,
topMenus,
@@ -51,12 +53,12 @@ export function AppHeader({
</div>
}
homePath="/"
menus={topMenus}
menus={isContactPage? []:topMenus}
activeMenuId={activeTopId}
menuOpen={menuOpen}
showMenuButton={!isMain}
showMenuButton={!isMain && !isContactPage}
onToggleMenu={onToggleMenu}
onNavigate={(path) => onNavigate(path)}
onNavigate={(path) => {if(!isContactPage) onNavigate(path)}}
className="border-gray-200 bg-white"
innerClassName="h-16 px-4"
center={

View File

@@ -108,6 +108,7 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo
const userRole = auth.user?.userRole;
const isMain = pathname === "/";
const isContactPage = pathname.startsWith("/list/contact");
const isProjectMenu = !pathname.startsWith("/manage");
const isViewProjectTitle = !isMain && isProjectMenu && !pathname.startsWith("/project/info");
const visibleTopMenus = useMemo(() => filterTopMenusByRole(topMenus, userRole), [userRole]);
@@ -186,14 +187,15 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo
<KriMainLayout
fullHeight={false}
className={cn("bg-gray-50", "h-screen overflow-hidden")}
bodyClassName={cn(!isMain && "min-h-0")}
bodyClassName={cn(!isMain && isContactPage && "min-h-0")}
mainClassName={cn("p-4", "min-h-0")}
mainStyle={{ fontSize: `var(--content-font-size, ${initialFontSize}px)` }}
sidebarOpen={!isMain && menuOpen}
sidebarOpen={!isMain && isContactPage && menuOpen}
onSidebarOpenChange={setMenuOpen}
header={
<AppHeader
isMain={isMain}
isContactPage={isContactPage}
menuOpen={menuOpen}
activeTopId={activeTop.id}
topMenus={visibleTopMenus}
@@ -208,7 +210,7 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo
/>
}
sidebar={
!isMain ? (
!isMain && !isContactPage ? (
<AppSidebar
isProjectMenu={isProjectMenu}
sideMenus={sideMenus}

View File

@@ -113,18 +113,6 @@ const ListContactInfoPanel = ({
const isDialing = ctiCallPhase === 'dialing'
const isOnCall = ctiCallPhase === 'active'
useEffect(() => {
if (!isOnCall) return
const handleBeforeUnload = (event: BeforeUnloadEvent) => {
event.preventDefault()
event.returnValue = true
}
window.addEventListener('beforeunload', handleBeforeUnload)
return () => window.removeEventListener('beforeunload', handleBeforeUnload)
}, [isOnCall])
const visibleHeaders = listHeaders
.filter((header) => isListFieldVisibleForContact(header))
.sort((a, b) => {