hotfix: get header title from location
This commit is contained in:
parent
7f8d81aa20
commit
8595e4175a
|
@ -41,6 +41,7 @@ const Title = styled(TextComponent)`
|
|||
font-size: ${props => `${props.theme.fontSize.title}em`};
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
text-transform: capitalize;
|
||||
`;
|
||||
|
||||
const Divider = styled.div`
|
||||
|
|
|
@ -31,9 +31,15 @@ const ContentWrapper = styled.div`
|
|||
width: 100vw;
|
||||
`;
|
||||
|
||||
const getTitle = (path: string) => {
|
||||
if (path === '/') return 'Dashboard';
|
||||
|
||||
return path.replace('/', '');
|
||||
};
|
||||
|
||||
export const RouterComponent = ({ location }: { location: Location }) => (
|
||||
<FullWrapper>
|
||||
<HeaderComponent title='Dashboard' />
|
||||
<HeaderComponent title={getTitle(location.pathname)} />
|
||||
<ContentWrapper>
|
||||
<SidebarContainer location={location} />
|
||||
<ScrollTopComponent>
|
||||
|
|
Loading…
Reference in New Issue