File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const propTypes = {
1212 children : PropTypes . node ,
1313 className : PropTypes . string ,
1414 closeClassName : PropTypes . string ,
15+ closeAriaLabel : PropTypes . string ,
1516 cssModule : PropTypes . object ,
1617 color : PropTypes . string ,
1718 isOpen : PropTypes . bool ,
@@ -28,13 +29,15 @@ const defaultProps = {
2829 tag : 'div' ,
2930 transitionAppearTimeout : 150 ,
3031 transitionEnterTimeout : 150 ,
31- transitionLeaveTimeout : 150
32+ transitionLeaveTimeout : 150 ,
33+ closeAriaLabel : 'Close'
3234} ;
3335
3436const Alert = ( props ) => {
3537 const {
3638 className,
3739 closeClassName,
40+ closeAriaLabel,
3841 cssModule,
3942 tag : Tag ,
4043 color,
@@ -59,7 +62,7 @@ const Alert = (props) => {
5962 const alert = (
6063 < Tag { ...attributes } className = { classes } role = "alert" >
6164 { toggle ?
62- < button type = "button" className = { closeClasses } aria-label = "Close" onClick = { toggle } >
65+ < button type = "button" className = { closeClasses } aria-label = { closeAriaLabel } onClick = { toggle } >
6366 < span aria-hidden = "true" > ×</ span >
6467 </ button >
6568 : null }
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ const propTypes = {
1010 className : PropTypes . string ,
1111 cssModule : PropTypes . object ,
1212 children : PropTypes . node ,
13+ closeAriaLabel : PropTypes . string ,
1314} ;
1415
1516const defaultProps = {
1617 tag : 'h4' ,
1718 wrapTag : 'div' ,
19+ closeAriaLabel : 'Close' ,
1820} ;
1921
2022const ModalHeader = ( props ) => {
@@ -26,6 +28,7 @@ const ModalHeader = (props) => {
2628 toggle,
2729 tag : Tag ,
2830 wrapTag : WrapTag ,
31+ closeAriaLabel,
2932 ...attributes } = props ;
3033
3134 const classes = mapToCssModules ( classNames (
@@ -35,7 +38,7 @@ const ModalHeader = (props) => {
3538
3639 if ( toggle ) {
3740 closeButton = (
38- < button type = "button" onClick = { toggle } className = "close" aria-label = "Close" >
41+ < button type = "button" onClick = { toggle } className = "close" aria-label = { closeAriaLabel } >
3942 < span aria-hidden = "true" > { String . fromCharCode ( 215 ) } </ span >
4043 </ button >
4144 ) ;
You can’t perform that action at this time.
0 commit comments