Skip to content

Commit a642b2d

Browse files
committed
feat(demo): add 'Exit demo' link to banner → health-assistant.io
The DemoBanner now carries an 'Exit demo ↗' pill (right-aligned) that opens https://health-assistant.io in a new tab, letting visitors leave the sandbox for the real product site. Layout switches to justify-between so the synthetic-data message stays centered. On mobile the label collapses to the external-link icon only. i18n keys (en/el) added.
1 parent e4622b5 commit a642b2d

3 files changed

Lines changed: 27 additions & 10 deletions

File tree

frontend/src/components/layout/DemoBanner.tsx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { useTranslation } from 'react-i18next';
2-
import { FlaskConical } from 'lucide-react';
2+
import { FlaskConical, ExternalLink } from 'lucide-react';
33
import { useAuthStore } from '../../store/slices/authSlice';
44

5+
const MAIN_SITE_URL = 'https://health-assistant.io';
6+
57
/**
68
* A fixed banner that appears at the top of the screen while the instance is
79
* running in demo mode (DEMO_MODE=true). Pinned and non-dismissable — anyone
810
* who is signed in got here through the credential-free /auth/demo-login
9-
* flow, so the banner must always make that clear. Mirrors the
10-
* TenantSwitchBanner pattern.
11+
* flow, so the banner must always make that clear. An "Exit demo" link on the
12+
* right opens the main product site so visitors can leave the sandbox.
13+
* Mirrors the TenantSwitchBanner pattern.
1114
*/
1215
function DemoBanner() {
1316
const { t } = useTranslation();
@@ -17,14 +20,26 @@ function DemoBanner() {
1720

1821
return (
1922
<div className="bg-blue-600 text-white shadow-sm print:hidden shrink-0">
20-
<div className="max-w-7xl mx-auto px-4 py-1.5 flex items-center justify-center gap-2">
21-
<FlaskConical className="w-4 h-4 shrink-0" />
22-
<span className="text-xs sm:text-sm font-semibold truncate text-center">
23-
{t('common.demo_banner', 'Demo mode')}
24-
<span className="hidden sm:inline opacity-80 font-normal">
25-
{' '}{t('common.demo_banner_hint', '— data is synthetic and reset periodically. Do not store real health information.')}
23+
<div className="max-w-7xl mx-auto px-4 py-1.5 flex items-center justify-between gap-4">
24+
<div className="flex items-center gap-2 min-w-0 justify-center flex-1">
25+
<FlaskConical className="w-4 h-4 shrink-0" />
26+
<span className="text-xs sm:text-sm font-semibold truncate text-center">
27+
{t('common.demo_banner', 'Demo mode')}
28+
<span className="hidden sm:inline opacity-80 font-normal">
29+
{' '}{t('common.demo_banner_hint', '— data is synthetic and reset periodically. Do not store real health information.')}
30+
</span>
2631
</span>
27-
</span>
32+
</div>
33+
<a
34+
href={MAIN_SITE_URL}
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/15 hover:bg-white/25 transition-colors text-xs font-bold uppercase tracking-wide shrink-0"
38+
title={MAIN_SITE_URL}
39+
>
40+
<span className="hidden sm:inline">{t('common.demo_exit', 'Exit demo')}</span>
41+
<ExternalLink className="w-3.5 h-3.5" />
42+
</a>
2843
</div>
2944
</div>
3045
);

frontend/src/locales/el/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"logout": "Αποσύνδεση",
1010
"demo_banner": "Λειτουργία επίδειξης",
1111
"demo_banner_hint": "— τα δεδομένα είναι σύνθετα και επαναφέρονται περιοδικά. Μην αποθηκεύετε πραγματικά δεδομένα υγείας.",
12+
"demo_exit": "Έξοδος επίδειξης",
1213
"search": "Αναζήτηση...",
1314
"back": "Πίσω",
1415
"save": "Αποθήκευση",

frontend/src/locales/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"logout": "Logout",
1010
"demo_banner": "Demo mode",
1111
"demo_banner_hint": "— data is synthetic and reset periodically. Do not store real health information.",
12+
"demo_exit": "Exit demo",
1213
"search": "Search...",
1314
"back": "Back",
1415
"save": "Save",

0 commit comments

Comments
 (0)