|
1 | 1 | import React from 'react'
|
2 | 2 | import hljs from 'highlight.js'
|
3 | 3 | import Default from './examples/default'
|
| 4 | +import ChangeLabel from './examples/changeLabel' |
| 5 | +import ChangeTemplate from './examples/changeTemplate' |
| 6 | +import TextOnlyTemplate from './examples/textOnlyTemplate' |
| 7 | +import TextOnlyDropdown from './examples/textOnlyDropdown' |
| 8 | +import ChangeDropdownOrder from './examples/changeDropdownOrder' |
| 9 | +import RemoveDropdownItem from './examples/removeDropdownItem' |
| 10 | +import ChangeDropdownLabels from './examples/changeDropdownLabels' |
4 | 11 | import CodeExampleComponent from './code_example_component'
|
5 | 12 |
|
6 | 13 | import 'react-add-to-calendar/dist/react-add-to-calendar.css'
|
7 | 14 | import './style.scss'
|
8 | 15 |
|
9 | 16 | export default React.createClass({
|
10 |
| - displayName: 'exampleComponents', |
| 17 | + displayName: 'exampleComponents', |
11 | 18 |
|
12 |
| - componentDidMount () { |
13 |
| - hljs.initHighlightingOnLoad() |
14 |
| - }, |
| 19 | + componentDidMount () { |
| 20 | + hljs.initHighlightingOnLoad() |
| 21 | + }, |
15 | 22 |
|
16 |
| - examples: [ |
17 |
| - { |
18 |
| - title: 'Default', |
19 |
| - component: <Default /> |
20 |
| - } |
21 |
| - ], |
| 23 | + examples: [ |
| 24 | + { |
| 25 | + title: 'Default', |
| 26 | + component: <Default /> |
| 27 | + }, |
| 28 | + { |
| 29 | + title: 'Change Button Label', |
| 30 | + component: <ChangeLabel /> |
| 31 | + }, |
| 32 | + { |
| 33 | + title: 'Change Button Template', |
| 34 | + component: <ChangeTemplate /> |
| 35 | + }, |
| 36 | + { |
| 37 | + title: 'Text Only Button Template', |
| 38 | + component: <TextOnlyTemplate /> |
| 39 | + }, |
| 40 | + { |
| 41 | + title: 'Text Only Dropdown Items', |
| 42 | + component: <TextOnlyDropdown /> |
| 43 | + }, |
| 44 | + { |
| 45 | + title: 'Change Dropdown Order', |
| 46 | + component: <ChangeDropdownOrder /> |
| 47 | + }, |
| 48 | + { |
| 49 | + title: 'Remove Dropdown Item', |
| 50 | + component: <RemoveDropdownItem /> |
| 51 | + }, |
| 52 | + { |
| 53 | + title: 'Change Dropdown Labels', |
| 54 | + component: <ChangeDropdownLabels /> |
| 55 | + } |
| 56 | + ], |
22 | 57 |
|
23 |
| - renderExamples () { |
24 |
| - return this.examples.map((example, index) => |
25 |
| - <CodeExampleComponent key={`example-${index}`} id={index} title={example.title}> |
26 |
| - {example.component} |
27 |
| - </CodeExampleComponent> |
28 |
| - ) |
29 |
| - }, |
| 58 | + renderExamples () { |
| 59 | + return this.examples.map((example, index) => |
| 60 | + <CodeExampleComponent key={`example-${index}`} id={index} title={example.title}> |
| 61 | + {example.component} |
| 62 | + </CodeExampleComponent> |
| 63 | + ) |
| 64 | + }, |
30 | 65 |
|
31 |
| - renderLeftColumn () { |
32 |
| - return this.examples.map((example, index) => |
33 |
| - <li className="examples__navigation-item" key={`link-${index}`}> |
34 |
| - <a href={`#example-${index}`}> |
35 |
| - {example.title} |
36 |
| - </a> |
37 |
| - </li> |
38 |
| - ) |
39 |
| - }, |
| 66 | + renderLeftColumn () { |
| 67 | + return this.examples.map((example, index) => |
| 68 | + <li className="examples__navigation-item" key={`link-${index}`}> |
| 69 | + <a href={`#example-${index}`}> |
| 70 | + {example.title} |
| 71 | + </a> |
| 72 | + </li> |
| 73 | + ) |
| 74 | + }, |
40 | 75 |
|
41 |
| - render () { |
42 |
| - return <div> |
43 |
| - <h1>Examples</h1> |
44 |
| - <ul className="examples__navigation"> |
45 |
| - {this.renderLeftColumn()} |
46 |
| - </ul> |
47 |
| - <div className="examples"> |
48 |
| - {this.renderExamples()} |
49 |
| - </div> |
50 |
| - </div> |
51 |
| - } |
| 76 | + render () { |
| 77 | + return ( |
| 78 | + <div> |
| 79 | + <h1>Examples</h1> |
| 80 | + <ul className="examples__navigation"> |
| 81 | + {this.renderLeftColumn()} |
| 82 | + </ul> |
| 83 | + <div className="examples"> |
| 84 | + {this.renderExamples()} |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + ) |
| 88 | + } |
52 | 89 | })
|
0 commit comments