Remove standalone /[locale]/chat page; enhance FloatingChat with fullscreen toggle via Launch icon; add global event to open chat (optionally fullscreen); wire home buttons/cards to open modal instead of routing.
This commit is contained in:
@@ -39,7 +39,7 @@ export default function Home() {
|
||||
title: t('features.chat.title'),
|
||||
description: t('features.chat.description'),
|
||||
icon: <Chat sx={{ fontSize: 40, color: 'secondary.main' }} />,
|
||||
path: '/chat',
|
||||
path: '/__open-chat__',
|
||||
color: theme.palette.secondary.main,
|
||||
},
|
||||
{
|
||||
@@ -106,7 +106,9 @@ export default function Home() {
|
||||
},
|
||||
}}
|
||||
startIcon={<Chat />}
|
||||
onClick={() => router.push(`/${locale}/chat`)}
|
||||
onClick={() => {
|
||||
window.dispatchEvent(new CustomEvent('floating-chat:open', { detail: { fullscreen: true } }))
|
||||
}}
|
||||
>
|
||||
{t('hero.cta.askAI')}
|
||||
</Button>
|
||||
@@ -152,7 +154,13 @@ export default function Home() {
|
||||
boxShadow: 4,
|
||||
},
|
||||
}}
|
||||
onClick={() => router.push(`/${locale}${feature.path}`)}
|
||||
onClick={() => {
|
||||
if (feature.path === '/__open-chat__') {
|
||||
window.dispatchEvent(new CustomEvent('floating-chat:open', { detail: { fullscreen: true } }))
|
||||
} else {
|
||||
router.push(`/${locale}${feature.path}`)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<CardContent sx={{
|
||||
flexGrow: 1,
|
||||
@@ -238,4 +246,4 @@ export default function Home() {
|
||||
</Container>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user