Add direct verse navigation from search results

- Search results now navigate directly to specific verses using URL hash
- Clicking a search result takes you to the chapter and scrolls to the exact verse
- Matches the behavior of favorites navigation for consistent user experience
- URL format: /book/BookName/chapter/1#verse-5 for precise verse targeting
This commit is contained in:
Ryderjj89
2025-09-15 17:55:08 -04:00
parent b2096c67ae
commit 6894f1c871

View File

@@ -77,7 +77,9 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
// Handle result click
const handleResultClick = (result: SearchResult) => {
const urlBookName = getBookUrlName(formatBookName(result.book));
navigate(`/book/${urlBookName}/chapter/${result.chapter}`);
// Navigate to chapter with verse hash to scroll directly to the verse
const url = `/book/${urlBookName}/chapter/${result.chapter}#verse-${result.verse}`;
navigate(url);
if (onClose) onClose();
};