import React from 'react'; import PropTypes from 'prop-types'; import {FormattedMessage} from 'react-intl'; import styles from './fonts-modal.css'; import VanillaFonts from 'scratch-paint/src/lib/fonts'; import bindAll from 'lodash.bindall'; import classNames from 'classnames'; class FontFallbackButton extends React.Component { constructor (props) { super(props); bindAll(this, [ 'handleClick' ]); } handleClick () { this.props.onClick(this.props.family); } formatName () { // keep in sync with scratch-paint/src/containers/font-dropdown.jsx switch (this.props.family) { case VanillaFonts.CHINESE: return '中文'; case VanillaFonts.KOREAN: return '한국어'; case VanillaFonts.JAPANESE: return '日本語'; case VanillaFonts.MOPED_LIKE: return 'Mopeds'; } return this.props.family; } render () { return ( ); } } FontFallbackButton.propTypes = { family: PropTypes.string.isRequired, onClick: PropTypes.func.isRequired, selected: PropTypes.bool.isRequired }; const FontFallback = props => (