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