-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docz-theme-default): use typescript instead of javascript
- Loading branch information
1 parent
3f56278
commit 123cc45
Showing
18 changed files
with
226 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, { SFC } from 'react' | ||
import { NavLink as BaseLink, LinkProps, match } from 'react-router-dom' | ||
import { Location } from 'history' | ||
import styled from 'react-emotion' | ||
|
||
import * as colors from '../styles/colors' | ||
|
||
const LinkStyled = styled(BaseLink)` | ||
position: relative; | ||
display: block; | ||
padding: 8px 20px; | ||
font-size: 14px; | ||
font-weight: 400; | ||
color: white; | ||
background: transparent; | ||
border-radius: 3px; | ||
transition: background 0.3s; | ||
&, | ||
&:visited { | ||
color: ${colors.GRAY_DARK}; | ||
} | ||
&.active { | ||
background: ${colors.GRAY}; | ||
} | ||
&:before { | ||
position: absolute; | ||
content: ''; | ||
top: 0; | ||
left: 0; | ||
width: 4px; | ||
height: 100%; | ||
background: ${colors.PURPLE}; | ||
transform: scaleX(0); | ||
transform-origin: 0 50%; | ||
transition: transform 0.3s; | ||
} | ||
&:hover::before, | ||
&.active:before { | ||
transform: scaleX(1); | ||
} | ||
` | ||
|
||
const isActive = (match: match<any>, location: Location) => | ||
match && match.url === location.pathname | ||
|
||
export const Link: SFC<LinkProps> = props => ( | ||
<LinkStyled isActive={isActive} {...props} /> | ||
) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.