mirror of
https://github.com/plankanban/planka.git
synced 2025-07-25 16:19:47 +02:00
Add user settings modal
This commit is contained in:
parent
af00e3e191
commit
c6ecf126d0
29 changed files with 570 additions and 455 deletions
58
client/src/containers/UserSettingsModalContainer.js
Normal file
58
client/src/containers/UserSettingsModalContainer.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { currentUserSelector } from '../selectors';
|
||||
import {
|
||||
clearCurrentUserEmailUpdateError,
|
||||
clearCurrentUserPasswordUpdateError,
|
||||
clearCurrentUserUsernameUpdateError,
|
||||
closeModal,
|
||||
updateCurrentUser,
|
||||
updateCurrentUserEmail,
|
||||
updateCurrentUserPassword,
|
||||
updateCurrentUserUsername,
|
||||
uploadCurrentUserAvatar,
|
||||
} from '../actions/entry';
|
||||
import UserSettingsModal from '../components/UserSettingsModal';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const {
|
||||
email,
|
||||
name,
|
||||
username,
|
||||
avatar,
|
||||
isAvatarUploading,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
usernameUpdateForm,
|
||||
} = currentUserSelector(state);
|
||||
|
||||
return {
|
||||
email,
|
||||
name,
|
||||
username,
|
||||
avatar,
|
||||
isAvatarUploading,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
usernameUpdateForm,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators(
|
||||
{
|
||||
onUpdate: updateCurrentUser,
|
||||
onAvatarUpload: uploadCurrentUserAvatar,
|
||||
onUsernameUpdate: updateCurrentUserUsername,
|
||||
onUsernameUpdateMessageDismiss: clearCurrentUserUsernameUpdateError,
|
||||
onEmailUpdate: updateCurrentUserEmail,
|
||||
onEmailUpdateMessageDismiss: clearCurrentUserEmailUpdateError,
|
||||
onPasswordUpdate: updateCurrentUserPassword,
|
||||
onPasswordUpdateMessageDismiss: clearCurrentUserPasswordUpdateError,
|
||||
onClose: closeModal,
|
||||
},
|
||||
dispatch,
|
||||
);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(UserSettingsModal);
|
Loading…
Add table
Add a link
Reference in a new issue