refactor(sidebar): move VersionUpgradeModal into SidebarModals

This commit is contained in:
Haileyesus
2026-02-11 15:42:38 +03:00
parent a0bc4a8c72
commit 8e411187f3
2 changed files with 25 additions and 8 deletions

View File

@@ -1,6 +1,5 @@
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import VersionUpgradeModal from './modals/VersionUpgradeModal';
import { useDeviceSettings } from '../hooks/useDeviceSettings';
import { useVersionCheck } from '../hooks/useVersionCheck';
import { useUiPreferences } from '../hooks/useUiPreferences';
@@ -196,6 +195,11 @@ function Sidebar({
sessionDeleteConfirmation={sessionDeleteConfirmation}
onCancelDeleteSession={() => setSessionDeleteConfirmation(null)}
onConfirmDeleteSession={confirmDeleteSession}
showVersionModal={showVersionModal}
onCloseVersionModal={() => setShowVersionModal(false)}
releaseInfo={releaseInfo}
currentVersion={currentVersion}
latestVersion={latestVersion}
t={t}
/>
@@ -234,13 +238,6 @@ function Sidebar({
</>
)}
<VersionUpgradeModal
isOpen={showVersionModal}
onClose={() => setShowVersionModal(false)}
releaseInfo={releaseInfo}
currentVersion={currentVersion}
latestVersion={latestVersion}
/>
</>
);
}

View File

@@ -4,7 +4,9 @@ import type { TFunction } from 'i18next';
import { Button } from '../ui/button';
import ProjectCreationWizard from '../ProjectCreationWizard';
import Settings from '../Settings';
import VersionUpgradeModal from '../modals/VersionUpgradeModal';
import type { Project } from '../../types/app';
import type { ReleaseInfo } from '../../types/sharedTypes';
import type { DeleteProjectConfirmation, SessionDeleteConfirmation } from './types';
type SidebarModalsProps = {
@@ -21,6 +23,11 @@ type SidebarModalsProps = {
sessionDeleteConfirmation: SessionDeleteConfirmation | null;
onCancelDeleteSession: () => void;
onConfirmDeleteSession: () => void;
showVersionModal: boolean;
onCloseVersionModal: () => void;
releaseInfo: ReleaseInfo | null;
currentVersion: string;
latestVersion: string | null;
t: TFunction;
};
@@ -38,6 +45,11 @@ export default function SidebarModals({
sessionDeleteConfirmation,
onCancelDeleteSession,
onConfirmDeleteSession,
showVersionModal,
onCloseVersionModal,
releaseInfo,
currentVersion,
latestVersion,
t,
}: SidebarModalsProps) {
return (
@@ -155,6 +167,14 @@ export default function SidebarModals({
</div>,
document.body,
)}
<VersionUpgradeModal
isOpen={showVersionModal}
onClose={onCloseVersionModal}
releaseInfo={releaseInfo}
currentVersion={currentVersion}
latestVersion={latestVersion}
/>
</>
);
}