Skip to content

Commit 89a661b

Browse files
committed
Reverted Custom tooltip Changes
Signed-off-by: SplinterSword <sparshj2003@gmail.com>
1 parent 5564100 commit 89a661b

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

src/custom/CustomTooltip/customTooltip.tsx

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import _ from 'lodash';
22
import React from 'react';
3-
import type { Theme } from '@mui/material/styles';
4-
import { alpha, useTheme } from '@mui/material';
53
import { Tooltip, TooltipProps } from '../../base';
64
import { WHITE } from '../../theme';
75
import { RenderMarkdownTooltip } from '../Markdown';
@@ -29,12 +27,10 @@ function CustomTooltip({
2927
componentsProps = {},
3028
...props
3129
}: CustomTooltipProps): JSX.Element {
32-
const theme = useTheme();
33-
3430
return (
3531
<Tooltip
3632
enterDelay={150}
37-
enterNextDelay={400}
33+
enterNextDelay={400} //->delay when moving between siblings
3834
leaveDelay={700}
3935
componentsProps={_.merge(
4036
{
@@ -44,36 +40,23 @@ function CustomTooltip({
4440
color: WHITE,
4541
maxWidth: '600px',
4642
fontSize: fontSize || (variant === 'standard' ? '1rem' : '0.75rem'),
47-
fontWeight,
43+
fontWeight: { fontWeight },
4844
borderRadius: '0.5rem',
4945
padding: variant === 'standard' ? '0.9rem' : '0.5rem 0.75rem',
50-
boxShadow: (themeArg?: Theme) => {
51-
const t = themeArg || theme;
52-
const isDefaultTheme = t.palette.primary.main === '#1976d2';
53-
console.log(isDefaultTheme)
54-
55-
if (t?.palette?.mode === 'light' && !isDefaultTheme) {
56-
return 'rgba(0, 0, 0, 0.6) 0px 4px 10px, rgba(0, 0, 0, 0.5) 0px 2px 4px';
57-
}
58-
59-
const green = '#00B39F';
60-
return `0 10px 30px ${alpha(green, 0.28)},
61-
0 2px 8px ${alpha(green, 0.2)},
62-
0 0 1px ${alpha(green, 0.32)}`;
63-
},
64-
},
46+
boxShadow: 'rgba(0, 0, 0, 0.6) 0px 4px 10px, rgba(0, 0, 0, 0.5) 0px 2px 4px'
47+
}
6548
},
6649
popper: {
6750
sx: {
6851
zIndex: 9999999999,
69-
opacity: '1',
70-
},
52+
opacity: '1'
53+
}
7154
},
7255
arrow: {
7356
sx: {
74-
color: bgColor,
75-
},
76-
},
57+
color: bgColor
58+
}
59+
}
7760
},
7861
componentsProps
7962
)}

0 commit comments

Comments
 (0)