-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(ComponentDoc): refactor, add sidebar navigation
- Loading branch information
Alexander Fedyashov
committed
Sep 13, 2017
1 parent
d288f3b
commit 4adc6fa
Showing
45 changed files
with
701 additions
and
374 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ coverage/ | |
dist/ | ||
docs/build/ | ||
docs/app/docgenInfo.json | ||
docs/app/menuInfo.json | ||
dll/ | ||
|
||
.DS_Store | ||
|
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,21 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import { Header } from 'semantic-ui-react' | ||
|
||
import { pure } from 'docs/app/HOC' | ||
import { getDocDescription } from 'docs/app/utils' | ||
|
||
const headerStyle = { marginBottom: '0.25em' } | ||
|
||
const ComponentDocHeader = ({ componentName }) => ( | ||
<Header as='h1' style={headerStyle}> | ||
{componentName} | ||
<Header.Subheader>{getDocDescription(componentName)}</Header.Subheader> | ||
</Header> | ||
) | ||
|
||
ComponentDocHeader.propTypes = { | ||
componentName: PropTypes.string, | ||
} | ||
|
||
export default pure(ComponentDocHeader) |
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,47 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import { List } from 'semantic-ui-react' | ||
|
||
import { pure } from 'docs/app/HOC' | ||
import { getGithubSourceUrl, getPosixPath, getSemanticUIDocsUrl } from 'docs/app/utils' | ||
|
||
const linkListStyle = { | ||
background: '#f7f7f7', | ||
boxShadow: '0 0 1em 0.5em #f7f7f7', | ||
margin: '0.5em', | ||
padding: '0.5em', | ||
position: 'absolute', | ||
right: '0', | ||
top: '0', | ||
} | ||
|
||
const ComponentDocLinks = ({ componentName, type }) => { | ||
const ghLink = getGithubSourceUrl(componentName) | ||
const suiLink = getSemanticUIDocsUrl(componentName, type) | ||
|
||
return ( | ||
<List link style={linkListStyle}> | ||
<List.Item | ||
content={( | ||
<code> | ||
<a href={ghLink} target='_blank'>{getPosixPath(componentName)}</a> | ||
</code> | ||
)} | ||
icon='github' | ||
/> | ||
{suiLink && ( | ||
<List.Item | ||
content={<a href={suiLink} target='_blank'>Semantic UI {componentName} Docs</a>} | ||
icon='book' | ||
/> | ||
)} | ||
</List> | ||
) | ||
} | ||
|
||
ComponentDocLinks.propTypes = { | ||
componentName: PropTypes.string, | ||
type: PropTypes.string, | ||
} | ||
|
||
export default pure(ComponentDocLinks) |
Oops, something went wrong.