e.stopPropagation()}
- >
- {/* Mobile close button - fixed top right */}
-
-
- {/* Mobile safe area spacer - top */}
-
-
- {children}
-
- {/* Mobile safe area spacer - bottom */}
-
+
)
}
- // Loading state
- if (isLoading) {
- return (
-
-
-
- )
- }
-
- // Error state
+ // Error or no config
if (error || !appConfig) {
return (
-
-
-
- 😕
-
-
{t('common.error')}
-
+
+
e.stopPropagation()}>
+
😕
+
{t('common.error')}
+
-
+
)
}
// No subscription
if (!appConfig.hasSubscription) {
return (
-
-
-
- 📱
-
-
{t('subscription.connection.title')}
-
{t('subscription.connection.noSubscription')}
-
+
+
e.stopPropagation()}>
+
📱
+
{t('subscription.connection.title')}
+
{t('subscription.connection.noSubscription')}
+
-
- )
- }
-
- // App selector view
- if (showAppSelector || !selectedApp) {
- return (
-
- {/* Header */}
-
-
- {selectedApp && (
-
- )}
-
-
{t('subscription.connection.selectApp')}
-
{t('subscription.connection.selectDevice')}
-
-
-
-
-
- {/* Apps by platform */}
-
- {allAppsForSelector.map(({ platform, apps }) => {
- const IconComponent = platformIconComponents[platform]
- const isCurrentPlatform = platform === detectedPlatform
- return (
-
-
-
- {IconComponent && }
-
-
- {getPlatformName(platform)}
- {isCurrentPlatform && ({t('subscription.connection.yourDevice')})}
-
-
-
- {apps.map((app) => (
-
- ))}
-
-
- )
- })}
-
-
- {/* Copy link */}
-
-
-
-
- )
- }
-
- // App instructions (main view)
- return (
-
- {/* Header with app info and change button */}
-
-
-
+ )
+ }
- {/* Instructions */}
-
- {/* Step 1: Install */}
- {selectedApp.installationStep && (
-
-
-
1
+ // App selector dropdown
+ if (showAppSelector) {
+ return (
+
+
e.stopPropagation()}
+ >
+ {/* Handle bar for mobile */}
+ {mobile &&
}
+
+ {/* Header */}
+
+
{t('subscription.connection.selectApp')}
+
+
+
+ {/* Apps list */}
+
+ {allApps.map(app => (
+
+ ))}
+
+
+
+ )
+ }
+
+ // Main view - Instructions
+ return (
+
+
e.stopPropagation()}
+ >
+ {/* Handle bar for mobile */}
+ {mobile &&
}
+
+ {/* Header with app selector */}
+
+
+ {!mobile && (
+
+ )}
+
+
+ {/* Content */}
+
+ {/* Step 1: Install (compact) */}
+ {selectedApp?.installationStep && (
+
+
1
-
{t('subscription.connection.installApp')}
-
+
{getLocalizedText(selectedApp.installationStep.description)}
- {selectedApp.installationStep.buttons && selectedApp.installationStep.buttons.length > 0 && (
-
- {selectedApp.installationStep.buttons
- .filter((btn) => isValidExternalUrl(btn.buttonLink))
- .map((btn, idx) => (
+ {selectedApp.installationStep.buttons?.length > 0 && (
+
-
- )}
+ )}
- {/* Step 2: Add subscription */}
- {selectedApp.addSubscriptionStep && (
-
-
-
2
-
-
{t('subscription.connection.addSubscription')}
-
+ {/* Step 2: Connect (main action) */}
+ {selectedApp?.addSubscriptionStep && (
+
+
2
+
+
{getLocalizedText(selectedApp.addSubscriptionStep.description)}
-
- {selectedApp.deepLink && (
-
- )}
+ {selectedApp.deepLink && (
-
+ )}
+
-
- )}
+ )}
- {/* Step 3: Connect */}
- {selectedApp.connectAndUseStep && (
-
-
-
3
-
-
{t('subscription.connection.connectVpn')}
-
- {getLocalizedText(selectedApp.connectAndUseStep.description)}
-
-
+ {/* Step 3: Ready (minimal) */}
+ {selectedApp?.connectAndUseStep && (
+
+
3
+
{getLocalizedText(selectedApp.connectAndUseStep.description)}
-
- )}
+ )}
+
-
- {/* Footer - hidden on mobile since we have close button on top */}
-
-
-
-
+
)
}