Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [M3-6950] - Restored longview active table rows and arrow #9643

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-9643-fixed-1694103276021.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Fixed selected state of longview processes table ([#9643](https://github.com/linode/manager/pull/9643))
75 changes: 29 additions & 46 deletions packages/manager/src/components/TableRow/TableRow.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export const StyledTableRow = styled(_TableRow, {
},
},
},
'&:before': {

'&.Mui-selected': {
'&:hover': {
backgroundColor: theme.bg.lightBlue1,
},
backgroundColor: theme.bg.lightBlue1,
borderColor: theme.borderColors.borderTable,
transition: 'none',
boxShadow: `inset 3px 0 0 ${theme.bg.lightBlue1}`,
},
backgroundColor: theme.bg.lightBlue1,
boxShadow: `inset 3px 0 0 ${theme.bg.lightBlue1}`,
transform: 'scale(1)',
}),
...(props.highlight && {
Expand All @@ -68,52 +69,34 @@ export const StyledTableRow = styled(_TableRow, {

export const StyledTableDataCell = styled('td', {
label: 'StyledTableDataCell',
})(() => ({
padding: 0,
}));

export const StyledActiveCaret = styled('span', {
label: 'StyledActiveCaret',
})(({ theme }) => ({
'&:after': {
background: `linear-gradient(to right bottom, ${theme.palette.primary.light} 0%, ${theme.palette.primary.light} 49%, transparent 50.1%)`,
content: '""',
height: '50%',
left: 0,
border: 'solid',
borderColor: 'rgba(136, 183, 213, 0)',
borderLeftColor: theme.bg.lightBlue1,
borderWidth: '19px',
content: "''",
height: 0,
left: '100%',
pointerEvents: 'none',
position: 'absolute',
top: '50%',
width: 15,
top: 'calc(50% - 1px)',
transform: 'translateY(-50%)',
width: 0,
},
'&:before': {
background: `linear-gradient(to right top, ${theme.palette.primary.light} 0%, ${theme.palette.primary.light} 49%, transparent 50.1%)`,
content: '""',
height: '50%',
left: 0,
border: 'solid',
borderColor: 'rgba(194, 225, 245, 0)',
borderLeftColor: theme.palette.primary.light,
borderWidth: '20px',
content: "''",
height: 0,
left: '100%',
pointerEvents: 'none',
position: 'absolute',
top: 0,
width: 15,
},
}));

export const StyledActiveCaretOverlay = styled('span', {
label: 'StyledActiveCaretOverlay',
})(({ theme }) => ({
'&:after': {
background: `linear-gradient(to right bottom, ${theme.bg.lightBlue1} 0%, ${theme.bg.lightBlue1} 45%, transparent 46.1%)`,
bottom: 0,
content: '""',
height: '50%',
left: 0,
position: 'absolute',
width: 15,
},
'&:before': {
background: `linear-gradient(to right top, ${theme.bg.lightBlue1} 0%, ${theme.bg.lightBlue1} 45%, transparent 46.1%)`,
content: '""',
height: '50%',
left: 0,
position: 'absolute',
top: 0,
width: 15,
top: 'calc(50% - 1px)',
transform: 'translateY(-50%)',
width: 0,
},
padding: 0,
}));
13 changes: 3 additions & 10 deletions packages/manager/src/components/TableRow/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import * as React from 'react';

import { Hidden } from 'src/components/Hidden';

import {
StyledActiveCaret,
StyledActiveCaretOverlay,
StyledTableDataCell,
StyledTableRow,
} from './TableRow.styles';
import { StyledTableDataCell, StyledTableRow } from './TableRow.styles';

export interface TableRowProps extends _TableRowProps {
ariaLabel?: string;
Expand All @@ -29,15 +24,13 @@ export const TableRow = React.memo((props: TableRowProps) => {
<StyledTableRow
aria-label={ariaLabel ?? `View Details`}
ref={domRef}
selected={selected}
{...rest}
>
{props.children}
{selected && (
<Hidden lgDown>
<StyledTableDataCell>
<StyledActiveCaret />
<StyledActiveCaretOverlay />
</StyledTableDataCell>
<StyledTableDataCell />
</Hidden>
)}
</StyledTableRow>
Expand Down