Skip to content

Commit 8d6c4c9

Browse files
committed
Chore: Update domain to saileelarahasya.com and optimize images/hooks
1 parent 4596f5c commit 8d6c4c9

9 files changed

Lines changed: 48 additions & 57 deletions

File tree

web/src/app/(main)/bodhakatha/[articleId]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default async function BodhakathaDetailPage({ params }: { params: Promise
7171
"name": "Saileela Rahasya",
7272
"logo": {
7373
"@type": "ImageObject",
74-
"url": "https://saileelarahasya-web.vercel.app/icon-512.png"
74+
"url": "https://saileelarahasya.com/icon-512.png"
7575
}
7676
},
7777
"description": article.description.substring(0, 160)
@@ -85,19 +85,19 @@ export default async function BodhakathaDetailPage({ params }: { params: Promise
8585
"@type": "ListItem",
8686
"position": 1,
8787
"name": "Home",
88-
"item": "https://saileelarahasya-web.vercel.app"
88+
"item": "https://saileelarahasya.com"
8989
},
9090
{
9191
"@type": "ListItem",
9292
"position": 2,
9393
"name": "Bodhakatha",
94-
"item": "https://saileelarahasya-web.vercel.app/bodhakatha"
94+
"item": "https://saileelarahasya.com/bodhakatha"
9595
},
9696
{
9797
"@type": "ListItem",
9898
"position": 3,
9999
"name": article.title_english,
100-
"item": `https://saileelarahasya-web.vercel.app/bodhakatha/${articleId}`
100+
"item": `https://saileelarahasya.com/bodhakatha/${articleId}`
101101
}
102102
]
103103
};

