Fix logo loading and URL parameter persistence
Backend: - Added static file serving for /logos directory - Logos now accessible at /logos/path for Docker builds Frontend: - Updated all navigation to include version parameters (?version=esv|?version=nkjv) - Book selection includes version in URL - Breadcrumb navigation preserves version context - URLs now work for bookmarking and sharing with version information Complete fix for both logo display and navigation URL persistence.
This commit is contained in:
@@ -32,6 +32,9 @@ configureAuth(app);
|
||||
// Serve static files from the React build
|
||||
app.use(express.static(path.join(__dirname, '../../frontend/build')));
|
||||
|
||||
// Serve logos folder as static files
|
||||
app.use('/logos', express.static(path.join(__dirname, '../../frontend/logos')));
|
||||
|
||||
// Bible data directories
|
||||
const ESV_DATA_DIR = path.join(__dirname, '../../bible-data'); // ESV from mdbible
|
||||
const NKJV_DATA_DIR = path.join(__dirname, '../../NKJV'); // NKJV local files
|
||||
|
||||
@@ -269,7 +269,8 @@ function App() {
|
||||
|
||||
const handleBookSelect = (book: string) => {
|
||||
const urlName = getBookUrlName(book);
|
||||
navigate(`/book/${urlName}`);
|
||||
const url = selectedVersion ? `/book/${urlName}?version=${selectedVersion}` : `/book/${urlName}`;
|
||||
navigate(url);
|
||||
};
|
||||
|
||||
const handleFavoriteChange = () => {
|
||||
@@ -426,7 +427,10 @@ function App() {
|
||||
{currentBook && (
|
||||
<>
|
||||
<button
|
||||
onClick={() => navigate('/')}
|
||||
onClick={() => {
|
||||
const url = selectedVersion ? `/?version=${selectedVersion}` : '/';
|
||||
navigate(url);
|
||||
}}
|
||||
className="hover:text-blue-600 dark:hover:text-blue-400"
|
||||
>
|
||||
Books
|
||||
@@ -439,7 +443,10 @@ function App() {
|
||||
<>
|
||||
<ChevronRight className="h-4 w-4" />
|
||||
<button
|
||||
onClick={() => navigate(`/book/${currentBook}`)}
|
||||
onClick={() => {
|
||||
const url = selectedVersion ? `/book/${currentBook}?version=${selectedVersion}` : `/book/${currentBook}`;
|
||||
navigate(url);
|
||||
}}
|
||||
className="hover:text-blue-600 dark:hover:text-blue-400"
|
||||
>
|
||||
Chapters
|
||||
|
||||
Reference in New Issue
Block a user