-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathSessionToastContainer.tsx
More file actions
57 lines (54 loc) · 1.4 KB
/
SessionToastContainer.tsx
File metadata and controls
57 lines (54 loc) · 1.4 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
48
49
50
51
52
53
54
55
56
57
import { Slide, ToastContainer, ToastContainerProps } from 'react-toastify';
import styled from 'styled-components';
import { isTestIntegration } from '../shared/env_vars';
// NOTE: https://styled-components.com/docs/faqs#how-can-i-override-styles-with-higher-specificity
const StyledToastContainer = styled(ToastContainer)`
&&&.Toastify__toast-container {
}
.Toastify__toast {
background: var(--toast-background-color);
color: var(--text-primary-color);
border-left: 4px solid var(--primary-color);
}
.Toastify__toast--error {
}
.Toastify__toast--warning {
}
.Toastify__toast--success {
}
.Toastify__toast-body {
line-height: 1.4;
}
.Toastify__progress-bar {
background-color: rgba(0, 0, 0, 0.1);
}
.Toastify__close-button {
color: var(--text-primary-color);
}
`;
const WrappedToastContainer = ({
className,
...rest
}: ToastContainerProps & { className?: string }) => (
<div className={className}>
<StyledToastContainer {...rest} />
</div>
);
export const SessionToastContainer = () => {
return (
<WrappedToastContainer
position="bottom-right"
autoClose={isTestIntegration() ? 1000 : 5000}
hideProgressBar={true}
newestOnTop={true}
closeOnClick={true}
rtl={false}
pauseOnFocusLoss={false}
draggable={false}
pauseOnHover={true}
transition={Slide}
limit={5}
icon={false}
/>
);
};