We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3320685 commit 2fed546Copy full SHA for 2fed546
src/components/Svg.jsx
@@ -1,6 +1,7 @@
1
import React from 'react';
2
import PropTypes from 'prop-types';
3
import { connect } from 'react-redux';
4
+import getMode from '../selectors/getMode';
5
import { JS, SUN_OUTLINED, SUN_FILLED } from '../data/icons';
6
7
const SVG = ({ control, mode }) => {
@@ -29,6 +30,8 @@ SVG.propTypes = {
29
30
mode: PropTypes.string.isRequired
31
};
32
-const mapStateToProps = ({ mode }) => ({ mode });
33
+const mapStateToProps = state => ({
34
+ mode: getMode(state)
35
+});
36
37
export default connect(mapStateToProps)(SVG);
src/selectors/getMode.js
@@ -0,0 +1,3 @@
+const getMode = state => state.mode;
+
+export default getMode;
0 commit comments