fix: url resolver and minor fixes

This commit is contained in:
Sérgio Salgado 2021-04-20 16:45:30 +01:00 committed by Josh Harvey
parent 2062413c75
commit 75a2ecd3c2
15 changed files with 274 additions and 290 deletions

View file

@ -29,12 +29,7 @@ const CHANGE_USER_ROLE = gql`
const useStyles = makeStyles(styles)
const ChangeRoleModal = ({
showModal,
toggleModal,
user,
requiresConfirmation
}) => {
const ChangeRoleModal = ({ state, dispatch, user, requiresConfirmation }) => {
const classes = useStyles()
const [changeUserRole] = useMutation(CHANGE_USER_ROLE, {
@ -56,18 +51,21 @@ const ChangeRoleModal = ({
const handleClose = () => {
setConfirmation(null)
toggleModal()
dispatch({
type: 'close',
payload: 'showRoleModal'
})
}
return (
(showModal && requiresConfirmation && !confirmation && (
(state.showRoleModal && requiresConfirmation && !confirmation && (
<Input2FAModal
showModal={showModal}
showModal={state.showRoleModal}
handleClose={handleClose}
setConfirmation={setConfirmation}
/>
)) ||
(showModal && (
(state.showRoleModal && (
<Modal
closeOnBackdropClick={true}
width={450}