@@ -5,6 +5,7 @@ import { ProvisionerJobLog } from "../../api/typesGenerated"
5
5
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
6
6
import { Logs } from "../Logs/Logs"
7
7
import Box from "@mui/material/Box"
8
+ import { combineClasses } from "utils/combineClasses"
8
9
9
10
const Language = {
10
11
seconds : "seconds" ,
@@ -40,11 +41,13 @@ const getStageDurationInSeconds = (logs: ProvisionerJobLog[]) => {
40
41
41
42
export type WorkspaceBuildLogsProps = {
42
43
logs : ProvisionerJobLog [ ]
44
+ sticky ?: boolean
43
45
hideTimestamps ?: boolean
44
46
} & ComponentProps < typeof Box >
45
47
46
48
export const WorkspaceBuildLogs : FC < WorkspaceBuildLogsProps > = ( {
47
49
hideTimestamps,
50
+ sticky,
48
51
logs,
49
52
...boxProps
50
53
} ) => {
@@ -75,7 +78,12 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
75
78
76
79
return (
77
80
< Fragment key = { stage } >
78
- < div className = { styles . header } >
81
+ < div
82
+ className = { combineClasses ( [
83
+ styles . header ,
84
+ sticky ? styles . sticky : "" ,
85
+ ] ) }
86
+ >
79
87
< div > { stage } </ div >
80
88
{ shouldDisplayDuration && (
81
89
< div className = { styles . duration } >
@@ -100,8 +108,6 @@ const useStyles = makeStyles((theme) => ({
100
108
alignItems : "center" ,
101
109
fontFamily : "Inter" ,
102
110
borderBottom : `1px solid ${ theme . palette . divider } ` ,
103
- position : "sticky" ,
104
- top : 0 ,
105
111
background : theme . palette . background . default ,
106
112
107
113
"&:last-child" : {
@@ -114,6 +120,11 @@ const useStyles = makeStyles((theme) => ({
114
120
} ,
115
121
} ,
116
122
123
+ sticky : {
124
+ position : "sticky" ,
125
+ top : 0 ,
126
+ } ,
127
+
117
128
duration : {
118
129
marginLeft : "auto" ,
119
130
color : theme . palette . text . secondary ,
0 commit comments