renamed navlink to simple delete

This commit is contained in:
Florian Scholdei
2019-01-23 10:08:15 +01:00
parent 904f5851a7
commit cb5e74e791
6 changed files with 38 additions and 53 deletions

View File

@@ -2,8 +2,8 @@
import React from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import UserForm from "./../components/UserForm";
import DeleteUser from "./../components/DeleteUser";
import UserForm from "../components/UserForm";
import DeleteUser from "../components/DeleteUser";
import type { User } from "@scm-manager/ui-types";
import {
modifyUser,
@@ -57,6 +57,15 @@ class GeneralUser extends React.Component<Props> {
}
}
const mapStateToProps = (state, ownProps) => {
const loading = isModifyUserPending(state, ownProps.user.name);
const error = getModifyUserFailure(state, ownProps.user.name);
return {
loading,
error
};
};
const mapDispatchToProps = dispatch => {
return {
modifyUser: (user: User, callback?: () => void) => {
@@ -68,15 +77,6 @@ const mapDispatchToProps = dispatch => {
};
};
const mapStateToProps = (state, ownProps) => {
const loading = isModifyUserPending(state, ownProps.user.name);
const error = getModifyUserFailure(state, ownProps.user.name);
return {
loading,
error
};
};
export default connect(
mapStateToProps,
mapDispatchToProps