Commit f339b350 by Patrick O'Carroll

replaced confirm delete modal with deleteButton component in teams members list

parent 1c63f7a6
...@@ -2,9 +2,9 @@ import React from 'react'; ...@@ -2,9 +2,9 @@ import React from 'react';
import { hot } from 'react-hot-loader'; import { hot } from 'react-hot-loader';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import { ITeam, ITeamMember } from 'app/stores/TeamsStore/TeamsStore'; import { ITeam, ITeamMember } from 'app/stores/TeamsStore/TeamsStore';
import appEvents from 'app/core/app_events';
import SlideDown from 'app/core/components/Animations/SlideDown'; import SlideDown from 'app/core/components/Animations/SlideDown';
import { UserPicker, User } from 'app/core/components/Picker/UserPicker'; import { UserPicker, User } from 'app/core/components/Picker/UserPicker';
import DeleteButton from 'app/core/components/DeleteButton/DeleteButton';
interface Props { interface Props {
team: ITeam; team: ITeam;
...@@ -31,15 +31,7 @@ export class TeamMembers extends React.Component<Props, State> { ...@@ -31,15 +31,7 @@ export class TeamMembers extends React.Component<Props, State> {
}; };
removeMember(member: ITeamMember) { removeMember(member: ITeamMember) {
appEvents.emit('confirm-modal', { this.props.team.removeMember(member);
title: 'Remove Member',
text: 'Are you sure you want to remove ' + member.login + ' from this group?',
yesText: 'Remove',
icon: 'fa-warning',
onConfirm: () => {
this.removeMemberConfirmed(member);
},
});
} }
removeMemberConfirmed(member: ITeamMember) { removeMemberConfirmed(member: ITeamMember) {
...@@ -54,10 +46,8 @@ export class TeamMembers extends React.Component<Props, State> { ...@@ -54,10 +46,8 @@ export class TeamMembers extends React.Component<Props, State> {
</td> </td>
<td>{member.login}</td> <td>{member.login}</td>
<td>{member.email}</td> <td>{member.email}</td>
<td style={{ width: '1%' }}> <td className="text-right">
<a onClick={() => this.removeMember(member)} className="btn btn-danger btn-mini"> <DeleteButton onConfirmDelete={() => this.removeMember(member)} />
<i className="fa fa-remove" />
</a>
</td> </td>
</tr> </tr>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment