diff --git a/server/shell.ts b/server/shell.ts index d4f2318..e3b808f 100644 --- a/server/shell.ts +++ b/server/shell.ts @@ -45,6 +45,10 @@ export function renderShell(opts: ShellOptions): string { } = opts; const moduleListJSON = JSON.stringify(modules); + const currentMod = modules.find((m) => m.id === moduleId); + const shellDemoUrl = currentMod?.standaloneDomain + ? `https://${escapeAttr(currentMod.standaloneDomain)}` + : `https://demo.rspace.online/${escapeAttr(moduleId)}`; return ` @@ -78,7 +82,7 @@ export function renderShell(opts: ShellOptions): string {
- Try Demo + Try Demo
@@ -424,10 +428,13 @@ export interface ModuleLandingOptions { export function renderModuleLanding(opts: ModuleLandingOptions): string { const { module: mod, modules, theme = "dark" } = opts; const moduleListJSON = JSON.stringify(modules); - const demoUrl = `https://demo.rspace.online/${mod.id}`; + // Prefer standalone domain for demo (better styling, more updated features) + const demoUrl = mod.standaloneDomain + ? `https://${mod.standaloneDomain}` + : `https://demo.rspace.online/${mod.id}`; const standaloneLinkHtml = mod.standaloneDomain - ? `Also available at ${escapeHtml(mod.standaloneDomain)} ↗` + ? `Also available inside rSpace demo ↗` : ""; let feedsHtml = ""; diff --git a/shared/components/rstack-app-switcher.ts b/shared/components/rstack-app-switcher.ts index 0d4bdd3..c9510b1 100644 --- a/shared/components/rstack-app-switcher.ts +++ b/shared/components/rstack-app-switcher.ts @@ -188,10 +188,19 @@ export class RStackAppSwitcher extends HTMLElement { ? `${badgeInfo.badge}` : `${m.icon}`; + const space = this.#getSpaceSlug(); + // On demo (bare domain or demo subdomain): link to landing pages + const host = window.location.host.split(":")[0]; + const onRspace = host.includes("rspace.online"); + const href = + onRspace && space === "demo" + ? `${window.location.protocol}//rspace.online/${m.id}` + : rspaceNavUrl(space, m.id); + return `
${badgeHtml}