From 8595e4175a58022f9525f4f2ce56b702d44f30f4 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 12 Dec 2018 16:54:34 -0300 Subject: [PATCH] hotfix: get header title from location --- app/components/header.js | 1 + app/router/router.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/components/header.js b/app/components/header.js index 55d211b..6b67bd1 100644 --- a/app/components/header.js +++ b/app/components/header.js @@ -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` diff --git a/app/router/router.js b/app/router/router.js index 018fe0e..0534ffd 100644 --- a/app/router/router.js +++ b/app/router/router.js @@ -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 }) => ( - +