Refactor deprecated property

This commit is contained in:
Nicola Benaglia 2025-06-11 23:08:38 +02:00
parent 92fb7351b7
commit a65ea59ba4
2 changed files with 48 additions and 43 deletions

View File

@ -1632,7 +1632,7 @@ export const Group = ({
const renderDirects = () => { const renderDirects = () => {
return ( return (
<div <Box
style={{ style={{
alignItems: 'flex-start', alignItems: 'flex-start',
background: theme.palette.background.paper, background: theme.palette.background.paper,
@ -1718,8 +1718,8 @@ export const Group = ({
</ButtonBase> </ButtonBase>
</Box> </Box>
<div <Box
style={{ sx={{
alignItems: 'flex-start', alignItems: 'flex-start',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
@ -1803,22 +1803,24 @@ export const Group = ({
postProcess: 'capitalizeFirstChar', postProcess: 'capitalizeFirstChar',
}) })
} }
primaryTypographyProps={{ slotProps={{
style: { primary: {
color: style: {
direct?.address === selectedDirect?.address && color:
theme.palette.text.primary, direct?.address === selectedDirect?.address &&
textWrap: 'wrap', theme.palette.text.primary,
overflow: 'hidden', textWrap: 'wrap',
fontSize: '16px', overflow: 'hidden',
fontSize: '16px',
},
}, },
}} // Change the color of the primary text secondary: {
secondaryTypographyProps={{ style: {
style: { color:
color: direct?.address === selectedDirect?.address &&
direct?.address === selectedDirect?.address && theme.palette.text.primary,
theme.palette.text.primary, fontSize: '12px',
fontSize: '12px', },
}, },
}} }}
sx={{ sx={{
@ -1844,10 +1846,10 @@ export const Group = ({
</ListItem> </ListItem>
</List> </List>
))} ))}
</div> </Box>
<div <Box
style={{ sx={{
display: 'flex', display: 'flex',
width: '100%', width: '100%',
gap: '10px', gap: '10px',
@ -1871,6 +1873,7 @@ export const Group = ({
postProcess: 'capitalizeFirstChar', postProcess: 'capitalizeFirstChar',
})} })}
</CustomButton> </CustomButton>
{!isRunningPublicNode && ( {!isRunningPublicNode && (
<CustomButton <CustomButton
onClick={() => { onClick={() => {
@ -1888,8 +1891,8 @@ export const Group = ({
/> />
</CustomButton> </CustomButton>
)} )}
</div> </Box>
</div> </Box>
); );
}; };

View File

@ -59,7 +59,7 @@ export const GroupList = ({
const [isRunningPublicNode] = useAtom(isRunningPublicNodeAtom); const [isRunningPublicNode] = useAtom(isRunningPublicNodeAtom);
return ( return (
<div <Box
style={{ style={{
alignItems: 'flex-start', alignItems: 'flex-start',
background: theme.palette.background.surface, background: theme.palette.background.surface,
@ -178,8 +178,8 @@ export const GroupList = ({
</List> </List>
</div> </div>
<div <Box
style={{ sx={{
display: 'flex', display: 'flex',
gap: '10px', gap: '10px',
justifyContent: 'center', justifyContent: 'center',
@ -195,7 +195,7 @@ export const GroupList = ({
> >
<AddCircleOutlineIcon <AddCircleOutlineIcon
sx={{ sx={{
color: theme.palette.text.primary, color: theme.palette.text.secondary,
}} }}
/> />
{t('group:group.group', { postProcess: 'capitalizeFirstChar' })} {t('group:group.group', { postProcess: 'capitalizeFirstChar' })}
@ -213,14 +213,14 @@ export const GroupList = ({
> >
<PersonOffIcon <PersonOffIcon
sx={{ sx={{
color: theme.palette.text.primary, color: theme.palette.text.secondary,
}} }}
/> />
</CustomButton> </CustomButton>
)} )}
</> </>
</div> </Box>
</div> </Box>
); );
}; };
@ -294,20 +294,22 @@ const GroupItem = React.memo(
? 'no messages' ? 'no messages'
: `last message: ${formatEmailDate(group?.timestamp)}` : `last message: ${formatEmailDate(group?.timestamp)}`
} }
primaryTypographyProps={{ slotProps={{
style: { primary: {
color: style: {
group?.groupId === selectedGroup?.groupId && color:
theme.palette.text.primary, group?.groupId === selectedGroup?.groupId &&
fontSize: '16px', theme.palette.text.primary,
fontSize: '16px',
},
}, },
}} secondary: {
secondaryTypographyProps={{ style: {
style: { color:
color: group?.groupId === selectedGroup?.groupId &&
group?.groupId === selectedGroup?.groupId && theme.palette.text.primary,
theme.palette.text.primary, fontSize: '12px',
fontSize: '12px', },
}, },
}} }}
sx={{ sx={{