Refactor ConnectionModal and TopUpModal: reintroduce app selector logic in ConnectionModal, implement body scroll locking in TopUpModal, and adjust modal styling for improved responsiveness and user experience.

This commit is contained in:
PEDZEO
2026-01-20 03:30:22 +03:00
parent 275fe811bb
commit 023a1d2ce7
2 changed files with 31 additions and 20 deletions

View File

@@ -267,6 +267,19 @@ export default function ConnectionModal({ onClose }: ConnectionModalProps) {
return available
}, [appConfig, detectedPlatform])
// Get all apps for selector (must be before any conditional returns)
const allAppsForSelector = useMemo(() => {
if (!appConfig?.platforms) return []
const result: { platform: string; apps: AppInfo[] }[] = []
for (const platform of availablePlatforms) {
const apps = appConfig.platforms[platform]
if (apps?.length) {
result.push({ platform, apps })
}
}
return result
}, [appConfig, availablePlatforms])
const copySubscriptionLink = async () => {
if (!appConfig?.subscriptionUrl) return
try {
@@ -371,19 +384,6 @@ export default function ConnectionModal({ onClose }: ConnectionModalProps) {
)
}
// Get all apps for selector
const allAppsForSelector = useMemo(() => {
if (!appConfig?.platforms) return []
const result: { platform: string; apps: AppInfo[] }[] = []
for (const platform of availablePlatforms) {
const apps = appConfig.platforms[platform]
if (apps?.length) {
result.push({ platform, apps })
}
}
return result
}, [appConfig, availablePlatforms])
// App selector view
if (showAppSelector || !selectedApp) {
return (