Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions src/views/accounts/instances/Users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { Box, Button, Grid, Stack, Typography } from '@mui/material';
import { Box, Button, Grid, Stack, Typography, useTheme } from '@mui/material';
import {
accountsValidations,
FormInput,
Expand All @@ -12,6 +12,7 @@ import {
AccountsTableHead,
} from 'components/accounts';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import { grey } from '@mui/material/colors';

import AddIcon from '@mui/icons-material/Add';
import { baseroles } from 'components/accounts/users/baseroles';
Expand Down Expand Up @@ -230,7 +231,9 @@ const CustomTable = ({
);
};

const CustomForm = ({ onSubmit, options, instanceZUID }) => {
const CustomForm = ({ onSubmit, options, instanceZUID, onCancel }) => {
const theme = useTheme();
Comment thread
finnar-bin marked this conversation as resolved.
Outdated

const formik = useFormik({
validationSchema: accountsValidations.email,
initialValues: {
Expand Down Expand Up @@ -265,7 +268,28 @@ const CustomForm = ({ onSubmit, options, instanceZUID }) => {
formik={formik}
options={newOptions}
/>
<SubmitBtn loading={formik.isSubmitting}>Submit</SubmitBtn>
<Stack gap={1}>
<SubmitBtn loading={formik.isSubmitting}>Submit</SubmitBtn>
<Button
color={theme.palette.mode === 'light' ? 'inherit' : 'primary'}
variant="outlined"
fullWidth
disabled={formik.isSubmitting}
onClick={onCancel}
sx={(theme) => ({
textTransform: 'none',
border:
theme.palette.mode === 'light' && `1px solid ${grey[200]}`,
bgcolor: theme.palette.mode === 'light' && 'white',
'&:hover': {
bgcolor: theme.palette.mode === 'light' && 'white',
color: theme.palette.mode === 'light' && 'black',
},
})}
>
Cancel
</Button>
Comment thread
finnar-bin marked this conversation as resolved.
Comment thread
finnar-bin marked this conversation as resolved.
</Stack>
</form>
</Box>
);
Expand Down Expand Up @@ -299,6 +323,7 @@ const Index = ({
onSubmit={createInvite}
options={options}
instanceZUID={instanceZUID}
onCancel={() => MySwal.close()}
Comment thread
finnar-bin marked this conversation as resolved.
Outdated
/>
),
showConfirmButton: false,
Expand Down
Loading