5f574a765d
Add the VK Mini App logo next to the Telegram one on the landing hero,
linked via the new VITE_VK_APP_LINK build-arg (full URL, wired through
compose, CI and prod-deploy from TEST_/PROD_VITE_VK_APP_LINK).
Also restore the landing's Telegram link itself: commit 57c778f
collapsed the per-language vars to VITE_TELEGRAM_GAME_CHANNEL_NAME in
compose/CI but left gateway/Dockerfile with the stale _EN/_RU ARGs and
without the plain one, so the built bundle saw the var as undefined and
dead-code-eliminated the whole channel-link branch — deployed landings
(prod included) have shown no Telegram logo since.
28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
// Pure helpers for the public landing page, kept out of the Svelte component so the
|
|
// platform-entry link selection is unit-testable.
|
|
|
|
/**
|
|
* telegramChannelLink returns the t.me link for the single bot's game channel, or null
|
|
* when it is not configured. The channel username is a build-time var
|
|
* (VITE_TELEGRAM_GAME_CHANNEL_NAME) because the test and prod contours run different
|
|
* channels; it is the same channel the connector posts to via TELEGRAM_GAME_CHANNEL_ID
|
|
* (the id to post, the name to link). A leading "@" is tolerated.
|
|
*/
|
|
export function telegramChannelLink(): string | null {
|
|
const raw = import.meta.env.VITE_TELEGRAM_GAME_CHANNEL_NAME;
|
|
const name = (raw as string | undefined)?.trim().replace(/^@/, '');
|
|
return name ? `https://t.me/${name}` : null;
|
|
}
|
|
|
|
/**
|
|
* vkAppLink returns the VK Mini App link for the landing "Play on VK" entry, or null when it is
|
|
* not configured. The link is a build-time var (VITE_VK_APP_LINK, the full URL
|
|
* `https://vk.com/app<id>`) because the test and prod contours run the same VK app but the var
|
|
* mirrors the per-contour Telegram entries.
|
|
*/
|
|
export function vkAppLink(): string | null {
|
|
const raw = import.meta.env.VITE_VK_APP_LINK;
|
|
const link = (raw as string | undefined)?.trim();
|
|
return link ? link : null;
|
|
}
|