-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathBackButton.tsx
More file actions
47 lines (42 loc) · 1.16 KB
/
BackButton.tsx
File metadata and controls
47 lines (42 loc) · 1.16 KB
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
import { Tooltip } from '@components';
import KeyboardBackspaceIcon from '@mui/icons-material/KeyboardBackspace';
import { Button } from 'antd';
import React from 'react';
import styled from 'styled-components';
const StyledButton = styled(Button)`
height: 25px;
width: 25px;
color: ${(p) => p.theme.colors.iconBrand};
padding: 0px;
border-radius: 20px;
border: 1px solid ${(p) => p.theme.colors.borderBrand};
display: flex;
align-items: center;
justify-content: center;
margin-left: -4px;
margin-right: 10px;
margin-top: 2px;
&:hover {
color: ${(p) => p.theme.colors.iconBrand};
border-color: ${(p) => p.theme.colors.borderBrand};
}
`;
const StyledLeftOutlined = styled(KeyboardBackspaceIcon)`
&& {
font-size: 20px;
margin: 0px;
padding 0px;
}
`;
interface Props {
onGoBack?: () => void;
}
export const BackButton = ({ onGoBack }: Props) => {
return (
<Tooltip title="Go back" showArrow={false} placement="bottom">
<StyledButton onClick={onGoBack}>
<StyledLeftOutlined />
</StyledButton>
</Tooltip>
);
};