Teams are now refreshed properly when TeamListItems change

This commit is contained in:
Alex van Andel committed 2021-06-05 23:41:05 +00:00
1 parent 7a31cb0f6a
commit 9f12ccf5c1
3 files changed
+8 -4

No files matched your search

+5 -2
View File
@@ -24,12 +24,15 @@ export default function TeamList(props) {
return (<div>
<ul className="border px-2 mb-2 rounded divide-y divide-gray-200">
{props.teams.map(
(team: any) => <TeamListItem key={team.id} team={team} onActionSelect={
(team: any) => <TeamListItem onChange={props.onChange} key={team.id} team={team} onActionSelect={
(action: string) => selectAction(action, team)
}></TeamListItem>
)}
</ul>
{showEditTeamModal && <EditTeamModal team={team} onExit={() => setShowEditTeamModal(false)}></EditTeamModal>}
{showEditTeamModal && <EditTeamModal team={team} onExit={() => {
props.onChange();
setShowEditTeamModal(false);
}}></EditTeamModal>}
{showMemberInvitationModal &&
<MemberInvitationModal
team={team}
+1
View File
@@ -18,6 +18,7 @@ export default function TeamListItem(props) {
}).then( () => {
// success
setTeam(null);
props.onChange();
});
return (team && <li className="mb-2 mt-2 divide-y">