diff --git a/js/lib/buttons.js b/js/lib/buttons.js new file mode 100644 index 00000000..7b384ad4 --- /dev/null +++ b/js/lib/buttons.js @@ -0,0 +1,27 @@ +import React from 'react'; +import _Button from 'react-bootstrap/lib/Button'; + +export const Button = React.createClass({ + + render: function render() { + return ( + <_Button> + {this.props.children} + + ) + } + +}); + + +export const SecondaryButton = React.createClass({ + + render: function render() { + return ( + <_Button className='btn-secondary'> + {this.props.children} + + ) + } + +}); diff --git a/js/routes.js b/js/routes.js index f76e4b45..67ac668b 100644 --- a/js/routes.js +++ b/js/routes.js @@ -31,6 +31,18 @@ let Redirect = Router.Redirect; let baseUrl = AppConstants.baseUrl; +function getDebugRoutes() { + let StyleGuideContainer = require('./styleguide/container.js'); + if (window.DEBUG) { + return ( + + ); + } else { + return null; + } +} + + const COMMON_ROUTES = ( @@ -46,6 +58,7 @@ const COMMON_ROUTES = ( + {getDebugRoutes()} ); diff --git a/js/styleguide/components/buttons.js b/js/styleguide/components/buttons.js new file mode 100644 index 00000000..e891bdfa --- /dev/null +++ b/js/styleguide/components/buttons.js @@ -0,0 +1,47 @@ +'use strict'; + +import React from 'react'; +import { Button, SecondaryButton } from '../../lib/buttons'; +import Panel from 'react-bootstrap/lib/Panel'; + + +let Buttons = React.createClass({ + + render() { + return ( +
+

Button

+

import { Button } from './js/lib/buttons';

+ +
+

This is a paragraph with + + that should be displayed inline +

+
+ +
+

This is a form with a large submit button +

+ +
+

+
+
+ +
+ + {""} + +
+
+ ); + } + +}); + +export default Buttons; diff --git a/js/styleguide/container.js b/js/styleguide/container.js new file mode 100644 index 00000000..ac461d5e --- /dev/null +++ b/js/styleguide/container.js @@ -0,0 +1,20 @@ +'use strict'; + +import React from 'react'; +import Buttons from './components/buttons'; + + +let StyleGuideContainer = React.createClass({ + + render() { + return ( +
+ +
+ ); + } +}); + + + +export default StyleGuideContainer; diff --git a/styleguide/app.js b/styleguide/app.js deleted file mode 100644 index 437d34b9..00000000 --- a/styleguide/app.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -import React from 'react'; -import Buttons from './components/buttons'; -import Panel from 'react-bootstrap/lib/Panel'; - - -React.render( -
-

Buttons

- -
, - document.getElementById('main') -); diff --git a/styleguide/components/buttons.js b/styleguide/components/buttons.js deleted file mode 100644 index e96be1c6..00000000 --- a/styleguide/components/buttons.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -import React from 'react'; - -let Buttons = React.createClass({ - render() { - let classes = [ - 'btn btn-default', - 'btn ascribe-btn', - 'btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner', - 'btn btn-danger btn-delete btn-sm' - ]; - - return ( -
- {classes.map((c) => { - return ( - - {c} - - ); - }) - } -
- ); - } - -}); - -export default Buttons;