Implement comprehensive homepage enhancements and floating chat improvements
- Add dynamic date and year generation replacing static 2024 values - Implement "Discuss this verse" feature with AI chat integration - Fix translation key conflicts by merging duplicate hero objects - Update Romanian translations with improved messaging - Enhance floating chat to support initial messages via events - Fix FORMATTING_ERROR for liveCounter with proper next-intl syntax 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,28 @@ export default function Home() {
|
|||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
// Generate current date and year
|
||||||
|
const getCurrentDate = () => {
|
||||||
|
const now = new Date()
|
||||||
|
if (locale === 'ro') {
|
||||||
|
return now.toLocaleDateString('ro-RO', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return now.toLocaleDateString('en-US', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurrentYear = () => {
|
||||||
|
return new Date().getFullYear()
|
||||||
|
}
|
||||||
|
|
||||||
const features = [
|
const features = [
|
||||||
{
|
{
|
||||||
title: t('features.bible.title'),
|
title: t('features.bible.title'),
|
||||||
@@ -113,7 +135,7 @@ export default function Home() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Box sx={{ mb: 4, p: 2, bgcolor: 'rgba(255,255,255,0.1)', borderRadius: 2 }}>
|
<Box sx={{ mb: 4, p: 2, bgcolor: 'rgba(255,255,255,0.1)', borderRadius: 2 }}>
|
||||||
<Typography variant="body2" sx={{ opacity: 0.9 }}>
|
<Typography variant="body2" sx={{ opacity: 0.9 }}>
|
||||||
{t('hero.liveCounter').replace('{count}', userCount.toLocaleString())}
|
{t('hero.liveCounter', { count: userCount.toLocaleString() })}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
||||||
@@ -206,7 +228,7 @@ export default function Home() {
|
|||||||
{t('dailyVerse.title')}
|
{t('dailyVerse.title')}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2" textAlign="center" sx={{ mb: 4, opacity: 0.9 }}>
|
<Typography variant="body2" textAlign="center" sx={{ mb: 4, opacity: 0.9 }}>
|
||||||
{t('dailyVerse.date')}
|
{getCurrentDate()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Paper sx={{ p: 4, textAlign: 'center', bgcolor: 'rgba(255,255,255,0.95)', color: 'text.primary', borderRadius: 3 }}>
|
<Paper sx={{ p: 4, textAlign: 'center', bgcolor: 'rgba(255,255,255,0.95)', color: 'text.primary', borderRadius: 3 }}>
|
||||||
@@ -219,7 +241,23 @@ export default function Home() {
|
|||||||
|
|
||||||
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'center', mt: 3 }}>
|
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'center', mt: 3 }}>
|
||||||
<Tooltip title={t('dailyVerse.discuss')}>
|
<Tooltip title={t('dailyVerse.discuss')}>
|
||||||
<IconButton color="primary">
|
<IconButton
|
||||||
|
color="primary"
|
||||||
|
onClick={() => {
|
||||||
|
const verseText = t('dailyVerse.verse')
|
||||||
|
const reference = t('dailyVerse.reference')
|
||||||
|
const discussMessage = locale === 'ro'
|
||||||
|
? `Poți să îmi explici mai mult despre acest verset: "${verseText}" (${reference})?`
|
||||||
|
: `Can you explain more about this verse: "${verseText}" (${reference})?`
|
||||||
|
|
||||||
|
window.dispatchEvent(new CustomEvent('floating-chat:open', {
|
||||||
|
detail: {
|
||||||
|
fullscreen: true,
|
||||||
|
initialMessage: discussMessage
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}}
|
||||||
|
>
|
||||||
<QuestionAnswer />
|
<QuestionAnswer />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -629,7 +667,7 @@ export default function Home() {
|
|||||||
|
|
||||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 2 }}>
|
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 2 }}>
|
||||||
<Typography variant="body2" color="grey.400">
|
<Typography variant="body2" color="grey.400">
|
||||||
{t('footer.copyright')}
|
© {getCurrentYear()} {locale === 'ro' ? 'Ghid Biblic - Făcut cu ❤️ și 🙏' : 'Biblical Guide - Made with ❤️ and 🙏'}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap' }}>
|
<Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap' }}>
|
||||||
<Chip label="🇷🇴 Română" size="small" variant="outlined" sx={{ color: 'white', borderColor: 'grey.600' }} />
|
<Chip label="🇷🇴 Română" size="small" variant="outlined" sx={{ color: 'white', borderColor: 'grey.600' }} />
|
||||||
|
|||||||
@@ -70,13 +70,14 @@ export default function FloatingChat() {
|
|||||||
scrollToBottom()
|
scrollToBottom()
|
||||||
}, [messages])
|
}, [messages])
|
||||||
|
|
||||||
// Allow external triggers to open the chat (optionally fullscreen)
|
// Allow external triggers to open the chat (optionally fullscreen and with initial message)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handler = (e: Event) => {
|
const handler = (e: Event) => {
|
||||||
const detail = (e as CustomEvent).detail || {}
|
const detail = (e as CustomEvent).detail || {}
|
||||||
setIsOpen(true)
|
setIsOpen(true)
|
||||||
setIsMinimized(false)
|
setIsMinimized(false)
|
||||||
if (typeof detail.fullscreen === 'boolean') setIsFullscreen(detail.fullscreen)
|
if (typeof detail.fullscreen === 'boolean') setIsFullscreen(detail.fullscreen)
|
||||||
|
if (typeof detail.initialMessage === 'string') setInputMessage(detail.initialMessage)
|
||||||
}
|
}
|
||||||
window.addEventListener('floating-chat:open', handler as EventListener)
|
window.addEventListener('floating-chat:open', handler as EventListener)
|
||||||
return () => window.removeEventListener('floating-chat:open', handler as EventListener)
|
return () => window.removeEventListener('floating-chat:open', handler as EventListener)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
"subtitle": "Experience our AI assistant immediately without any sign-up required",
|
"subtitle": "Experience our AI assistant immediately without any sign-up required",
|
||||||
"userQuestion": "What does the Bible say about hope?",
|
"userQuestion": "What does the Bible say about hope?",
|
||||||
"aiResponse": "The Bible offers many encouraging verses about hope. Romans 15:13 says 'May the God of hope fill you with all joy and peace...'",
|
"aiResponse": "The Bible offers many encouraging verses about hope. Romans 15:13 says 'May the God of hope fill you with all joy and peace...'",
|
||||||
"tryButton": "Try It Yourself - No Sign Up Required"
|
"tryButton": "Try it yourself"
|
||||||
},
|
},
|
||||||
"dailyVerse": {
|
"dailyVerse": {
|
||||||
"title": "Today's Verse",
|
"title": "Today's Verse",
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
"cta": {
|
"cta": {
|
||||||
"readBible": "Începe să citești",
|
"readBible": "Începe să citești",
|
||||||
"askAI": "Întreabă AI"
|
"askAI": "Întreabă AI"
|
||||||
}
|
},
|
||||||
|
"liveCounter": "Alătură-te la {count} credincioși care studiază Cuvântul lui Dumnezeu chiar acum"
|
||||||
},
|
},
|
||||||
"features": {
|
"features": {
|
||||||
"title": "Descoperă funcționalitățile",
|
"title": "Descoperă funcționalitățile",
|
||||||
@@ -71,15 +72,12 @@
|
|||||||
"description": "Alătură-te comunității noastre și descoperă înțelepciunea Scripturii",
|
"description": "Alătură-te comunității noastre și descoperă înțelepciunea Scripturii",
|
||||||
"startNow": "Începe acum"
|
"startNow": "Începe acum"
|
||||||
},
|
},
|
||||||
"hero": {
|
|
||||||
"liveCounter": "Alătură-te la {count} credincioși care studiază Cuvântul lui Dumnezeu chiar acum"
|
|
||||||
},
|
|
||||||
"demo": {
|
"demo": {
|
||||||
"title": "Vezi în Acțiune",
|
"title": "Vezi în Acțiune",
|
||||||
"subtitle": "Experimentează asistentul nostru AI imediat, fără să te înregistrezi",
|
"subtitle": "Experimentează asistentul nostru AI imediat, fără să te înregistrezi",
|
||||||
"userQuestion": "Ce spune Biblia despre speranță?",
|
"userQuestion": "Ce spune Biblia despre speranță?",
|
||||||
"aiResponse": "Biblia oferă multe versete încurajatoare despre speranță. Romani 15:13 spune: 'Să vă umple Dumnezeul speranței cu toată bucuria și pacea...'",
|
"aiResponse": "Biblia oferă multe versete încurajatoare despre speranță. Romani 15:13 spune: 'Să vă umple Dumnezeul speranței cu toată bucuria și pacea...'",
|
||||||
"tryButton": "Încearcă Singur - Fără Înregistrare"
|
"tryButton": "Încearcă și tu"
|
||||||
},
|
},
|
||||||
"dailyVerse": {
|
"dailyVerse": {
|
||||||
"title": "Versetul de Astăzi",
|
"title": "Versetul de Astăzi",
|
||||||
@@ -89,11 +87,11 @@
|
|||||||
"discuss": "Discută Acest Verset",
|
"discuss": "Discută Acest Verset",
|
||||||
"save": "Salvează",
|
"save": "Salvează",
|
||||||
"share": "Partajează",
|
"share": "Partajează",
|
||||||
"tomorrow": "Mâine: Primește versete zilnice în inbox-ul tău",
|
"tomorrow": "Primește versete zilnice în inbox-ul tău",
|
||||||
"subscribe": "Abonează-te"
|
"subscribe": "Abonează-te"
|
||||||
},
|
},
|
||||||
"howItWorks": {
|
"howItWorks": {
|
||||||
"title": "Începe Călătoria Ta Biblică",
|
"title": "Începe Călătoria Ta Acum",
|
||||||
"subtitle": "Trei pași simpli pentru a-ți aprofunda credința",
|
"subtitle": "Trei pași simpli pentru a-ți aprofunda credința",
|
||||||
"step1": {
|
"step1": {
|
||||||
"title": "Pune Orice Întrebare",
|
"title": "Pune Orice Întrebare",
|
||||||
@@ -119,12 +117,12 @@
|
|||||||
"time3": "acum 1 oră",
|
"time3": "acum 1 oră",
|
||||||
"praying": "Se roagă",
|
"praying": "Se roagă",
|
||||||
"celebrating": "Sărbătoresc",
|
"celebrating": "Sărbătoresc",
|
||||||
"shareRequest": "Partajează Cererea Ta de Rugăciune",
|
"shareRequest": "Adaugă o rugăciune nouă",
|
||||||
"viewAll": "Vezi Toate Rugăciunile"
|
"viewAll": "Vezi Toate Rugăciunile"
|
||||||
},
|
},
|
||||||
"testimonials": {
|
"testimonials": {
|
||||||
"title": "Povești Reale din Comunitatea Noastră",
|
"title": "Povești Reale din Comunitatea Noastră",
|
||||||
"subtitle": "Ascultă cum platforma noastră a atins vieți din întreaga lume",
|
"subtitle": "Vezi cum platforma noastră a atins viețile credincioșilor",
|
||||||
"testimonial1": {
|
"testimonial1": {
|
||||||
"name": "Maria S.",
|
"name": "Maria S.",
|
||||||
"role": "Mamă a doi copii | Folosește de 3 luni",
|
"role": "Mamă a doi copii | Folosește de 3 luni",
|
||||||
|
|||||||
Reference in New Issue
Block a user