-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathSelectClientButtons.tsx
80 lines (74 loc) · 1.94 KB
/
SelectClientButtons.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React from 'react';
import styled from 'styled-components';
import { LinkProps } from 'react-router-dom';
import { useIntl } from 'react-intl';
import { Button } from '../../components/Button';
import { Link } from '../../components/Link';
import { routesEnum } from '../../Routes';
import { ClientId } from '../../store/actions/clientActions';
const Container = styled.div`
display: flex;
justify-content: center;
align-items: center;
padding: 30px;
gap: 10px;
@media (max-width: ${p => p.theme.screenSizes.small}) {
flex-direction: column;
padding-inline: 0;
button,
a {
width: 100% !important;
}
}
`;
type Props = {
ethClientStep: 'execution' | 'consensus';
currentClient: ClientId;
handleSubmit: LinkProps['onClick'];
updateStep: (nextStep: 'execution' | 'consensus') => void;
};
const SelectClientButtons = ({
ethClientStep,
currentClient,
handleSubmit,
updateStep,
}: Props) => {
const { formatMessage } = useIntl();
if (ethClientStep === 'execution') {
return (
<Container>
<Link to={routesEnum.acknowledgementPage}>
<Button
width={100}
label={formatMessage({ defaultMessage: 'Back' })}
/>
</Link>
<Button
width={300}
rainbow
disabled={!currentClient}
label={formatMessage({ defaultMessage: 'Continue' })}
onClick={() => updateStep('consensus')}
/>
</Container>
);
}
return (
<Container>
<Button
width={100}
label={formatMessage({ defaultMessage: 'Back' })}
onClick={() => updateStep('execution')}
/>
<Link to={routesEnum.generateKeysPage} onClick={handleSubmit}>
<Button
width={300}
rainbow
disabled={!currentClient}
label={formatMessage({ defaultMessage: 'Continue' })}
/>
</Link>
</Container>
);
};
export default SelectClientButtons;