Skip to content

Commit d6ee35c

Browse files
committed
[react-website] Add support for react-bootstrap components.
1 parent 0b48764 commit d6ee35c

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/react-website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
"npm": "^3.10.8"
2222
},
2323
"dependencies": {
24-
"auth0-styleguide-react-components": "*",
2524
"auth0-styleguide-core": "*",
25+
"auth0-styleguide-react-components": "*",
2626
"babel-polyfill": "^6.16.0",
2727
"codemirror": "^5.19.0",
2828
"component-playground": "^1.3.1",
2929
"highlight.js": "^9.7.0",
3030
"react": "^15.3.2",
31+
"react-bootstrap": "^0.30.6",
3132
"react-copy-to-clipboard": "^4.2.3",
3233
"react-docgen": "^2.11.0",
3334
"react-dom": "^15.3.2",

packages/react-website/src/containers/App/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ function generateComponentsCollection(listOfComponents) {
5353
component: listOfComponents[component],
5454
props: doc.props,
5555
name: component,
56-
examples
56+
examples,
57+
reactBootstrap: doc['react-bootstrap']
5758
};
5859
})
5960
.filter(component => !!component);

packages/react-website/src/containers/ComponentPage/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ import React, { PropTypes } from 'react';
22
import { Example, PropertiesTable } from 'components';
33
import './index.styl';
44

5-
const ComponentPage = ({ title, description, props, url, examples }) =>
5+
const ComponentPage = ({ title, description, props, url, examples, reactBootstrap }) =>
66
<section className="react-component-page">
77
<div className="component-information">
88
<h1 className="component-title">{title}</h1>
99
<p className="component-description">{description}</p>
1010
</div>
11+
{reactBootstrap && (
12+
<div>
13+
<p>This component is from <a href="https://react-bootstrap.github.io/">React-Bootstrap</a>, find more info about this component <a href={reactBootstrap}>here</a>. License: <a href="https://github.com/react-bootstrap/react-bootstrap/blob/master/LICENSE">MIT</a>.</p>
14+
</div>
15+
)}
1116
{examples.map((example, index) =>
1217
<Example
1318
key={index}
@@ -28,7 +33,8 @@ ComponentPage.propTypes = {
2833
description: PropTypes.string.isRequired,
2934
url: PropTypes.string.isRequired,
3035
props: PropTypes.object,
31-
examples: PropTypes.array.isRequired
36+
examples: PropTypes.array.isRequired,
37+
reactBootstrap: PropTypes.string
3238
};
3339

3440
export default ComponentPage;

0 commit comments

Comments
 (0)