From 5ec48cd2b20843c23650a57a886cf117157675f0 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 11 Nov 2025 20:43:51 +0000 Subject: [PATCH] fix: resolve critical MVP issues - search bar overlap and language selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix search bar covering main menu: removed fixed positioning from header and use flex layout instead - Fix Bible not displaying in selected language: pass locale parameter to /api/bible/books endpoint - Add locale dependency to loadBooks useEffect so Bible content updates when language changes These fixes make the MVP fully usable for all languages (en, ro, es, it). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/bible/bible-reader-app.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/components/bible/bible-reader-app.tsx b/components/bible/bible-reader-app.tsx index 5d464be..a2e6f8f 100644 --- a/components/bible/bible-reader-app.tsx +++ b/components/bible/bible-reader-app.tsx @@ -1,5 +1,6 @@ 'use client' import { useState, useEffect } from 'react' +import { useLocale } from 'next-intl' import { Box, Typography, Button } from '@mui/material' import { BibleChapter, BibleVerse } from '@/types' import { getCachedChapter, cacheChapter } from '@/lib/cache-manager' @@ -17,6 +18,7 @@ interface BookInfo { } export function BibleReaderApp() { + const locale = useLocale() const [bookId, setBookId] = useState(1) // Genesis (numeric ID from search) const [chapter, setChapter] = useState(1) const [currentChapter, setCurrentChapter] = useState(null) @@ -30,10 +32,10 @@ export function BibleReaderApp() { const [error, setError] = useState(null) const [booksLoading, setBooksLoading] = useState(true) - // Load books on mount + // Load books on mount or when locale changes useEffect(() => { loadBooks() - }, []) + }, [locale]) // Load chapter when bookId or chapter changes useEffect(() => { @@ -47,7 +49,7 @@ export function BibleReaderApp() { setError(null) try { - const response = await fetch('/api/bible/books') + const response = await fetch(`/api/bible/books?locale=${locale}`) if (!response.ok) { throw new Error(`Failed to load books: ${response.status}`) } @@ -167,18 +169,14 @@ export function BibleReaderApp() { } return ( - + {/* Header with search */} {/* Reading area */} - + {!booksLoading && error ? ( {error}