import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { setStatistics } from '../../actions/generalActions'; import * as Blockly from 'blockly/core' import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; import FormControl from '@mui/material/FormControl'; import Select from '@mui/material/Select'; import Typography from '@mui/material/Typography'; import FormHelperText from '@mui/material/FormHelperText'; class StatsSelector extends Component { componentDidMount(){ // Ensure that Blockly.setLocale is adopted in the component. // Otherwise, the text will not be displayed until the next update of the component. this.forceUpdate(); } render(){ return (
{Blockly.Msg.settings_statistics} {Blockly.Msg.settings_statistics_text} {Blockly.Msg.settings_statistics}
); } } StatsSelector.propTypes = { setStatistics: PropTypes.func.isRequired, language: PropTypes.string.isRequired, statistics: PropTypes.bool.isRequired }; const mapStateToProps = state => ({ statistics: state.general.statistics, language: state.general.language }); export default connect(mapStateToProps, { setStatistics })(StatsSelector);