diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 22f3aef6..28841ac0 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -41,11 +41,13 @@ import { isFilePreviewable } from "@/lib/file-preview"; import { Search, Filter, ChevronDown, X, Paperclip, Star, Mail, MailOpen, RotateCcw, PenSquare, PenLine, CheckSquare, Square } from "lucide-react"; import { ResizeHandle } from "@/components/layout/resize-handle"; import { Button } from "@/components/ui/button"; +import { useConfig } from "@/hooks/use-config"; export default function Home() { const router = useRouter(); const t = useTranslations(); const tCommon = useTranslations('common'); + const { appName } = useConfig(); const [showComposer, setShowComposer] = useState(false); const [composerMode, setComposerMode] = useState<'compose' | 'reply' | 'replyAll' | 'forward'>('compose'); const [composerDraftText, setComposerDraftText] = useState(""); @@ -224,7 +226,7 @@ export default function Home() { // Update page title based on context useEffect(() => { - let title = tCommon('app_title'); + let title = appName; if (showComposer) { // Composing email @@ -234,11 +236,11 @@ export default function Home() { replyAll: t('email_composer.reply_all'), forward: t('email_composer.forward'), }[composerMode] || t('email_composer.new_message'); - title = `${modeText} - ${tCommon('app_title')}`; + title = `${modeText} - ${appName}`; } else if (selectedEmail) { // Reading email const subject = selectedEmail.subject || t('email_viewer.no_subject'); - title = `${subject} - ${tCommon('app_title')}`; + title = `${subject} - ${appName}`; } else if (selectedMailbox && mailboxes.length > 0) { // Mailbox view const mailbox = mailboxes.find(mb => mb.id === selectedMailbox); @@ -246,13 +248,13 @@ export default function Home() { const mailboxName = mailbox.name; const unreadCount = mailbox.unreadEmails || 0; title = unreadCount > 0 - ? `${mailboxName} (${unreadCount}) - ${tCommon('app_title')}` - : `${mailboxName} - ${tCommon('app_title')}`; + ? `${mailboxName} (${unreadCount}) - ${appName}` + : `${mailboxName} - ${appName}`; } } document.title = title; - }, [showComposer, composerMode, selectedEmail, selectedMailbox, mailboxes, t, tCommon]); + }, [showComposer, composerMode, selectedEmail, selectedMailbox, mailboxes, t, appName]); // Check auth on mount useEffect(() => { diff --git a/app/layout.tsx b/app/layout.tsx index 4811e25c..b4e7facb 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -15,7 +15,7 @@ const geistMono = Geist_Mono({ }); export const metadata: Metadata = { - title: "Bulwark Webmail", + title: process.env.APP_NAME || process.env.NEXT_PUBLIC_APP_NAME || "Webmail", description: "Minimalist webmail client using JMAP protocol", };