UNPKG

scratch-gui

Version:

GraphicaL User Interface for creating and running Scratch 3.0 projects

44 lines (41 loc) 1.02 kB
import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import greenFlagIcon from './icon--green-flag.svg'; import styles from './green-flag.css'; const GreenFlagComponent = function (props) { const { active, className, onClick, title, ...componentProps } = props; return ( <img className={classNames( className, styles.greenFlag, { [styles.isActive]: active } )} draggable={false} src={greenFlagIcon} title={title} onClick={onClick} {...componentProps} /> ); }; GreenFlagComponent.propTypes = { active: PropTypes.bool, className: PropTypes.string, onClick: PropTypes.func.isRequired, title: PropTypes.string }; GreenFlagComponent.defaultProps = { active: false, title: 'Go' }; export default GreenFlagComponent;