데스크톱 앱 리프레시 기능 추가
This commit is contained in:
@@ -50,6 +50,8 @@ interface TopMenuBarProps {
|
||||
onOpenFloatingWidgets?: () => void;
|
||||
/** 실행 중인 플로팅 위젯 창 수 */
|
||||
floatingWidgetCount?: number;
|
||||
/** 데스크톱 — 현재 화면 데이터 새로고침 */
|
||||
onRefresh?: () => void;
|
||||
/** 메뉴별 접근 허용 (없으면 전체 표시) */
|
||||
menuPermissions?: Record<string, boolean>;
|
||||
}
|
||||
@@ -116,6 +118,15 @@ const IcDesktopUpdate = () => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
const IcRefresh = () => (
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M2 8a6 6 0 0 1 10.2-4.2"/>
|
||||
<polyline points="12,2 12,5.5 8.5,5.5"/>
|
||||
<path d="M14 8a6 6 0 0 1-10.2 4.2"/>
|
||||
<polyline points="4,14 4,10.5 7.5,10.5"/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
const IcNotify = () => (
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M8 1.5a4.5 4.5 0 0 0-4.5 4.5c0 3.5-1 4.5-1.5 4.5h12c-.5 0-1.5-1-1.5-4.5A4.5 4.5 0 0 0 8 1.5z"/>
|
||||
@@ -293,10 +304,12 @@ export const TopMenuBar = memo(function TopMenuBar({
|
||||
onFullscreen,
|
||||
onOpenFloatingWidgets,
|
||||
floatingWidgetCount = 0,
|
||||
onRefresh,
|
||||
menuPermissions,
|
||||
}: TopMenuBarProps) {
|
||||
const [isFullscreen, setIsFullscreen] = useState(() => !!document.fullscreenElement);
|
||||
const [desktopUpdateOpen, setDesktopUpdateOpen] = useState(false);
|
||||
const [refreshBusy, setRefreshBusy] = useState(false);
|
||||
const desktopClient = isDesktop();
|
||||
const appVersion = useAppTitleBarVersion();
|
||||
|
||||
@@ -340,6 +353,26 @@ export const TopMenuBar = memo(function TopMenuBar({
|
||||
|
||||
{/* 우측 영역 */}
|
||||
<div className="tmb-right">
|
||||
{desktopClient && onRefresh && (
|
||||
<button
|
||||
type="button"
|
||||
className={`tmb-refresh-btn${refreshBusy ? ' busy' : ''}`}
|
||||
onClick={() => {
|
||||
if (refreshBusy) return;
|
||||
setRefreshBusy(true);
|
||||
try {
|
||||
onRefresh();
|
||||
} finally {
|
||||
window.setTimeout(() => setRefreshBusy(false), 600);
|
||||
}
|
||||
}}
|
||||
title="현재 화면 새로고침"
|
||||
aria-label="현재 화면 새로고침"
|
||||
>
|
||||
<IcRefresh />
|
||||
</button>
|
||||
)}
|
||||
|
||||
{onOpenFloatingWidgets && (
|
||||
<div className="tmb-floating-widget-wrap">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user