2023-08-28 19:49:04 +03:00
|
|
|
import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
|
2023-06-04 12:23:09 +03:00
|
|
|
|
2023-07-17 00:29:28 +03:00
|
|
|
import { AppPath } from '@/types/AppPath';
|
|
|
|
import { SettingsPath } from '@/types/SettingsPath';
|
|
|
|
import { DefaultLayout } from '@/ui/layout/components/DefaultLayout';
|
2023-08-28 19:49:04 +03:00
|
|
|
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
2023-06-30 09:26:06 +03:00
|
|
|
import { CreateProfile } from '~/pages/auth/CreateProfile';
|
|
|
|
import { CreateWorkspace } from '~/pages/auth/CreateWorkspace';
|
2023-08-01 01:47:29 +03:00
|
|
|
import { SignInUp } from '~/pages/auth/SignInUp';
|
2023-06-21 05:17:31 +03:00
|
|
|
import { Verify } from '~/pages/auth/Verify';
|
|
|
|
import { Companies } from '~/pages/companies/Companies';
|
2023-07-18 20:47:27 +03:00
|
|
|
import { CompanyShow } from '~/pages/companies/CompanyShow';
|
2023-08-01 01:47:29 +03:00
|
|
|
import { Impersonate } from '~/pages/impersonate/Impersonate';
|
2023-06-21 05:17:31 +03:00
|
|
|
import { Opportunities } from '~/pages/opportunities/Opportunities';
|
|
|
|
import { People } from '~/pages/people/People';
|
2023-07-18 20:47:27 +03:00
|
|
|
import { PersonShow } from '~/pages/people/PersonShow';
|
|
|
|
import { SettingsExperience } from '~/pages/settings/SettingsExperience';
|
2023-06-21 05:17:31 +03:00
|
|
|
import { SettingsProfile } from '~/pages/settings/SettingsProfile';
|
2023-08-24 16:56:43 +03:00
|
|
|
import { SettingsWorkspace } from '~/pages/settings/SettingsWorkspace';
|
2023-07-08 04:56:22 +03:00
|
|
|
import { SettingsWorkspaceMembers } from '~/pages/settings/SettingsWorkspaceMembers';
|
2023-08-01 02:14:35 +03:00
|
|
|
import { Tasks } from '~/pages/tasks/Tasks';
|
2023-07-18 20:47:27 +03:00
|
|
|
import { AppInternalHooks } from '~/sync-hooks/AppInternalHooks';
|
2023-07-08 04:53:05 +03:00
|
|
|
|
2023-08-24 16:56:43 +03:00
|
|
|
import { NotFound } from './pages/not-found/NotFound';
|
2023-08-28 19:49:04 +03:00
|
|
|
import { getPageTitleFromPath } from './utils/title-utils';
|
2023-08-17 23:02:20 +03:00
|
|
|
|
2023-07-28 21:41:06 +03:00
|
|
|
// TEMP FEATURE FLAG FOR VIEW FIELDS
|
2023-07-30 00:48:43 +03:00
|
|
|
export const ACTIVATE_VIEW_FIELDS = true;
|
2023-07-28 21:41:06 +03:00
|
|
|
|
2023-06-08 11:36:37 +03:00
|
|
|
export function App() {
|
2023-08-28 19:49:04 +03:00
|
|
|
const { pathname } = useLocation();
|
|
|
|
const pageTitle = getPageTitleFromPath(pathname);
|
|
|
|
|
2023-06-08 11:36:37 +03:00
|
|
|
return (
|
2023-07-08 04:53:05 +03:00
|
|
|
<>
|
2023-08-28 19:49:04 +03:00
|
|
|
<PageTitle title={pageTitle} />
|
2023-07-08 04:53:05 +03:00
|
|
|
<AppInternalHooks />
|
|
|
|
<DefaultLayout>
|
|
|
|
<Routes>
|
2023-07-22 08:05:45 +03:00
|
|
|
<Route path={AppPath.Verify} element={<Verify />} />
|
|
|
|
<Route path={AppPath.SignIn} element={<SignInUp />} />
|
|
|
|
<Route path={AppPath.SignUp} element={<SignInUp />} />
|
|
|
|
<Route path={AppPath.Invite} element={<SignInUp />} />
|
|
|
|
<Route path={AppPath.CreateWorkspace} element={<CreateWorkspace />} />
|
|
|
|
<Route path={AppPath.CreateProfile} element={<CreateProfile />} />
|
|
|
|
<Route path="/" element={<Navigate to={AppPath.CompaniesPage} />} />
|
|
|
|
<Route path={AppPath.PeoplePage} element={<People />} />
|
|
|
|
<Route path={AppPath.PersonShowPage} element={<PersonShow />} />
|
|
|
|
<Route path={AppPath.CompaniesPage} element={<Companies />} />
|
|
|
|
<Route path={AppPath.CompanyShowPage} element={<CompanyShow />} />
|
2023-08-01 02:14:35 +03:00
|
|
|
<Route path={AppPath.TasksPage} element={<Tasks />} />
|
2023-08-01 01:47:29 +03:00
|
|
|
<Route path={AppPath.Impersonate} element={<Impersonate />} />
|
2023-07-22 08:05:45 +03:00
|
|
|
|
|
|
|
<Route path={AppPath.OpportunitiesPage} element={<Opportunities />} />
|
2023-07-08 04:53:05 +03:00
|
|
|
<Route
|
2023-07-22 08:05:45 +03:00
|
|
|
path={AppPath.SettingsCatchAll}
|
2023-07-08 04:53:05 +03:00
|
|
|
element={
|
2023-07-22 08:05:45 +03:00
|
|
|
<Routes>
|
|
|
|
<Route
|
|
|
|
path={SettingsPath.ProfilePage}
|
|
|
|
element={<SettingsProfile />}
|
|
|
|
/>
|
|
|
|
<Route
|
|
|
|
path={SettingsPath.Experience}
|
|
|
|
element={<SettingsExperience />}
|
|
|
|
/>
|
|
|
|
<Route
|
|
|
|
path={SettingsPath.WorkspaceMembersPage}
|
|
|
|
element={<SettingsWorkspaceMembers />}
|
|
|
|
/>
|
|
|
|
<Route
|
|
|
|
path={SettingsPath.Workspace}
|
2023-08-24 16:56:43 +03:00
|
|
|
element={<SettingsWorkspace />}
|
2023-07-22 08:05:45 +03:00
|
|
|
/>
|
|
|
|
</Routes>
|
2023-07-08 04:53:05 +03:00
|
|
|
}
|
|
|
|
/>
|
2023-08-17 23:02:20 +03:00
|
|
|
<Route path={AppPath.NotFoundWildcard} element={<NotFound />} />
|
2023-07-08 04:53:05 +03:00
|
|
|
</Routes>
|
|
|
|
</DefaultLayout>
|
|
|
|
</>
|
2022-12-01 17:58:08 +03:00
|
|
|
);
|
|
|
|
}
|