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`};
|
font-size: ${props => `${props.theme.fontSize.title}em`};
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
text-transform: capitalize;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Divider = styled.div`
|
const Divider = styled.div`
|
||||||
|
|
|
@ -31,9 +31,15 @@ const ContentWrapper = styled.div`
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const getTitle = (path: string) => {
|
||||||
|
if (path === '/') return 'Dashboard';
|
||||||
|
|
||||||
|
return path.replace('/', '');
|
||||||
|
};
|
||||||
|
|
||||||
export const RouterComponent = ({ location }: { location: Location }) => (
|
export const RouterComponent = ({ location }: { location: Location }) => (
|
||||||
<FullWrapper>
|
<FullWrapper>
|
||||||
<HeaderComponent title='Dashboard' />
|
<HeaderComponent title={getTitle(location.pathname)} />
|
||||||
<ContentWrapper>
|
<ContentWrapper>
|
||||||
<SidebarContainer location={location} />
|
<SidebarContainer location={location} />
|
||||||
<ScrollTopComponent>
|
<ScrollTopComponent>
|
||||||
|
|
Loading…
Reference in New Issue