diff --git a/client/src/app/demo/components-demo-page.js b/client/src/app/demo/components-demo-page.js index 5555ce23..eab74996 100644 --- a/client/src/app/demo/components-demo-page.js +++ b/client/src/app/demo/components-demo-page.js @@ -1,268 +1,23 @@ -'use strict'; +import AutocompleteDropDown from 'core-components/autocomplete-dropdown'; const React = require('react'); -// const LineChart = require("react-chartjs-2").Line; const _ = require('lodash'); -const DocumentTitle = require('react-document-title'); -const ModalContainer = require('app-components/modal-container'); -const AreYouSure = require('app-components/are-you-sure'); - -const Button = require('core-components/button'); -const Input = require('core-components/input'); -const Checkbox = require('core-components/checkbox'); -const Widget = require('core-components/widget'); -const DropDown = require('core-components/drop-down'); -const Menu = require('core-components/menu'); -const Tooltip = require('core-components/tooltip'); -const Table = require('core-components/table'); -const InfoTooltip = require('core-components/info-tooltip'); -const TagSelector = require('core-components/tag-selector'); - -function rand(min, max, num) { - var rtn = []; - while (rtn.length < num) { - rtn.push((Math.random() * (max - min)) + min); - } - return rtn; +class DemoPage extends React.Component { + + render() { + let itemsList = [ + {id: 45, content: 'content item 1'}, + {id: 46, content: 'content item 2'}, + {id: 47, content: 'content item 3'}, + {id: 48, content: 'content item 4'}, + {id: 49, content: 'content item 5'}, + ]; + + return ( + + ); + } } -let chartData = { - labels: ["January", "February", "March", "April", "May", "June"], - datasets: [ - { - label: "My Second dataset", - fill: false, - pointColor: "rgba(151,187,205,1)", - pointStrokeColor: "#fff", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(151,187,205,1)", - borderWidth: 3, - data: rand(32, 100, 6), - pointRadius: 0 - }, - { - label: "My Second dataset", - fill: false, - pointColor: "rgba(151,187,205,1)", - pointStrokeColor: "#fff", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(151,187,205,1)", - borderWidth: 3, - data: rand(32, 100, 6) - } - ] -}; -let chartOptions = {}; -let dropDownItems = [{content: 'English'}, {content: 'Spanish'}, {content: 'German'}, {content: 'Portuguese'}, {content: 'Japanese'}]; -let secondaryMenuItems = [ - {content: 'My Tickets', icon: 'file-text'}, - {content: 'New Ticket', icon: 'plus'}, - {content: 'Articles', icon: 'book'}, - {content: 'Edit Profile', icon: 'pencil'}, - {content: 'Close Session', icon: 'lock'} -]; - -let DemoPage = React.createClass({ - - propTypes: { - currentUser: React.PropTypes.object.isRequired - }, - - elements: [ - { - title: 'Primary Button', - render: ( - - ) - }, - { - title: 'Tag selector', - render: ( - console.log('deleted click', e)} - onTagSelected={(e) => console.log('selected click', e)} - /> - ) - }, - { - title: 'Input', - render: ( - - ) - }, - { - title: 'Input wrapped in a label', - render: ( - - ) - }, - { - title: 'Checkbox', - render: ( - - ) - }, - { - title: 'Widget', - render: ( - -

Register here!

- - -
- ) - }, - { - title: 'Primary Menu', - render: ( - - ) - }, - { - title: 'Secondary Menu', - render: ( - - ) - }, - { - title: 'Navigation Menu', - render: ( - - ) - }, - { - title: 'Horizontal Menu', - render: ( - - ) - }, - { - title: 'HorizontalList Menu', - render: ( - - ) - }, - { - title: 'DropDown', - render: ( - - ) - }, - { - title: 'Tooltip', - render: ( -
- - hola - -
- ) - }, - { - title: 'ModalTrigger', - render: ( - - ) - }, - { - title: 'ModalTrigger Large', - render: ( - - ) - }, - { - title: 'Table', - render: ( - b.title1) - ans = 1; - return ans; - }}/> - ) - }, - { - title: 'InfoTooltip', - render: ( - - ) - }, - { - title: 'LineChart', - // render: ( - // - // ), - render: ( - null - ) - } - ], - - render() { - return ( - -
- {this.renderElements()} -
-
- ); - }, - - renderElements: function () { - return this.elements.map((element) => { - return ( -
-

- {element.title} -

-
- {element.render} -
-
- ); - }); - } -}); - export default DemoPage;