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:
@@ -77,7 +77,9 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
|
|||||||
// Handle result click
|
// Handle result click
|
||||||
const handleResultClick = (result: SearchResult) => {
|
const handleResultClick = (result: SearchResult) => {
|
||||||
const urlBookName = getBookUrlName(formatBookName(result.book));
|
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();
|
if (onClose) onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user