feat: Apple-style donation-focused landing page + Azure OpenAI fixes
Major updates: - Replace homepage with clean, minimalist Apple-style landing page - Focus on donation messaging and mission statement - Add comprehensive AI chat analysis documentation - Fix Azure OpenAI configuration with correct endpoints - Update embedding API to use text-embedding-ada-002 (1536 dims) Landing Page Features: - Hero section with tagline "Every Scripture. Every Language. Forever Free" - Mission statement emphasizing free access - Matthew 10:8 verse highlight - 6 feature cards (Global Library, Multilingual, Prayer Wall, AI Chat, Privacy, Offline) - Donation CTA sections with PayPal and card options - "Why It Matters" section with dark background - Clean footer with navigation links Technical Changes: - Updated .env.local with new Azure credentials - Fixed vector-search.ts to support separate embed API version - Integrated AuthModal into Bible reader and prayers page - Made prayer filters collapsible and mobile-responsive - Changed language picker to single-select Documentation Created: - AI_CHAT_FIX_PLAN.md - Comprehensive implementation plan - AI_CHAT_VERIFICATION_FINDINGS.md - Database analysis - AI_CHAT_ANALYSIS_SUMMARY.md - Executive summary - AI_CHAT_STATUS_UPDATE.md - Current status and next steps - logo.svg - App logo (MenuBook icon) Build: ✅ Successful (Next.js 15.5.3) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import { OfflineBibleReader } from '@/components/bible/offline-bible-reader'
|
||||
import { offlineStorage } from '@/lib/offline-storage'
|
||||
import { InstallPrompt, useInstallPrompt } from '@/components/pwa/install-prompt'
|
||||
import { useSwipeable } from 'react-swipeable'
|
||||
import { AuthModal } from '@/components/auth/auth-modal'
|
||||
import {
|
||||
Box,
|
||||
Typography,
|
||||
@@ -315,6 +316,11 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
verse: null
|
||||
})
|
||||
|
||||
// Auth modal state
|
||||
const [authModalOpen, setAuthModalOpen] = useState(false)
|
||||
const [authModalMessage, setAuthModalMessage] = useState<string>('')
|
||||
const [pendingAction, setPendingAction] = useState<(() => void) | null>(null)
|
||||
|
||||
// Refs
|
||||
const contentRef = useRef<HTMLDivElement>(null)
|
||||
const verseRefs = useRef<{[key: number]: HTMLDivElement}>({})
|
||||
@@ -990,6 +996,26 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
}
|
||||
}
|
||||
|
||||
const requireAuth = (action: () => void, message: string) => {
|
||||
if (!user) {
|
||||
setAuthModalMessage(message)
|
||||
setPendingAction(() => action)
|
||||
setAuthModalOpen(true)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const handleAuthSuccess = () => {
|
||||
setAuthModalOpen(false)
|
||||
setAuthModalMessage('')
|
||||
// Execute pending action if there is one
|
||||
if (pendingAction) {
|
||||
pendingAction()
|
||||
setPendingAction(null)
|
||||
}
|
||||
}
|
||||
|
||||
const handlePreviousChapter = () => {
|
||||
// Trigger transition animation
|
||||
setIsTransitioning(true)
|
||||
@@ -1077,9 +1103,8 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
const handleChapterBookmark = async () => {
|
||||
if (!selectedBook || !selectedChapter) return
|
||||
|
||||
// If user is not authenticated, redirect to login
|
||||
if (!user) {
|
||||
router.push(`/${locale}/login?redirect=${encodeURIComponent(`/${locale}/bible?version=${selectedVersion}&book=${selectedBook}&chapter=${selectedChapter}`)}`)
|
||||
// If user is not authenticated, show auth modal
|
||||
if (!requireAuth(handleChapterBookmark, 'Please login to bookmark this chapter')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1123,9 +1148,8 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
}
|
||||
|
||||
const handleVerseBookmark = async (verse: BibleVerse) => {
|
||||
// If user is not authenticated, redirect to login
|
||||
if (!user) {
|
||||
router.push(`/${locale}/login?redirect=${encodeURIComponent(`/${locale}/bible?version=${selectedVersion}&book=${selectedBook}&chapter=${selectedChapter}&verse=${verse.verseNum}`)}`)
|
||||
// If user is not authenticated, show auth modal
|
||||
if (!requireAuth(() => handleVerseBookmark(verse), 'Please login to bookmark this verse')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1184,9 +1208,8 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
}
|
||||
|
||||
const handleVerseChat = (verse: BibleVerse) => {
|
||||
// If user is not authenticated, redirect to login
|
||||
if (!user) {
|
||||
router.push(`/${locale}/login?redirect=${encodeURIComponent(`/${locale}/bible?version=${selectedVersion}&book=${selectedBook}&chapter=${selectedChapter}&verse=${verse.verseNum}`)}`)
|
||||
// If user is not authenticated, show auth modal
|
||||
if (!requireAuth(() => handleVerseChat(verse), 'Please login to ask AI about this verse')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1255,9 +1278,8 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
}
|
||||
|
||||
const handleHighlightVerse = async (verse: BibleVerse, color: TextHighlight['color']) => {
|
||||
// If user is not authenticated, redirect to login
|
||||
if (!user) {
|
||||
router.push(`/${locale}/login?redirect=${encodeURIComponent(`/${locale}/bible?version=${selectedVersion}&book=${selectedBook}&chapter=${selectedChapter}&verse=${verse.verseNum}`)}`)
|
||||
// If user is not authenticated, show auth modal
|
||||
if (!requireAuth(() => handleHighlightVerse(verse, color), 'Please login to highlight this verse')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1397,8 +1419,8 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
}
|
||||
|
||||
const handleSetFavoriteVersion = async () => {
|
||||
if (!user) {
|
||||
router.push(`/${locale}/login?redirect=${encodeURIComponent(`/${locale}/bible?version=${selectedVersion}&book=${selectedBook}&chapter=${selectedChapter}`)}`)
|
||||
// If user is not authenticated, show auth modal
|
||||
if (!requireAuth(handleSetFavoriteVersion, 'Please login to set your default Bible version')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2667,6 +2689,19 @@ export default function BibleReaderNew({ initialVersion, initialBook, initialCha
|
||||
{copyFeedback.message}
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
|
||||
{/* Auth Modal */}
|
||||
<AuthModal
|
||||
open={authModalOpen}
|
||||
onClose={() => {
|
||||
setAuthModalOpen(false)
|
||||
setAuthModalMessage('')
|
||||
setPendingAction(null)
|
||||
}}
|
||||
onSuccess={handleAuthSuccess}
|
||||
message={authModalMessage}
|
||||
defaultTab="login"
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user