-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.tsx
58 lines (53 loc) · 1.48 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// FlakyTestButton Component
/**
* Button that initiates query and redirects to a flaky test page
* @packageDocumentation
*/
import React from 'react';
import styled from 'styled-components';
import Button from '@material-ui/core/Button';
import DirectionsRunIcon from '@material-ui/icons/DirectionsRun';
import CircularProgress from '@material-ui/core/CircularProgress';
const ButtonContainer = styled(Button)`
height: 56px;
margin-right: 8px !important;
margin-top: auto !important;
margin-bottom: auto !important;
text-transform: none !important;
font-size: 17px !important;
`;
const TextContainer = styled.span`
margin-left: 4px;
`;
const TableSpinner = styled(CircularProgress)`
color: #6e6e6e !important;
`;
/** FlakyTestButton Props */
interface Props {
/** Callback fired on click*/
onClick: () => void;
/** Disabled if true */
disabled: boolean;
/** Show spinner if true */
showSpinner: boolean;
}
/** FlakyTestButton Component */
export const FlakyTestButton: React.FC<Props> = ({
onClick,
disabled,
showSpinner,
}) => {
return (
<ButtonContainer
variant="outlined"
onClick={onClick}
title={'Flaky Tests'}
disabled={disabled}
>
{showSpinner && <TableSpinner size={25} />}
{!showSpinner && <DirectionsRunIcon />}
<TextContainer>{'Flaky '}</TextContainer>
</ButtonContainer>
);
};
export default FlakyTestButton;