Render correct "Edit user" modal on the Team details - members page (#1136)

- Determine the current user's correct tier and render the correct "Edit user" modal
This commit is contained in:
noahtalerman 2021-06-18 12:49:17 -04:00 committed by GitHub
parent 19e8da177f
commit e984e6fc14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ import { useDispatch, useSelector } from "react-redux";
// @ts-ignore
import memoize from "memoize-one";
import { IConfig } from "interfaces/config";
import { IUser } from "interfaces/user";
import { INewMembersBody, ITeam } from "interfaces/team";
import { Link } from "react-router";
@ -32,10 +33,12 @@ interface IMembersPageProps {
params: {
team_id: string;
};
isBasicTier: boolean;
}
interface IRootState {
app: {
config: IConfig;
};
entities: {
users: {
loading: boolean;
@ -69,11 +72,13 @@ let tableQueryData = {};
const MembersPage = (props: IMembersPageProps): JSX.Element => {
const {
params: { team_id },
isBasicTier,
} = props;
const teamId = parseInt(team_id, 10);
const dispatch = useDispatch();
const isBasicTier = useSelector((state: IRootState) => {
return state.app.config.tier === "basic";
});
const loadingTableData = useSelector(
(state: IRootState) => state.entities.users.loading
);