[WEB-1574] chore: page head (#4773)

* chore: page head component refactor

* chore: page head component refactor
This commit is contained in:
Anmol Singh Bhatia 2024-06-12 13:12:08 +05:30 committed by GitHub
parent 8ccd37d777
commit f4ceaaf01c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 29 deletions

View file

@ -0,0 +1 @@
export * from "./use-page-title";

View file

@ -0,0 +1,13 @@
import { useEffect } from "react";
interface IUseHeadParams {
title?: string;
}
export const useHead = ({ title }: IUseHeadParams) => {
useEffect(() => {
if (title) {
document.title = title ?? "Plane | Simple, extensible, open-source project management tool.";
}
}, [title]);
};

View file

@ -17,3 +17,4 @@ export * from "./drag-handle";
export * from "./typography";
export * from "./drop-indicator";
export * from "./sortable";
export * from "./hooks";