import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { ThemeProvider } from 'styled-components'; import theme, { Theme } from '../../../theme'; const Provider = ({ children, currentTheme }) => ( {children} ); Provider.propTypes = { children: PropTypes.node.isRequired, currentTheme: PropTypes.oneOf(Object.keys(Theme)).isRequired, }; function mapStateToProps(state) { return { currentTheme: state.preferences.theme, }; } export default connect(mapStateToProps)(Provider);