From 4866003c23be3a7c02bee5ac4b5c4246c928f192 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Thu, 5 Feb 2026 13:21:32 +0300 Subject: [PATCH] fix: unify connection page design with global styles and add platform SVG icons - Add svgIconKey to RemnawavePlatform and RemnawavePlatformData types - Render platform OS icons from svgLibrary in AdminApps tabs and Connection page - Replace platform dropdown with icon pill buttons on connection page - Use .card class with colored left border for block cards - Unify all back buttons with AdminBackButton pattern (border + bg) - Fix app chips and platform tabs to not blend with background (btn-secondary style) - Use accent outlined style for block action buttons matching original RemnaWave UI - Use btn-secondary for tutorial button --- src/api/adminApps.ts | 1 + src/pages/AdminApps.tsx | 30 +++++----- src/pages/Connection.tsx | 115 +++++++++++++++++++++++---------------- src/types/index.ts | 1 + 4 files changed, 88 insertions(+), 59 deletions(-) diff --git a/src/api/adminApps.ts b/src/api/adminApps.ts index e0ee75d..b661d7c 100644 --- a/src/api/adminApps.ts +++ b/src/api/adminApps.ts @@ -118,6 +118,7 @@ export interface RemnawaveApp { } export interface RemnawavePlatform { + svgIconKey?: string; apps: RemnawaveApp[]; } diff --git a/src/pages/AdminApps.tsx b/src/pages/AdminApps.tsx index fbdbdf0..7ab4b3c 100644 --- a/src/pages/AdminApps.tsx +++ b/src/pages/AdminApps.tsx @@ -440,19 +440,23 @@ export default function AdminApps() { {/* Platform Tabs */}
- {PLATFORMS.map((platform) => ( - - ))} + {PLATFORMS.map((platform) => { + const platformSvgKey = remnaWaveConfig?.platforms?.[platform]?.svgIconKey; + return ( + + ); + })}
{/* Apps List */} diff --git a/src/pages/Connection.tsx b/src/pages/Connection.tsx index e7554da..35cebee 100644 --- a/src/pages/Connection.tsx +++ b/src/pages/Connection.tsx @@ -335,21 +335,27 @@ export default function Connection() { } const isMobilePlatform = detectedPlatform === 'ios' || detectedPlatform === 'android'; - if (isMobilePlatform) { - window.location.href = resolved; - return; + + // Desktop: deep links need redirect page (browser can't handle custom schemes directly) + // Mobile: system browser handles custom schemes natively + const finalUrl = isMobilePlatform + ? resolved + : `${window.location.origin}/miniapp/redirect.html?url=${encodeURIComponent(resolved)}&lang=${i18n.language || 'en'}`; + + // In Telegram Mini App — sdkOpenLink opens URL in system browser, + // where custom URL schemes work (WebView itself can't handle them) + if (isTelegramWebApp) { + try { + sdkOpenLink(finalUrl, { tryInstantView: false }); + return; + } catch { + // SDK not available, fallback + } } - const redirectUrl = `${window.location.origin}/miniapp/redirect.html?url=${encodeURIComponent(resolved)}&lang=${i18n.language || 'en'}`; - try { - sdkOpenLink(redirectUrl, { tryInstantView: false }); - return; - } catch { - // SDK not available, fallback - } - window.location.href = redirectUrl; + window.location.href = finalUrl; }, - [detectedPlatform, i18n.language, resolveUrl], + [detectedPlatform, isTelegramWebApp, i18n.language, resolveUrl], ); const handleConnect = (app: AppInfo) => { @@ -442,12 +448,12 @@ export default function Connection() { // Main RemnaWave view — inline app chips + blocks return (
- {/* Header: title + platform dropdown */} + {/* Header */}
{!isTelegramWebApp && ( @@ -455,31 +461,47 @@ export default function Connection() {

{t('subscription.connection.title')}

- {/* Platform dropdown */} - {availablePlatforms.length > 1 && ( - - )}
+ {/* Platform tabs */} + {availablePlatforms.length > 1 && ( +
+ {availablePlatforms.map((p) => { + const isActive = p === currentPlatformKey; + const pData = appConfig.platforms[p]; + const svgIconKey = pData && isRemnawavePlatform(pData) ? pData.svgIconKey : undefined; + const platformSvg = getSvgHtml(svgIconKey); + return ( + + ); + })} +
+ )} + {/* App cards row */} {currentPlatformApps.length > 0 && (
@@ -493,7 +515,7 @@ export default function Connection() { className={`relative flex items-center gap-2 overflow-hidden rounded-xl px-3 py-2.5 text-sm font-medium transition-all active:scale-[0.97] ${ isSelected ? 'bg-accent-500/15 text-accent-400 ring-1 ring-accent-500/40' - : 'bg-dark-800/60 text-dark-300 hover:bg-dark-800' + : 'border border-dark-700/50 bg-dark-800/80 text-dark-200 hover:border-dark-600/50 hover:bg-dark-700/80' }`} > {app.featured && } @@ -516,7 +538,7 @@ export default function Connection() { href={appConfig.baseSettings.tutorialUrl} target="_blank" rel="noopener noreferrer" - className="flex items-center justify-center gap-2 rounded-xl border border-dark-600 px-4 py-2.5 text-sm font-medium text-dark-200 transition-all hover:bg-dark-800" + className="btn-secondary w-full justify-center" >
{/* SVG icon */} @@ -615,7 +638,7 @@ export default function Connection() { @@ -830,7 +853,7 @@ export default function Connection() { {!isTelegramWebApp && ( @@ -916,7 +939,7 @@ export default function Connection() { {!isTelegramWebApp && ( diff --git a/src/types/index.ts b/src/types/index.ts index 556d81a..222a7f8 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -529,6 +529,7 @@ export interface RemnawaveAppClient { } export interface RemnawavePlatformData { + svgIconKey?: string; apps: RemnawaveAppClient[]; }