Generate Token through Auth0

This commit is contained in:
Charles Bochet
2023-01-27 12:12:04 +01:00
parent 54acb16db8
commit 8e0dc44bf6
21 changed files with 3616 additions and 2344 deletions

View File

@ -1,50 +1,68 @@
import styled from '@emotion/styled';
import { useMatch, useResolvedPath } from 'react-router-dom';
import NavItem from './NavItem';
import ProfileContainer from './ProfileContainer';
const NavbarContainer = styled.div`
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: space-between;
padding-left: 12px;
height: 58px;
border-bottom: 2px solid #eaecee;
`;
function Navbar() {
const NavItemsContainer = styled.div`
display: flex;
flex-direction: row;
`;
type OwnProps = {
user?: {
email: string;
first_name: string;
last_name: string;
tenant: { id: string; name: string };
};
};
function Navbar({ user }: OwnProps) {
return (
<>
<NavbarContainer>
<NavItem
label="Inbox"
to="/"
active={
!!useMatch({
path: useResolvedPath('/').pathname,
end: true,
})
}
/>
<NavItem
label="Contacts"
to="/contacts"
active={
!!useMatch({
path: useResolvedPath('/contacts').pathname,
end: true,
})
}
/>
<NavItem
label="Insights"
to="/insights"
active={
!!useMatch({
path: useResolvedPath('/insights').pathname,
end: true,
})
}
/>
<NavItemsContainer>
<NavItem
label="Inbox"
to="/"
active={
!!useMatch({
path: useResolvedPath('/').pathname,
end: true,
})
}
/>
<NavItem
label="Contacts"
to="/contacts"
active={
!!useMatch({
path: useResolvedPath('/contacts').pathname,
end: true,
})
}
/>
<NavItem
label="Insights"
to="/insights"
active={
!!useMatch({
path: useResolvedPath('/insights').pathname,
end: true,
})
}
/>
</NavItemsContainer>
<ProfileContainer user={user} />
</NavbarContainer>
</>
);