[WEB-1574] chore: page head (#4773)
* chore: page head component refactor * chore: page head component refactor
This commit is contained in:
parent
8ccd37d777
commit
f4ceaaf01c
5 changed files with 18 additions and 29 deletions
1
packages/ui/src/hooks/index.ts
Normal file
1
packages/ui/src/hooks/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./use-page-title";
|
||||
13
packages/ui/src/hooks/use-page-title.tsx
Normal file
13
packages/ui/src/hooks/use-page-title.tsx
Normal 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]);
|
||||
};
|
||||
|
|
@ -17,3 +17,4 @@ export * from "./drag-handle";
|
|||
export * from "./typography";
|
||||
export * from "./drop-indicator";
|
||||
export * from "./sortable";
|
||||
export * from "./hooks";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue