Fixes rows not having hover affect if they are shaded red.

This commit is contained in:
SergeantPanda 2025-05-03 10:41:18 -05:00
parent 5fa9a1e64d
commit d4ae98900f
3 changed files with 19 additions and 3 deletions

View file

@ -743,7 +743,9 @@ const ChannelsTable = ({ }) => {
const hasStreams = row.original.streams && row.original.streams.length > 0;
return hasStreams
? {} // Default style for channels with streams
: { backgroundColor: 'rgba(255, 0, 0, 0.15)' }; // Increase opacity to 15% for better visibility
: {
className: 'no-streams-row' // Add a class instead of background color
};
}
});

View file

@ -76,18 +76,22 @@ const CustomTableBody = ({
// Get custom styles for this row if the function exists
const customRowStyles = getRowStyles ? getRowStyles(row) : {};
// Extract any className from customRowStyles
const customClassName = customRowStyles.className || '';
delete customRowStyles.className; // Remove from object so it doesn't get applied as inline style
return (
<Box style={style} key={`row-${row.id}`}>
<Box
key={`tr-${row.id}`}
className={`tr ${index % 2 == 0 ? 'tr-even' : 'tr-odd'}`}
className={`tr ${index % 2 == 0 ? 'tr-even' : 'tr-odd'} ${customClassName}`}
style={{
display: 'flex',
width: '100%',
...(row.getIsSelected() && {
backgroundColor: '#163632',
}),
...customRowStyles, // Apply the custom styles here
...customRowStyles, // Apply the remaining custom styles here
}}
>
{row.getVisibleCells().map((cell) => {

View file

@ -93,6 +93,16 @@ html {
background-color: #27272A;
}
/* Style for rows with no streams */
.no-streams-row {
background-color: rgba(255, 68, 68, 0.15) !important;
}
/* Make sure hover effect still works on rows with no streams */
.table-striped .tbody .tr.no-streams-row:hover {
background-color: rgb(68, 68, 68) !important;
}
/* Prevent text selection when shift key is pressed */
.shift-key-active {
cursor: pointer !important;