bigbuffet-rw/app/soapbox/features/developers/index.js
2022-01-07 19:27:18 -06:00

28 lines
694 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { getSettings } from 'soapbox/actions/settings';
import DevelopersMenu from './developers_menu';
import DevelopersChallenge from './developers_challenge';
const mapStateToProps = state => {
const settings = getSettings(state);
return {
isDeveloper: settings.get('isDeveloper'),
};
};
export default @connect(mapStateToProps)
class Developers extends React.Component {
static propTypes = {
isDeveloper: PropTypes.bool.isRequired,
}
render() {
const { isDeveloper } = this.props;
return isDeveloper ? <DevelopersMenu /> : <DevelopersChallenge />;
}
}