@@ -28,6 +28,7 @@ import { EmptyState } from "../../components/EmptyState/EmptyState"
28
28
import { Margins } from "../../components/Margins/Margins"
29
29
import { PageHeader , PageHeaderSubtitle , PageHeaderTitle } from "../../components/PageHeader/PageHeader"
30
30
import { Stack } from "../../components/Stack/Stack"
31
+ import { TableCellLink } from "../../components/TableCellLink/TableCellLink"
31
32
import { TableLoader } from "../../components/TableLoader/TableLoader"
32
33
import {
33
34
HelpTooltip ,
@@ -104,27 +105,25 @@ const WorkspaceRow: React.FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ wor
104
105
const [ workspaceState , send ] = useActor ( workspaceRef )
105
106
const { data : workspace } = workspaceState . context
106
107
const status = getDisplayStatus ( theme , workspace . latest_build )
107
- const navigateToWorkspacePage = ( ) => {
108
- navigate ( `/@${ workspace . owner_name } /${ workspace . name } ` )
109
- }
108
+ const workspacePageLink = `/@${ workspace . owner_name } /${ workspace . name } `
109
+
110
110
return (
111
111
< TableRow
112
112
hover
113
113
data-testid = { `workspace-${ workspace . id } ` }
114
114
tabIndex = { 0 }
115
- onClick = { navigateToWorkspacePage }
116
115
onKeyDown = { ( event ) => {
117
116
if ( event . key === "Enter" ) {
118
- navigateToWorkspacePage ( )
117
+ navigate ( workspacePageLink )
119
118
}
120
119
} }
121
120
className = { styles . clickableTableRow }
122
121
>
123
- < TableCell >
122
+ < TableCellLink to = { workspacePageLink } >
124
123
< AvatarData title = { workspace . name } subtitle = { workspace . owner_name } />
125
- </ TableCell >
126
- < TableCell > { workspace . template_name } </ TableCell >
127
- < TableCell >
124
+ </ TableCellLink >
125
+ < TableCellLink to = { workspacePageLink } > { workspace . template_name } </ TableCellLink >
126
+ < TableCellLink to = { workspacePageLink } >
128
127
{ workspace . outdated ? (
129
128
< span className = { styles . outdatedLabel } >
130
129
{ Language . outdatedLabel }
@@ -137,20 +136,20 @@ const WorkspaceRow: React.FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ wor
137
136
) : (
138
137
< span style = { { color : theme . palette . text . secondary } } > { Language . upToDateLabel } </ span >
139
138
) }
140
- </ TableCell >
141
- < TableCell >
139
+ </ TableCellLink >
140
+ < TableCellLink to = { workspacePageLink } >
142
141
< span data-chromatic = "ignore" style = { { color : theme . palette . text . secondary } } >
143
142
{ dayjs ( ) . to ( dayjs ( workspace . latest_build . created_at ) ) }
144
143
</ span >
145
- </ TableCell >
146
- < TableCell >
144
+ </ TableCellLink >
145
+ < TableCellLink to = { workspacePageLink } >
147
146
< span style = { { color : status . color } } > { status . status } </ span >
148
- </ TableCell >
149
- < TableCell >
147
+ </ TableCellLink >
148
+ < TableCellLink to = { workspacePageLink } >
150
149
< div className = { styles . arrowCell } >
151
150
< KeyboardArrowRight className = { styles . arrowRight } />
152
151
</ div >
153
- </ TableCell >
152
+ </ TableCellLink >
154
153
</ TableRow >
155
154
)
156
155
}
@@ -349,8 +348,6 @@ const useStyles = makeStyles((theme) => ({
349
348
} ,
350
349
} ,
351
350
clickableTableRow : {
352
- cursor : "pointer" ,
353
-
354
351
"&:hover td" : {
355
352
backgroundColor : fade ( theme . palette . primary . light , 0.1 ) ,
356
353
} ,
0 commit comments