Add risks
Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
a2d1310780
commit
a86181c83d
21
packages/hooks/package.json
Normal file
21
packages/hooks/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@probo/hooks",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"format": "prettier --write ./src"
|
||||
},
|
||||
"prettier": "@probo/prettier",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@probo/prettier": "1.0.0",
|
||||
"prettier": "^3.5.3",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^3.1.3"
|
||||
}
|
||||
}
|
||||
1
packages/hooks/src/index.ts
Normal file
1
packages/hooks/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { usePageTitle } from "./usePageTitle";
|
||||
10
packages/hooks/src/usePageTitle.tsx
Normal file
10
packages/hooks/src/usePageTitle.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
export function usePageTitle(title: string) {
|
||||
useEffect(() => {
|
||||
document.title = title + " - Probo";
|
||||
return () => {
|
||||
document.title = "Probo";
|
||||
};
|
||||
}, [title]);
|
||||
}
|
||||
5
packages/hooks/tsconfig.json
Normal file
5
packages/hooks/tsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2021", "dom"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user