From dd3b226917b9b97c8b22edc9207ac1e5f8abeb4b Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Wed, 25 Mar 2026 15:54:26 +0900 Subject: [PATCH] =?UTF-8?q?feat(pop-profile):=20=EC=95=B1=20=EB=AA=A8?= =?UTF-8?q?=EB=93=9C(=ED=92=80=EC=8A=A4=ED=81=AC=EB=A6=B0)=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=ED=95=AD=EB=AA=A9=20=EC=B6=94=EA=B0=80=20POP=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=ED=8C=9D=EC=98=A4=EB=B2=84?= =?UTF-8?q?=EC=97=90=20"=EC=95=B1=20=EB=AA=A8=EB=93=9C"=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4.=20Fu?= =?UTF-8?q?llscreen=20API=EB=A1=9C=20=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80?= =?UTF-8?q?=EB=A5=BC=20=EC=A0=84=EC=B2=B4=ED=99=94=EB=A9=B4=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=ED=95=98=EC=97=AC=20=EC=95=B1=EC=B2=98=EB=9F=BC=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=20=EA=B0=80=EB=8A=A5.=20-=20showAppMode=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(=EA=B8=B0=EB=B3=B8=20=ED=99=9C=EC=84=B1=ED=99=94)=20-=20?= =?UTF-8?q?=ED=92=80=EC=8A=A4=ED=81=AC=EB=A6=B0=20=EC=A7=84=EC=9E=85:=20do?= =?UTF-8?q?cument.documentElement.requestFullscreen()=20-=20=ED=92=80?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=B0=20=ED=95=B4=EC=A0=9C:=20document.ex?= =?UTF-8?q?itFullscreen()=20-=20=EC=83=81=ED=83=9C=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=EC=95=84=EC=9D=B4=EC=BD=98/=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=A0=84=ED=99=98=20(Maximize2/Minimize2,=20?= =?UTF-8?q?=EC=95=B1=20=EB=AA=A8=EB=93=9C/=EC=95=B1=20=EB=AA=A8=EB=93=9C?= =?UTF-8?q?=20=ED=95=B4=EC=A0=9C)=20-=20fullscreenchange=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EB=A6=AC=EC=8A=A4=EB=84=88=EB=A1=9C=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=8F=99=EA=B8=B0=ED=99=94=20-=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B4=EB=84=88=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=ED=8C=A8=EB=84=90=EC=97=90=20"=EC=95=B1=20=EB=AA=A8=EB=93=9C?= =?UTF-8?q?=20(=ED=92=80=EC=8A=A4=ED=81=AC=EB=A6=B0)"=20=ED=86=A0=EA=B8=80?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registry/pop-components/pop-profile.tsx | 56 ++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/frontend/lib/registry/pop-components/pop-profile.tsx b/frontend/lib/registry/pop-components/pop-profile.tsx index 325b3ea3..ed7a5962 100644 --- a/frontend/lib/registry/pop-components/pop-profile.tsx +++ b/frontend/lib/registry/pop-components/pop-profile.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useState, useMemo } from "react"; +import React, { useState, useMemo, useEffect, useCallback } from "react"; import { useRouter } from "next/navigation"; import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; @@ -17,7 +17,7 @@ import { PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; -import { Monitor, LayoutGrid, LogOut, UserCircle } from "lucide-react"; +import { Monitor, LayoutGrid, LogOut, UserCircle, Maximize2, Minimize2 } from "lucide-react"; import { PopComponentRegistry } from "@/lib/registry/PopComponentRegistry"; import { useAuth } from "@/hooks/useAuth"; @@ -31,6 +31,7 @@ export interface PopProfileConfig { avatarSize?: AvatarSize; showDashboardLink?: boolean; showPcMode?: boolean; + showAppMode?: boolean; showLogout?: boolean; } @@ -38,6 +39,7 @@ const DEFAULT_CONFIG: PopProfileConfig = { avatarSize: "md", showDashboardLink: true, showPcMode: true, + showAppMode: true, showLogout: true, }; @@ -67,6 +69,33 @@ function PopProfileComponent({ config: rawConfig }: PopProfileComponentProps) { const router = useRouter(); const { user, isLoggedIn, logout } = useAuth(); const [open, setOpen] = useState(false); + const [isFullscreen, setIsFullscreen] = useState(false); + + // 풀스크린 상태 변경 감지 + useEffect(() => { + const handleFullscreenChange = () => { + setIsFullscreen(!!document.fullscreenElement); + }; + document.addEventListener("fullscreenchange", handleFullscreenChange); + // 초기 상태 동기화 + setIsFullscreen(!!document.fullscreenElement); + return () => { + document.removeEventListener("fullscreenchange", handleFullscreenChange); + }; + }, []); + + const handleAppMode = useCallback(async () => { + setOpen(false); + try { + if (document.fullscreenElement) { + await document.exitFullscreen(); + } else { + await document.documentElement.requestFullscreen(); + } + } catch { + // 풀스크린 API 미지원 또는 사용자 거부 + } + }, []); const config = useMemo(() => ({ ...DEFAULT_CONFIG, @@ -180,6 +209,20 @@ function PopProfileComponent({ config: rawConfig }: PopProfileComponentProps) { PC 모드 )} + {config.showAppMode && ( + + )} {config.showLogout && ( <>
@@ -276,6 +319,14 @@ function PopProfileConfigPanel({ config: rawConfig, onUpdate }: PopProfileConfig />
+
+ + updateConfig({ showAppMode: v })} + /> +
+