Skip to content

Commit 9f47499

Browse files
committed
fix: [FIXUP] RoleEditor
1 parent 5424533 commit 9f47499

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

src/inputs/RoleEditor/RoleEditor.js

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,10 @@
33
import React from 'react';
44
import PropTypes from 'prop-types';
55
import { Grid, Typography, Avatar, Tooltip } from '@mui/material';
6-
import makeStyles from '@mui/styles/makeStyles';
76
import { DefaultAvatar } from '../../misc';
87
import { getIdentifierFromUserEmail } from '../../utils';
98
import { SelectWithAction } from '../SelectWithAction';
109

11-
const useStyles = makeStyles((theme) => ({
12-
agentGroup: {
13-
display: 'flex',
14-
alignItems: 'center',
15-
gap: '15px',
16-
marginLeft: 0,
17-
},
18-
agentName: {
19-
overflow: 'hidden',
20-
textOverflow: 'ellipsis',
21-
textWrap: 'nowrap',
22-
},
23-
rolesEditor: {
24-
display: 'flex',
25-
alignItems: 'center',
26-
marginTop: '15px',
27-
},
28-
nameGroup: {
29-
display: 'flex',
30-
flexDirection: 'column',
31-
maxWidth: '80%',
32-
},
33-
}));
3410
export const RoleEditor = ({
3511
agentName,
3612
agentAccess = null,
@@ -41,15 +17,26 @@ export const RoleEditor = ({
4117
actions = [],
4218
helperText = null,
4319
}) => {
44-
const classes = useStyles();
4520
const avatar = icon ? <Avatar>{icon}</Avatar> : <DefaultAvatar userName={agentName} />;
4621
return (
47-
<Grid data-cy={`role-editor-${getIdentifierFromUserEmail(agentName)}`} className={classes.rolesEditor} size={12}>
48-
<Grid className={classes.agentGroup} size={7}>
22+
<Grid
23+
data-cy={`role-editor-${getIdentifierFromUserEmail(agentName)}`}
24+
size={12}
25+
sx={{ display: 'flex', alignItems: 'center', marginTop: '15px' }}
26+
>
27+
<Grid size={7} sx={{ display: 'flex', alignItems: 'center', gap: '15px', marginLeft: 0 }}>
4928
{avatar}
50-
<div className={classes.nameGroup}>
29+
<div style={{ display: 'flex', flexDirection: 'column', maxWidth: '80%' }}>
5130
<Tooltip title={agentName} arrow>
52-
<Typography className={classes.agentName} data-cy="role-editor-agent-name" variant="body1">
31+
<Typography
32+
data-cy="role-editor-agent-name"
33+
variant="body1"
34+
sx={{
35+
overflow: 'hidden',
36+
textOverflow: 'ellipsis',
37+
textWrap: 'nowrap',
38+
}}
39+
>
5340
{agentName}
5441
</Typography>
5542
</Tooltip>

0 commit comments

Comments
 (0)