Files
element-call-Github/src/usePageTitle.ts
Will Hunt 7e507d6310 Set the document title to the current call name. (#2928)
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-01-08 13:24:23 +00:00

16 lines
418 B
TypeScript

/*
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { useEffect } from "react";
export function usePageTitle(title?: string): void {
useEffect(() => {
const productName = import.meta.env.VITE_PRODUCT_NAME || "Element Call";
document.title = title ? `${productName} | ${title}` : productName;
}, [title]);
}