* Added Overview page * Revised Getting Started page * Minor revision * Edited readme, minor modifications to docs * Removed sweep.yaml, .devcontainer, .ergomake * Moved security.md to .github, added contributing.md * changes as per code review * updated contributing.md * fixed broken links & added missing links in doc, improved structure * fixed link in wsl setup * fixed server link, added https cloning in yarn-setup * removed package-lock.json * added doc card, admonitions * removed underline from nav buttons * refactoring modules/ui * refactoring modules/ui * Change folder case * Fix theme location * Fix case 2 * Fix storybook --------- Co-authored-by: Nimra Ahmed <nimra1408@gmail.com> Co-authored-by: Nimra Ahmed <50912134+nimraahmed@users.noreply.github.com>
114 lines
4.7 KiB
TypeScript
114 lines
4.7 KiB
TypeScript
import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
|
|
|
|
import { AppPath } from '@/types/AppPath';
|
|
import { SettingsPath } from '@/types/SettingsPath';
|
|
import { DefaultLayout } from '@/ui/layout/page/DefaultLayout';
|
|
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
|
import { CommandMenuEffect } from '~/effect-components/CommandMenuEffect';
|
|
import { GotoHotkeysEffect } from '~/effect-components/GotoHotkeysEffect';
|
|
import { CreateProfile } from '~/pages/auth/CreateProfile';
|
|
import { CreateWorkspace } from '~/pages/auth/CreateWorkspace';
|
|
import { SignInUp } from '~/pages/auth/SignInUp';
|
|
import { VerifyEffect } from '~/pages/auth/VerifyEffect';
|
|
import { Companies } from '~/pages/companies/Companies';
|
|
import { CompanyShow } from '~/pages/companies/CompanyShow';
|
|
import { ImpersonateEffect } from '~/pages/impersonate/ImpersonateEffect';
|
|
import { NotFound } from '~/pages/not-found/NotFound';
|
|
import { Opportunities } from '~/pages/opportunities/Opportunities';
|
|
import { People } from '~/pages/people/People';
|
|
import { PersonShow } from '~/pages/people/PersonShow';
|
|
import { SettingsExperience } from '~/pages/settings/SettingsExperience';
|
|
import { SettingsNewObject } from '~/pages/settings/SettingsNewObject';
|
|
import { SettingsObjectDetail } from '~/pages/settings/SettingsObjectDetail';
|
|
import { SettingsObjectEdit } from '~/pages/settings/SettingsObjectEdit';
|
|
import { SettingsObjects } from '~/pages/settings/SettingsObjects';
|
|
import { SettingsProfile } from '~/pages/settings/SettingsProfile';
|
|
import { SettingsWorkspace } from '~/pages/settings/SettingsWorkspace';
|
|
import { SettingsWorkspaceMembers } from '~/pages/settings/SettingsWorkspaceMembers';
|
|
import { Tasks } from '~/pages/tasks/Tasks';
|
|
import { getPageTitleFromPath } from '~/utils/title-utils';
|
|
|
|
import { ObjectTablePage } from './pages/companies/ObjectsTable';
|
|
|
|
export const App = () => {
|
|
const { pathname } = useLocation();
|
|
const pageTitle = getPageTitleFromPath(pathname);
|
|
|
|
return (
|
|
<>
|
|
<PageTitle title={pageTitle} />
|
|
<GotoHotkeysEffect />
|
|
<CommandMenuEffect />
|
|
<DefaultLayout>
|
|
<Routes>
|
|
<Route path={AppPath.Verify} element={<VerifyEffect />} />
|
|
<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 />} />
|
|
<Route path={AppPath.TasksPage} element={<Tasks />} />
|
|
<Route path={AppPath.Impersonate} element={<ImpersonateEffect />} />
|
|
|
|
<Route path={AppPath.OpportunitiesPage} element={<Opportunities />} />
|
|
<Route
|
|
path={AppPath.ObjectTablePage}
|
|
element={
|
|
<ObjectTablePage
|
|
objectName="supplier"
|
|
objectNameSingular="Supplier"
|
|
/>
|
|
}
|
|
/>
|
|
|
|
<Route
|
|
path={AppPath.SettingsCatchAll}
|
|
element={
|
|
<Routes>
|
|
<Route
|
|
path={SettingsPath.ProfilePage}
|
|
element={<SettingsProfile />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.Experience}
|
|
element={<SettingsExperience />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.WorkspaceMembersPage}
|
|
element={<SettingsWorkspaceMembers />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.Workspace}
|
|
element={<SettingsWorkspace />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.Objects}
|
|
element={<SettingsObjects />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.ObjectDetail}
|
|
element={<SettingsObjectDetail />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.ObjectEdit}
|
|
element={<SettingsObjectEdit />}
|
|
/>
|
|
<Route
|
|
path={SettingsPath.NewObject}
|
|
element={<SettingsNewObject />}
|
|
/>
|
|
</Routes>
|
|
}
|
|
/>
|
|
<Route path={AppPath.NotFoundWildcard} element={<NotFound />} />
|
|
</Routes>
|
|
</DefaultLayout>
|
|
</>
|
|
);
|
|
};
|