web/src/app/(main)/leela/[articleId]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default async function LeelaDetailPage({ params }: { params: Promise<{ ar
7171
"name": "Saileela Rahasya",
7272
"logo": {
7373
"@type": "ImageObject",
74-
"url": "https://saileelarahasya-web.vercel.app/icon-512.png"
74+
"url": "https://saileelarahasya.com/icon-512.png"
7575
}
7676
},
7777
"description": article.description.substring(0, 160)
@@ -85,19 +85,19 @@ export default async function LeelaDetailPage({ params }: { params: Promise<{ ar
8585
"@type": "ListItem",
8686
"position": 1,
8787
"name": "Home",
88-
"item": "https://saileelarahasya-web.vercel.app"
88+
"item": "https://saileelarahasya.com"
8989
},
9090
{
9191
"@type": "ListItem",
9292
"position": 2,
9393
"name": "Leela",
94-
"item": "https://saileelarahasya-web.vercel.app/leela"
94+
"item": "https://saileelarahasya.com/leela"
9595
},
9696
{
9797
"@type": "ListItem",
9898
"position": 3,
9999
"name": article.title_english,
100-
"item": `https://saileelarahasya-web.vercel.app/leela/${articleId}`
100+
"item": `https://saileelarahasya.com/leela/${articleId}`
101101
}
102102
]
103103
};

web/src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Metadata } from "next";
22
import { Geist, Geist_Mono } from "next/font/google";
3-
import Layout from "@/components/layout/Layout";
3+
44
import { LanguageProvider } from "@/context/LanguageContext";
55
import "./globals.css";
66
import UpdateDetector from "@/components/common/UpdateDetector";
@@ -19,7 +19,7 @@ const geistMono = Geist_Mono({
1919
});
2020

2121
export const metadata: Metadata = {
22-
metadataBase: new URL('https://saileelarahasya-web.vercel.app'),
22+
metadataBase: new URL('https://saileelarahasya.com'),
2323
title: {
2424
default: "Saileela Rahasya",
2525
template: "%s | Saileela Rahasya",
@@ -30,7 +30,7 @@ export const metadata: Metadata = {
3030
openGraph: {
3131
title: "Saileela Rahasya",
3232
description: "Unlocking the secret spiritual meanings of Shirdi Sai Baba's divine plays.",
33-
url: "https://saileelarahasya-web.vercel.app",
33+
url: "https://saileelarahasya.com",
3434
siteName: "Saileela Rahasya",
3535
images: [
3636
{

web/src/app/robots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export default function robots(): MetadataRoute.Robots {
77
allow: '/',
88
disallow: '/admin/',
99
},
10-
sitemap: 'https://saileelarahasya-web.vercel.app/sitemap.xml',
10+
sitemap: 'https://saileelarahasya.com/sitemap.xml',
1111
};
1212
}

web/src/app/sitemap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import leelaArticles from '@/data/leela_articles.json';
33
import bodhakathaArticles from '@/data/bodhakatha_articles.json';
44

55
export default function sitemap(): MetadataRoute.Sitemap {
6-
const baseUrl = 'https://saileelarahasya-web.vercel.app';
6+
const baseUrl = 'https://saileelarahasya.com';
77

88
const leelaUrls = leelaArticles.map((article) => ({
99
url: `${baseUrl}/leela/${article.id}`,

web/src/components/common/UpdateDetector.tsx

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
'use client';
22

3-
import { useState, useEffect } from 'react';
3+
import { useState, useEffect, useRef } from 'react';
44
import { RefreshCw } from 'lucide-react';
55

66
export default function UpdateDetector() {
77
const [updateAvailable, setUpdateAvailable] = useState(false);
8-
const [currentVersion, setCurrentVersion] = useState<string | null>(null);
8+
const currentVersionRef = useRef<string | null>(null);
99

1010
useEffect(() => {
1111
// Only run in production
1212
if (process.env.NODE_ENV !== 'production') return;
1313

14-
// Fetch the initial version when the app loads
15-
fetch('/version.json')
16-
.then(res => res.json())
17-
.then(data => {
18-
setCurrentVersion(data.version + '-' + data.buildTime);
19-
})
20-
.catch(() => { });
14+
// Function to check for updates
15+
const checkForUpdate = async () => {
16+
try {
17+
const res = await fetch(`/version.json?t=${Date.now()}`, {
18+
cache: 'no-store'
19+
});
20+
const data = await res.json();
21+
const remoteVersion = data.version + '-' + data.buildTime;
22+
23+
if (currentVersionRef.current && remoteVersion !== currentVersionRef.current) {
24+
setUpdateAvailable(true);
25+
} else if (!currentVersionRef.current) {
26+
// First load initialization
27+
currentVersionRef.current = remoteVersion;
28+
}
29+
} catch (e) {
30+
// Ignore fetch errors
31+
}
32+
};
33+
34+
// Initial check
35+
checkForUpdate();
2136

2237
// Check for updates every 10 minutes
23-
const interval = setInterval(() => {
24-
checkForUpdate();
25-
}, 10 * 60 * 1000);
38+
const interval = setInterval(checkForUpdate, 10 * 60 * 1000);
2639

2740
// Also check when the tab becomes focused
2841
window.addEventListener('focus', checkForUpdate);
@@ -33,22 +46,6 @@ export default function UpdateDetector() {
3346
};
3447
}, []);
3548

36-
const checkForUpdate = async () => {
37-
try {
38-
const res = await fetch(`/version.json?t=${Date.now()}`, {
39-
cache: 'no-store'
40-
});
41-
const data = await res.json();
42-
const newVersionFingerprint = data.version + '-' + data.buildTime;
43-
44-
if (currentVersion && newVersionFingerprint !== currentVersion) {
45-
setUpdateAvailable(true);
46-
}
47-
} catch (e) {
48-
// Ignore fetch errors
49-
}
50-
};
51-
5249
if (!updateAvailable) return null;
5350

5451
return (

web/src/components/layout/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import Link from 'next/link';
2+
import Image from 'next/image';
23
import UtilityMenu from '@/components/layout/UtilityMenu';
34

45
export default function Header() {
56
return (
67
<header className="fixed top-0 left-0 right-0 h-16 bg-white border-b border-gray-100 z-50 flex items-center justify-center px-4 shadow-sm md:fixed md:top-4 md:right-4 md:left-auto md:w-auto md:h-auto md:bg-transparent md:border-none md:shadow-none md:justify-end md:px-0 pointer-events-none">
78
<div className="max-w-7xl w-full flex items-center justify-between md:justify-end pointer-events-auto">
89
<Link href="/" className="flex items-center gap-3 md:hidden min-w-0 flex-shrink">
9-
<img
10+
<Image
1011
src="/saileela-logo.png"
1112
alt="Saileela Rahasya"
13+
width={40}
14+
height={40}
1215
className="h-10 w-auto object-contain flex-none"
1316
/>
1417
<span className="text-lg font-bold text-ochre tracking-wide whitespace-nowrap truncate">Saileela Rahasya</span>

web/src/components/layout/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AudioProvider } from '@/context/AudioContext';
55
import { InquiryProvider } from '@/context/InquiryContext';
66
import MiniPlayer from '@/components/audio/MiniPlayer';
77
import audioTracks from '@/data/audio_tracks.json';
8-
import AdminModeIndicator from '@/components/admin/AdminModeIndicator';
8+
99

1010
export default function Layout({ children }: { children: React.ReactNode }) {
1111
return (

web/src/components/layout/Sidebar.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client';
22

33
import Link from 'next/link';
4+
import Image from 'next/image';
45
import { usePathname } from 'next/navigation';
5-
import { Footprints, Lightbulb, Radio, Music, MessageCircleQuestion, BookA, ShieldCheck } from 'lucide-react';
6-
import { useUser } from '@clerk/nextjs';
6+
import { Footprints, Lightbulb, Radio, Music, MessageCircleQuestion, BookA } from 'lucide-react';
77
import { useInquiry } from '@/context/InquiryContext';
88

99
const NAV_ITEMS = [
@@ -14,28 +14,19 @@ const NAV_ITEMS = [
1414
{ label: 'Spiritual Inquiry', href: '/ask', icon: MessageCircleQuestion },
1515
];
1616

17-
const getAdminEmails = () => {
18-
const emails = (process.env.NEXT_PUBLIC_ADMIN_EMAILS || '').replace(/['"]/g, '');
19-
return emails.split(',').map(e => e.trim().toLowerCase()).filter(e => e !== '');
20-
};
21-
2217
export default function Sidebar() {
23-
const { user } = useUser();
2418
const pathname = usePathname();
2519
const { unreadCount } = useInquiry();
2620

27-
const adminEmails = getAdminEmails();
28-
const isAdmin = user?.emailAddresses.some(emailObj =>
29-
adminEmails.includes(emailObj.emailAddress.toLowerCase())
30-
);
31-
3221
return (
3322
<aside className="hidden md:flex flex-col w-64 fixed left-0 top-0 bottom-0 bg-white border-r border-gray-100 z-40">
3423
<div className="h-16 flex items-center px-3 border-b border-gray-100">
3524
<Link href="/" className="flex items-center gap-3">
36-
<img
25+
<Image
3726
src="/saileela-logo.png"
3827
alt="Saileela Rahasya"
28+
width={40}
29+
height={40}
3930
className="h-10 w-auto object-contain"
4031
/>
4132
<h1 className="text-lg font-bold text-ochre tracking-wide leading-tight">Saileela Rahasya</h1>

0 commit comments

Comments
 (0)