Skip to content

Commit f3e471c

Browse files
committed
emotion: TimelineEntry
1 parent 9ebe071 commit f3e471c

File tree

1 file changed

+28
-38
lines changed

1 file changed

+28
-38
lines changed
Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { makeStyles } from "@mui/styles";
2-
import TableRow, { TableRowProps } from "@mui/material/TableRow";
1+
import TableRow, { type TableRowProps } from "@mui/material/TableRow";
32
import { type PropsWithChildren, forwardRef } from "react";
4-
import { combineClasses } from "utils/combineClasses";
53

64
type TimelineEntryProps = PropsWithChildren<
75
TableRowProps & {
@@ -13,47 +11,39 @@ export const TimelineEntry = forwardRef(function TimelineEntry(
1311
{ children, clickable = true, ...props }: TimelineEntryProps,
1412
ref?: React.ForwardedRef<HTMLTableRowElement>,
1513
) {
16-
const styles = useStyles();
17-
1814
return (
1915
<TableRow
2016
ref={ref}
21-
className={combineClasses({
22-
[styles.timelineEntry]: true,
23-
[styles.clickable]: clickable,
24-
})}
17+
css={(theme) => [
18+
{
19+
position: "relative",
20+
"&:focus": {
21+
outlineStyle: "solid",
22+
outlineOffset: -1,
23+
outlineWidth: 2,
24+
outlineColor: theme.palette.secondary.dark,
25+
},
26+
"& td:before": {
27+
position: "absolute",
28+
left: 50,
29+
display: "block",
30+
content: "''",
31+
height: "100%",
32+
width: 2,
33+
background: theme.palette.divider,
34+
},
35+
},
36+
clickable && {
37+
cursor: "pointer",
38+
39+
"&:hover": {
40+
backgroundColor: theme.palette.action.hover,
41+
},
42+
},
43+
]}
2544
{...props}
2645
>
2746
{children}
2847
</TableRow>
2948
);
3049
});
31-
32-
const useStyles = makeStyles((theme) => ({
33-
clickable: {
34-
cursor: "pointer",
35-
36-
"&:hover": {
37-
backgroundColor: theme.palette.action.hover,
38-
},
39-
},
40-
41-
timelineEntry: {
42-
position: "relative",
43-
"&:focus": {
44-
outlineStyle: "solid",
45-
outlineOffset: -1,
46-
outlineWidth: 2,
47-
outlineColor: theme.palette.secondary.dark,
48-
},
49-
"& td:before": {
50-
position: "absolute",
51-
left: 50,
52-
display: "block",
53-
content: "''",
54-
height: "100%",
55-
width: 2,
56-
background: theme.palette.divider,
57-
},
58-
},
59-
}));

0 commit comments

Comments
 (0)