Fix page titles

This commit is contained in:
Robert Long 2022-02-02 21:48:44 -08:00
commit a189f3ad98
6 changed files with 52 additions and 131 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -2,8 +2,8 @@ import { useEffect } from "react";
export function usePageTitle(title) {
useEffect(() => {
document.title = title
? `${import.meta.env.VITE_PRODUCT_NAME} | ${title}`
: import.meta.env.VITE_PRODUCT_NAME;
const productName =
import.meta.env.VITE_PRODUCT_NAME || "Matrix Video Chat";
document.title = title ? `${productName} | ${title}` : productName;
}, [title]);
}