feat(docz-theme-default): add link to root route on logo

This commit is contained in:
Pedro Nauck
2018-09-27 20:45:58 -03:00
parent 66e6248ddf
commit 8252ebff0b

View File

@@ -1,6 +1,6 @@
import * as React from 'react'
import { SFC } from 'react'
import { ThemeConfig } from 'docz'
import { ThemeConfig, Link } from 'docz'
import styled from 'react-emotion'
import { breakpoints } from '../../../styles/responsive'
@@ -18,6 +18,12 @@ const Wrapper = styled('div')`
justify-content: center;
padding: 24px;
a,
a:hover,
a:visited {
text-decoration: none;
}
&:before {
position: absolute;
content: '';
@@ -56,11 +62,13 @@ export const Logo: SFC<LogoProps> = ({ showBg }) => (
<ThemeConfig>
{({ title, themeConfig: { logo } }) => (
<Wrapper showBg={showBg}>
{logo ? (
<LogoImg src={logo.src} width={logo.width} alt={title} />
) : (
<LogoText>{title}</LogoText>
)}
<Link to="/">
{logo ? (
<LogoImg src={logo.src} width={logo.width} alt={title} />
) : (
<LogoText>{title}</LogoText>
)}
</Link>
</Wrapper>
)}
</ThemeConfig>