@@ -40,6 +40,25 @@ const Anchor = React.createClass({
40
40
}
41
41
} ) ;
42
42
43
+ const ExampleEditor = React . createClass ( {
44
+ propTypes : {
45
+ codeText : React . PropTypes . string
46
+ } ,
47
+ render ( ) {
48
+ return (
49
+ < Editor
50
+ className = 'overlay-example'
51
+ lineNumbers = { false }
52
+ lang = "js"
53
+ theme = "neo"
54
+ scope = { scope }
55
+ codeText = { this . props . codeText }
56
+ collapsableCode
57
+ />
58
+ ) ;
59
+ }
60
+ } ) ;
61
+
43
62
const Example = React . createClass ( {
44
63
45
64
render ( ) {
@@ -61,15 +80,7 @@ const Example = React.createClass({
61
80
< Anchor > Transition</ Anchor >
62
81
</ h2 >
63
82
< p dangerouslySetInnerHTML = { { __html : TransitionMetadata . Transition . descHtml } } />
64
- < Editor
65
- className = 'overlay-example'
66
- lineNumbers = { false }
67
- lang = "js"
68
- theme = "neo"
69
- scope = { scope }
70
- codeText = { TransitionSource }
71
- collapsableCode
72
- />
83
+ < ExampleEditor codeText = { TransitionSource } />
73
84
< PropTable
74
85
component = 'Transition'
75
86
metadata = { TransitionMetadata }
@@ -80,15 +91,7 @@ const Example = React.createClass({
80
91
< Anchor > Portals</ Anchor >
81
92
</ h2 >
82
93
< p dangerouslySetInnerHTML = { { __html : PortalMetadata . Portal . descHtml } } />
83
- < Editor
84
- className = 'overlay-example'
85
- lineNumbers = { false }
86
- lang = "js"
87
- theme = "neo"
88
- scope = { scope }
89
- codeText = { PortalSource }
90
- collapsableCode
91
- />
94
+ < ExampleEditor codeText = { PortalSource } />
92
95
< PropTable
93
96
component = 'Portal'
94
97
metadata = { PortalMetadata }
@@ -99,16 +102,7 @@ const Example = React.createClass({
99
102
< Anchor > Modals</ Anchor >
100
103
</ h2 >
101
104
< p dangerouslySetInnerHTML = { { __html : ModalMetadata . Modal . descHtml } } />
102
- < Editor
103
- className = 'overlay-example'
104
- lineNumbers = { false }
105
- lang = "js"
106
- theme = "neo"
107
- scope = { scope }
108
- codeText = { ModalExample }
109
- collapsableCode
110
- />
111
-
105
+ < ExampleEditor codeText = { ModalExample } />
112
106
< PropTable
113
107
component = 'Modal'
114
108
metadata = { ModalMetadata }
@@ -119,15 +113,7 @@ const Example = React.createClass({
119
113
< Anchor > Position</ Anchor >
120
114
</ h2 >
121
115
< p dangerouslySetInnerHTML = { { __html : PositionMetadata . Position . descHtml } } />
122
- < Editor
123
- className = 'overlay-example'
124
- lineNumbers = { false }
125
- lang = "js"
126
- theme = "neo"
127
- scope = { scope }
128
- codeText = { PositionSource }
129
- collapsableCode
130
- />
116
+ < ExampleEditor codeText = { PositionSource } />
131
117
< PropTable
132
118
component = 'Position'
133
119
metadata = { PositionMetadata }
@@ -138,16 +124,7 @@ const Example = React.createClass({
138
124
< Anchor > Overlay</ Anchor >
139
125
</ h2 >
140
126
< p dangerouslySetInnerHTML = { { __html : OverlayMetadata . Overlay . descHtml } } />
141
- < Editor
142
- className = 'overlay-example'
143
- lineNumbers = { false }
144
- lang = "js"
145
- theme = "neo"
146
- scope = { scope }
147
- codeText = { OverlaySource }
148
- collapsableCode
149
- />
150
-
127
+ < ExampleEditor codeText = { OverlaySource } />
151
128
< PropTable
152
129
component = 'Overlay'
153
130
metadata = { OverlayMetadata }
0 commit comments