-
Notifications
You must be signed in to change notification settings - Fork 30
/
PromotePipeline.tsx
43 lines (39 loc) · 1.07 KB
/
PromotePipeline.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
import { Button, Flex } from '@weaveworks/weave-gitops';
import styled from 'styled-components';
import { ApprovePromotionRequest } from '../../../api/pipelines/pipelines.pb';
import { useApprove } from '../../../hooks/pipelines';
const PromotionButton = styled(Button)`
&.MuiButton-root {
background: ${props => props.theme.colors.white};
border-radius: 16px;
&.MuiButton-outlined {
border-color: ${props => props.theme.colors.neutral20};
}
&.Mui-disabled {
color: ${props => props.theme.colors.neutral20};
}
}
`;
const PromotePipeline = ({
className,
req,
promoteVersion,
}: {
className?: string;
req: ApprovePromotionRequest;
promoteVersion: string;
}) => {
const approve = useApprove();
return (
<Flex column gap="8" className={className}>
<PromotionButton
onClick={() => approve.mutateAsync(req)}
disabled={approve.isLoading || !promoteVersion}
loading={approve.isLoading}
>
Approve Promotion
</PromotionButton>
</Flex>
);
};
export default styled(PromotePipeline)``;