Skip to content
Open
Changes from all commits
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
123 changes: 78 additions & 45 deletions src/components/Contacts/ContactRow/ContactRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,57 +106,90 @@
</ListItemIcon>
</Hidden>
<Grid container alignItems="center">
<Grid item xs={10} md={6} style={{ paddingRight: 16 }}>
<ListItemText
primary={
<Typography component="span" variant="h6" noWrap>
<Box
component="span"
sx={{
display: 'block',
alignItems: 'center',
overflow: 'clip',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
}}
>
{name}
<CelebrationIcons contact={contact} />
</Box>
</Typography>
}
secondary={
primaryAddress && (
<Hidden smDown>
<Typography component="span" variant="body2">
{[
primaryAddress.street,
`${primaryAddress.city}${primaryAddress.city && ','}`,
primaryAddress.state,
primaryAddress.postalCode,
]
.filter(Boolean)
.join(' ')}
<Grid item xs={10} md={6}>
<Box
sx={{
display: 'grid',
alignItems: 'center',
}}
>
<Box
sx={{
overflow: 'hidden',
}}
>
<ListItemText
primary={
<Typography component="span" variant="h6" noWrap>
<Box
component="span"
sx={{
display: 'block',
alignItems: 'center',
overflow: 'clip',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
}}
>
{name}
<CelebrationIcons contact={contact} />
</Box>
</Typography>
</Hidden>
)
}
/>
}
secondary={
primaryAddress && (
<Hidden smDown>
<Typography
component="span"
variant="body2"
sx={{
display: 'block',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}
>
{[
primaryAddress.street,
`${primaryAddress.city}${primaryAddress.city && ','}`,
primaryAddress.state,
primaryAddress.postalCode,
]
.filter(Boolean)
.join(' ')}
</Typography>
</Hidden>
)
}
/>
</Box>
</Box>
</Grid>
<Grid item xs={2} md={6}>
<ContactPartnershipStatus
contactDetailsOpen={contactDetailsOpen}
lateAt={lateAt}
pledgeAmount={pledgeAmount}
pledgeCurrency={pledgeCurrency}
pledgeFrequency={pledgeFrequency}
pledgeReceived={pledgeReceived}
status={status}
/>
<Box
sx={{
display: 'flex',
}}
>
<ContactPartnershipStatus
contactDetailsOpen={contactDetailsOpen}
lateAt={lateAt}
pledgeAmount={pledgeAmount}
pledgeCurrency={pledgeCurrency}
pledgeFrequency={pledgeFrequency}
pledgeReceived={pledgeReceived}
status={status}
/>
</Box>
</Grid>
</Grid>
<Hidden xsDown>
<Box onClick={(event) => event.preventDefault()}>
<Box
onClick={(event) => event.preventDefault()}
sx={{
minWidth: (theme) => theme.spacing(10),
}}
>

Check warning on line 192 in src/components/Contacts/ContactRow/ContactRow.tsx

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Large Method

ContactRow:React.FC<Props> has 150 lines, threshold = 120. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
<ContactUncompletedTasksCount
uncompletedTasksCount={uncompletedTasksCount}
contactId={contactId}
Expand Down