File tree Expand file tree Collapse file tree 5 files changed +194
-244
lines changed Expand file tree Collapse file tree 5 files changed +194
-244
lines changed Original file line number Diff line number Diff line change 13
13
* It might not make sense to test this hook until the underlying design
14
14
* problems are fixed.
15
15
*/
16
- import { type CSSObject , useTheme } from "@emotion/react" ;
17
16
import type { TableRowProps } from "@mui/material/TableRow" ;
18
17
import type { MouseEventHandler } from "react" ;
19
18
import {
20
19
type ClickableAriaRole ,
21
20
type UseClickableResult ,
22
21
useClickable ,
23
22
} from "./useClickable" ;
23
+ import { cn } from "utils/cn" ;
24
24
25
25
type UseClickableTableRowResult <
26
26
TRole extends ClickableAriaRole = ClickableAriaRole ,
27
27
> = UseClickableResult < HTMLTableRowElement , TRole > &
28
28
TableRowProps & {
29
- css : CSSObject ;
29
+ className : string ;
30
30
hover : true ;
31
31
onAuxClick : MouseEventHandler < HTMLTableRowElement > ;
32
32
} ;
@@ -54,23 +54,13 @@ export const useClickableTableRow = <
54
54
onAuxClick : externalOnAuxClick ,
55
55
} : UseClickableTableRowConfig < TRole > ) : UseClickableTableRowResult < TRole > => {
56
56
const clickableProps = useClickable ( onClick , ( role ?? "button" ) as TRole ) ;
57
- const theme = useTheme ( ) ;
58
57
59
58
return {
60
59
...clickableProps ,
61
- css : {
62
- cursor : "pointer" ,
63
-
64
- "&:focus" : {
65
- outline : `1px solid ${ theme . palette . primary . main } ` ,
66
- outlineOffset : - 1 ,
67
- } ,
68
-
69
- "&:last-of-type" : {
70
- borderBottomLeftRadius : 8 ,
71
- borderBottomRightRadius : 8 ,
72
- } ,
73
- } ,
60
+ className : cn ( [
61
+ "cursor-pointer hover:outline focus:outline -outline-offset-1 outline-border-hover" ,
62
+ "first:rounded-t-md last:rounded-b-md" ,
63
+ ] ) ,
74
64
hover : true ,
75
65
onDoubleClick,
76
66
onAuxClick : ( event ) => {
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ const TemplateRow: FC<TemplateRowProps> = ({
102
102
) ;
103
103
const navigate = useNavigate ( ) ;
104
104
105
- const { css : clickableCss , ... clickableRow } = useClickableTableRow ( {
105
+ const clickableRow = useClickableTableRow ( {
106
106
onClick : ( ) => navigate ( templatePageLink ) ,
107
107
} ) ;
108
108
@@ -111,7 +111,7 @@ const TemplateRow: FC<TemplateRowProps> = ({
111
111
key = { template . id }
112
112
data-testid = { `template-${ template . id } ` }
113
113
{ ...clickableRow }
114
- css = { [ clickableCss , styles . tableRow ] }
114
+ css = { styles . tableRow }
115
115
>
116
116
< TableCell >
117
117
< AvatarData
Original file line number Diff line number Diff line change 1
- import { useTheme } from "@emotion/react" ;
2
1
import { Stack } from "components/Stack/Stack" ;
3
2
import { StatusIndicatorDot } from "components/StatusIndicator/StatusIndicator" ;
4
3
import dayjs from "dayjs" ;
@@ -12,8 +11,6 @@ interface LastUsedProps {
12
11
}
13
12
14
13
export const LastUsed : FC < LastUsedProps > = ( { lastUsedAt } ) => {
15
- const theme = useTheme ( ) ;
16
-
17
14
const [ circle , message ] = useTime ( ( ) => {
18
15
const t = dayjs ( lastUsedAt ) ;
19
16
const now = dayjs ( ) ;
@@ -40,7 +37,7 @@ export const LastUsed: FC<LastUsedProps> = ({ lastUsedAt }) => {
40
37
41
38
return (
42
39
< Stack
43
- style = { { color : theme . palette . text . secondary } }
40
+ className = " text-content- secondary"
44
41
direction = "row"
45
42
spacing = { 1 }
46
43
alignItems = "center"
@@ -49,4 +46,4 @@ export const LastUsed: FC<LastUsedProps> = ({ lastUsedAt }) => {
49
46
< span data-chromatic = "ignore" > { message } </ span >
50
47
</ Stack >
51
48
) ;
52
- } ;
49
+ } ;
Original file line number Diff line number Diff line change @@ -239,4 +239,4 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({
239
239
) }
240
240
</ Margins >
241
241
) ;
242
- } ;
242
+ } ;
You can’t perform that action at this time.
0 commit comments