1
+ import Button from "@material-ui/core/Button"
1
2
import { makeStyles } from "@material-ui/core/styles"
2
3
import TableCell from "@material-ui/core/TableCell"
3
4
import { TemplateVersion } from "api/typesGenerated"
@@ -8,6 +9,7 @@ import { UserAvatar } from "components/UserAvatar/UserAvatar"
8
9
import { useClickableTableRow } from "hooks/useClickableTableRow"
9
10
import { useTranslation } from "react-i18next"
10
11
import { useNavigate } from "react-router-dom"
12
+ import { colors } from "theme/colors"
11
13
import { combineClasses } from "util/combineClasses"
12
14
13
15
export interface VersionRowProps {
@@ -32,6 +34,7 @@ export const VersionRow: React.FC<VersionRowProps> = ({
32
34
{ ...clickableProps }
33
35
className = { combineClasses ( {
34
36
[ clickableProps . className ] : true ,
37
+ [ styles . row ] : true ,
35
38
[ styles . active ] : isActive ,
36
39
} ) }
37
40
>
@@ -63,14 +66,39 @@ export const VersionRow: React.FC<VersionRowProps> = ({
63
66
</ span >
64
67
</ Stack >
65
68
</ Stack >
66
- { isActive && < Pill text = "Active version" type = "success" /> }
69
+ { isActive ? (
70
+ < Pill text = "Active version" type = "success" />
71
+ ) : (
72
+ < Button
73
+ size = "small"
74
+ variant = "outlined"
75
+ className = { styles . promoteButton }
76
+ >
77
+ Promote version
78
+ </ Button >
79
+ ) }
67
80
</ Stack >
68
81
</ TableCell >
69
82
</ TimelineEntry >
70
83
)
71
84
}
72
85
73
86
const useStyles = makeStyles ( ( theme ) => ( {
87
+ row : {
88
+ "&:hover $promoteButton" : {
89
+ color : theme . palette . text . primary ,
90
+ borderColor : colors . gray [ 11 ] ,
91
+ "&:hover" : {
92
+ borderColor : theme . palette . text . primary ,
93
+ } ,
94
+ } ,
95
+ } ,
96
+
97
+ promoteButton : {
98
+ color : theme . palette . text . secondary ,
99
+ transition : "none" ,
100
+ } ,
101
+
74
102
versionWrapper : {
75
103
padding : theme . spacing ( 2 , 4 ) ,
76
104
} ,
0 commit comments