element-call-Github/src/usePageTitle.js

10 lines
271 B
JavaScript
Raw Normal View History

2022-02-03 07:02:40 +08:00
import { useEffect } from "react";
export function usePageTitle(title) {
useEffect(() => {
2022-02-03 13:48:44 +08:00
const productName =
import.meta.env.VITE_PRODUCT_NAME || "Matrix Video Chat";
document.title = title ? `${productName} | ${title}` : productName;
2022-02-03 07:02:40 +08:00
}, [title]);
}