Skip to content

Commit

Permalink
Reducing props passed to AuthenticationRequired.
Browse files Browse the repository at this point in the history
  • Loading branch information
erinesullivan committed Sep 19, 2023
1 parent c4734e2 commit da2a2ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/modules/lists/components/ActionsList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ function ActionsList (props) {
})}
</ul>
{props.active?.action === 'email' && (
<AuthenticationRequired>
<AuthenticationRequired profile={props.profile}>
<EmailAction
action={props.active}
{...props}
/>
</AuthenticationRequired>
)}
{props.active?.action === 'text' && (
<AuthenticationRequired>
<AuthenticationRequired profile={props.profile}>
<TextAction
action={props.active}
{...props}
Expand Down Expand Up @@ -134,7 +134,8 @@ ActionsList.propTypes = {
PropTypes.string,
PropTypes.object
]),
setActive: PropTypes.func
setActive: PropTypes.func,
profile: PropTypes.object
};

function mapStateToProps (state) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Authentication from '../Authentication';

Expand Down Expand Up @@ -27,10 +26,4 @@ AuthenticationRequired.propTypes = {
])
};

function mapStateToProps (state) {
return {
profile: state.profile
};
}

export default connect(mapStateToProps)(AuthenticationRequired);
export default AuthenticationRequired;

0 comments on commit da2a2ca

Please sign in to comment.