forked from SheepTester/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Make delete button accessible"
- Loading branch information
Showing
6 changed files
with
11 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,39 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import {defineMessages, injectIntl, intlShape} from 'react-intl'; | ||
|
||
import styles from './delete-button.css'; | ||
import deleteIcon from './icon--delete.svg'; | ||
|
||
const messages = defineMessages({ | ||
delete: { | ||
id: 'gui.deleteButton.delete', | ||
description: 'Title of the button to delete a sprite, costume or sound', | ||
defaultMessage: 'Delete' | ||
} | ||
}); | ||
|
||
const DeleteButtonComponent = ({ | ||
className, | ||
intl, | ||
onClick, | ||
setRef, | ||
tabIndex, | ||
...props | ||
}) => ( | ||
const DeleteButton = props => ( | ||
<div | ||
aria-label={intl.formatMessage(messages.delete)} | ||
aria-label="Delete" | ||
className={classNames( | ||
styles.deleteButton, | ||
className | ||
props.className | ||
)} | ||
ref={setRef} | ||
role="button" | ||
tabIndex={tabIndex} | ||
onClick={onClick} | ||
{...props} | ||
tabIndex={props.tabIndex} | ||
onClick={props.onClick} | ||
> | ||
<div className={styles.deleteButtonVisible}> | ||
<img | ||
className={styles.deleteIcon} | ||
draggable={false} | ||
src={deleteIcon} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
|
||
); | ||
|
||
DeleteButtonComponent.propTypes = { | ||
DeleteButton.propTypes = { | ||
className: PropTypes.string, | ||
intl: intlShape, | ||
onClick: PropTypes.func.isRequired, | ||
setRef: PropTypes.func.isRequired, | ||
tabIndex: PropTypes.number | ||
}; | ||
|
||
DeleteButtonComponent.defaultProps = { | ||
DeleteButton.defaultProps = { | ||
tabIndex: 0 | ||
}; | ||
|
||
export default injectIntl(DeleteButtonComponent); | ||
export default DeleteButton; |
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 was deleted.
Oops, something went wrong.
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