Add empty opportunity page (#83)
* Add empty opportunity page * Fix coverage --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -56,7 +56,9 @@
|
|||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"coveragePathIgnorePatterns": [
|
"coveragePathIgnorePatterns": [
|
||||||
".stories.tsx$"
|
".stories.tsx$",
|
||||||
|
"graphql.tsx$",
|
||||||
|
"apollo.tsx$"
|
||||||
],
|
],
|
||||||
"coverageThreshold": {
|
"coverageThreshold": {
|
||||||
"global": {
|
"global": {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import Login from './pages/auth/Login';
|
|||||||
import AppLayout from './layout/AppLayout';
|
import AppLayout from './layout/AppLayout';
|
||||||
import { Routes, Route, Navigate } from 'react-router-dom';
|
import { Routes, Route, Navigate } from 'react-router-dom';
|
||||||
import RequireAuth from './components/auth/RequireAuth';
|
import RequireAuth from './components/auth/RequireAuth';
|
||||||
|
import Opportunities from './pages/opportunities/Opportunities';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const user = {
|
const user = {
|
||||||
@ -50,6 +51,14 @@ function App() {
|
|||||||
</RequireAuth>
|
</RequireAuth>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path="/opportunities"
|
||||||
|
element={
|
||||||
|
<RequireAuth>
|
||||||
|
<Opportunities />
|
||||||
|
</RequireAuth>
|
||||||
|
}
|
||||||
|
/>
|
||||||
<Route path="/auth/callback" element={<AuthCallback />} />
|
<Route path="/auth/callback" element={<AuthCallback />} />
|
||||||
<Route path="/auth/login" element={<Login />} />
|
<Route path="/auth/login" element={<Login />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
@ -6,7 +6,10 @@ import NavItem from './NavItem';
|
|||||||
import NavTitle from './NavTitle';
|
import NavTitle from './NavTitle';
|
||||||
import WorkspaceContainer from './WorkspaceContainer';
|
import WorkspaceContainer from './WorkspaceContainer';
|
||||||
import { faUser } from '@fortawesome/pro-regular-svg-icons';
|
import { faUser } from '@fortawesome/pro-regular-svg-icons';
|
||||||
import { faBuildings } from '@fortawesome/pro-regular-svg-icons';
|
import {
|
||||||
|
faBuildings,
|
||||||
|
faBullseyeArrow,
|
||||||
|
} from '@fortawesome/pro-regular-svg-icons';
|
||||||
|
|
||||||
const NavbarContainer = styled.div`
|
const NavbarContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -56,6 +59,17 @@ function Navbar({ workspace }: OwnProps) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<NavItem
|
||||||
|
label="Opportunities"
|
||||||
|
to="/opportunities"
|
||||||
|
icon={faBullseyeArrow}
|
||||||
|
active={
|
||||||
|
!!useMatch({
|
||||||
|
path: useResolvedPath('/opportunities').pathname,
|
||||||
|
end: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
</NavItemsContainer>
|
</NavItemsContainer>
|
||||||
</NavbarContainer>
|
</NavbarContainer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
12
front/src/pages/opportunities/Opportunities.tsx
Normal file
12
front/src/pages/opportunities/Opportunities.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { faBullseyeArrow } from '@fortawesome/pro-regular-svg-icons';
|
||||||
|
import WithTopBarContainer from '../../layout/containers/WithTopBarContainer';
|
||||||
|
|
||||||
|
function Opportunities() {
|
||||||
|
return (
|
||||||
|
<WithTopBarContainer title="Opportunities" icon={faBullseyeArrow}>
|
||||||
|
<></>
|
||||||
|
</WithTopBarContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Opportunities;
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
|
import Opportunities from '../Opportunities';
|
||||||
|
import { ThemeProvider } from '@emotion/react';
|
||||||
|
import { lightTheme } from '../../../layout/styles/themes';
|
||||||
|
|
||||||
|
const component = {
|
||||||
|
title: 'Opportunities',
|
||||||
|
component: Opportunities,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default component;
|
||||||
|
|
||||||
|
export const OpportunitiesDefault = () => (
|
||||||
|
<ThemeProvider theme={lightTheme}>
|
||||||
|
<MemoryRouter>
|
||||||
|
<Opportunities />
|
||||||
|
</MemoryRouter>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import { render } from '@testing-library/react';
|
||||||
|
|
||||||
|
import { OpportunitiesDefault } from '../__stories__/Opportunities.stories';
|
||||||
|
|
||||||
|
it('Checks the Companies page render', () => {
|
||||||
|
const { getByTestId } = render(<OpportunitiesDefault />);
|
||||||
|
|
||||||
|
const title = getByTestId('top-bar-title');
|
||||||
|
expect(title).toHaveTextContent('Opportunities');
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user