hotfix: get header title from location

This commit is contained in:
George Lima 2018-12-12 16:54:34 -03:00
parent 7f8d81aa20
commit 8595e4175a
2 changed files with 8 additions and 1 deletions

View File

@ -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`

View File

@ -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>