-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Correct tabindex on alert modal close button * combine dismiss buttons * fix react/no-unknown-property * rm doc comment * fix modal close button * add CloseButton * wtf
- Loading branch information
Showing
4 changed files
with
44 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
const propTypes = { | ||
label: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
}; | ||
|
||
class CloseButton extends React.Component { | ||
render() { | ||
const { label, onClick } = this.props; | ||
return ( | ||
<button | ||
type="button" | ||
className="close" | ||
onClick={onClick} | ||
> | ||
<span aria-hidden="true">×</span> | ||
<span className="sr-only">{label}</span> | ||
</button> | ||
); | ||
} | ||
} | ||
|
||
CloseButton.propTypes = propTypes; | ||
|
||
export default CloseButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters