mirror of
https://github.com/zhigang1992/docz.git
synced 2026-04-25 21:55:54 +08:00
feat(docz-theme-default): add link to root route on logo
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user