@@ -2,6 +2,7 @@ import React, { cloneElement } from 'react';
22import classNames from 'classnames' ;
33import BootstrapMixin from './BootstrapMixin' ;
44import ValidComponentChildren from './utils/ValidComponentChildren' ;
5+ import Glyphicon from './Glyphicon' ;
56
67const Carousel = React . createClass ( {
78 mixins : [ BootstrapMixin ] ,
@@ -17,7 +18,9 @@ const Carousel = React.createClass({
1718 onSlideEnd : React . PropTypes . func ,
1819 activeIndex : React . PropTypes . number ,
1920 defaultActiveIndex : React . PropTypes . number ,
20- direction : React . PropTypes . oneOf ( [ 'prev' , 'next' ] )
21+ direction : React . PropTypes . oneOf ( [ 'prev' , 'next' ] ) ,
22+ prevIcon : React . PropTypes . node . isRequired ,
23+ nextIcon : React . PropTypes . node . isRequired
2124 } ,
2225
2326 getDefaultProps ( ) {
@@ -27,7 +30,9 @@ const Carousel = React.createClass({
2730 pauseOnHover : true ,
2831 wrap : true ,
2932 indicators : true ,
30- controls : true
33+ controls : true ,
34+ prevIcon : < Glyphicon glyph = "chevron-left" /> ,
35+ nextIcon : < Glyphicon glyph = "chevron-right" />
3136 } ;
3237 } ,
3338
@@ -158,15 +163,15 @@ const Carousel = React.createClass({
158163 renderPrev ( ) {
159164 return (
160165 < a className = "left carousel-control" href = "#prev" key = { 0 } onClick = { this . prev } >
161- < span className = "glyphicon glyphicon-chevron-left" />
166+ { this . props . prevIcon }
162167 </ a >
163168 ) ;
164169 } ,
165170
166171 renderNext ( ) {
167172 return (
168173 < a className = "right carousel-control" href = "#next" key = { 1 } onClick = { this . next } >
169- < span className = "glyphicon glyphicon-chevron-right" />
174+ { this . props . nextIcon }
170175 </ a >
171176 ) ;
172177 } ,
0 commit comments