2022-07-30 09:59:51 +02:00
|
|
|
/*
|
2024-09-06 10:22:13 +02:00
|
|
|
Copyright 2022-2024 New Vector Ltd.
|
2022-07-30 09:59:51 +02:00
|
|
|
|
2025-02-18 17:59:58 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-06 10:22:13 +02:00
|
|
|
Please see LICENSE in the repository root for full details.
|
2022-07-30 09:59:51 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { useEffect } from "react";
|
|
|
|
|
|
2025-01-08 13:24:23 +00:00
|
|
|
export function usePageTitle(title?: string): void {
|
2022-07-30 09:59:51 +02:00
|
|
|
useEffect(() => {
|
2022-11-01 22:16:08 -04:00
|
|
|
const productName = import.meta.env.VITE_PRODUCT_NAME || "Element Call";
|
2022-07-30 09:59:51 +02:00
|
|
|
document.title = title ? `${productName} | ${title}` : productName;
|
|
|
|
|
}, [title]);
|
|
|
|
|
}
|