-
-
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.
- Loading branch information
1 parent
48a0484
commit 9652b30
Showing
25 changed files
with
299 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,9 @@ | ||
import React from 'react' | ||
import { doc } from 'docz' | ||
|
||
import { Button } from './Button' | ||
import { components } from './' | ||
|
||
doc('Button') | ||
.group(components) | ||
.section(() => <Button>Click me</Button>) |
File renamed without changes.
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,6 @@ | ||
import { group } from 'docz' | ||
|
||
export { Alert } from './Alert' | ||
export { Button } from './Button' | ||
|
||
export const components = group('Components') |
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,6 @@ | ||
import React from 'react' | ||
import { doc } from 'docz' | ||
|
||
doc('Design System') | ||
.order(0) | ||
.section(() => <div>Now we will talk about design systems!</div>) |
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,4 @@ | ||
import { group } from 'docz' | ||
export { withProps } from './withProps' | ||
|
||
export const hocs = group('hocs') |
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,8 @@ | ||
import React from 'react' | ||
import { doc } from 'docz' | ||
|
||
import { hocs } from './' | ||
|
||
doc('withProps') | ||
.group(hocs) | ||
.section(() => <div>This section talk about withProps hoc</div>) |
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,5 @@ | ||
import React from 'react' | ||
|
||
export const withProps = (mapProps = p => p) => WrappedComponent => props => ( | ||
<WrappedComponent {...props} {...mapProps(props)} /> | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,85 @@ | ||
import React from 'react' | ||
import { NavLink as BaseLink } from 'react-router-dom' | ||
import styled, { css } from 'react-emotion' | ||
|
||
import { Links } from 'docz' | ||
|
||
const BORDER_COLOR = '#ced6e0' | ||
const LINK_COLOR = '#2f3542' | ||
const PURPLE = '#5352ed' | ||
|
||
const Sidebar = styled('div')` | ||
padding: 20px 0; | ||
width: 250px; | ||
height: 100vh; | ||
border-right: 1px solid ${BORDER_COLOR}; | ||
` | ||
|
||
const List = styled('ul')` | ||
list-style: none; | ||
padding: 5px 15px; | ||
margin: 0; | ||
& ~ & { | ||
margin-top: 10px; | ||
} | ||
` | ||
|
||
const GroupTitle = styled('div')` | ||
font-size: 12px; | ||
text-transform: uppercase; | ||
color: #b2bec3; | ||
` | ||
|
||
const LinkStyled = styled(BaseLink)` | ||
display: block; | ||
padding: 4px 0; | ||
font-size: 14px; | ||
font-weight: 700; | ||
&, | ||
&:visited { | ||
color: ${LINK_COLOR}; | ||
} | ||
&.active { | ||
color: ${PURPLE}; | ||
} | ||
` | ||
|
||
const Link = props => { | ||
const isActive = (match, location) => match && match.url === location.pathname | ||
return <LinkStyled isActive={isActive} {...props} /> | ||
} | ||
|
||
export const Menu = () => ( | ||
<Links> | ||
{({ groups, docs }) => ( | ||
<Sidebar> | ||
<List> | ||
{docs.filter(doc => !doc.group).map(doc => ( | ||
<li key={doc.id}> | ||
<Link to={doc.route}>{doc.name}</Link> | ||
</li> | ||
))} | ||
</List> | ||
{groups.map(group => ( | ||
<List key={group.id}> | ||
<li> | ||
<GroupTitle>{group.name}</GroupTitle> | ||
<List> | ||
{docs | ||
.filter(doc => doc.group && doc.group.id === group.id) | ||
.map(doc => ( | ||
<li key={doc.id}> | ||
<Link to={doc.route}>{doc.name}</Link> | ||
</li> | ||
))} | ||
</List> | ||
</li> | ||
</List> | ||
))} | ||
</Sidebar> | ||
)} | ||
</Links> | ||
) |
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
Oops, something went wrong.