Refactored dependencies from App component (#3763)
* Refactored PageTitle to remove a dependency to location from App component * Refactored DefaultHomePage and DefaultPageTitle to remove dependencies from App component.
This commit is contained in:
11
packages/twenty-front/src/DefaultPageTitle.tsx
Normal file
11
packages/twenty-front/src/DefaultPageTitle.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
import { getPageTitleFromPath } from '~/utils/title-utils';
|
||||
|
||||
export const DefaultPageTitle = () => {
|
||||
const { pathname } = useLocation();
|
||||
const pageTitle = getPageTitleFromPath(pathname);
|
||||
|
||||
return <PageTitle title={pageTitle} />;
|
||||
};
|
||||
Reference in New Issue
Block a user