Skip to content

Commit 848c5ba

Browse files
update for light mode
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
1 parent 4d31901 commit 848c5ba

3 files changed

Lines changed: 27 additions & 48 deletions

File tree

src/custom/CollaboratorAvatarGroup/CollaboratorAvatarGroup.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ const CollaboratorAvatarGroup = ({
144144
return (
145145
<CustomTooltip
146146
key={clientID}
147-
useThemeColors={true} // Enable theme-based colors
148147
title={
149148
<div style={{ display: 'flex', justifyContent: 'center', flexDirection: 'column' }}>
150149
<Typography

src/custom/CustomTooltip/customTooltip.tsx

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import _ from 'lodash';
21
import React from 'react';
3-
import { useTheme } from '@mui/material/styles';
42
import { Tooltip, TooltipProps } from '../../base';
5-
import { WHITE } from '../../theme';
3+
import { useTheme } from '../../theme';
64
import { RenderMarkdownTooltip } from '../Markdown';
75

86
type CustomTooltipProps = {
@@ -12,9 +10,6 @@ type CustomTooltipProps = {
1210
fontSize?: string;
1311
fontWeight?: number;
1412
variant?: 'standard' | 'small';
15-
bgColor?: string;
16-
textColor?: string;
17-
useThemeColors?: boolean;
1813
componentsProps?: TooltipProps['componentsProps'];
1914
} & Omit<TooltipProps, 'title' | 'onClick'>;
2015

@@ -26,55 +21,41 @@ function CustomTooltip({
2621
fontSize,
2722
fontWeight = 400,
2823
variant = 'standard',
29-
bgColor = '#141414',
30-
textColor = WHITE,
31-
useThemeColors = false,
3224
componentsProps = {},
3325
...props
3426
}: CustomTooltipProps): JSX.Element {
3527
const theme = useTheme();
36-
37-
const tooltipBgColor = useThemeColors
38-
? theme.palette.background.paper
39-
: bgColor;
40-
41-
const tooltipTextColor = useThemeColors
42-
? theme.palette.text.primary
43-
: textColor;
28+
4429
return (
4530
<Tooltip
4631
enterTouchDelay={0}
4732
leaveTouchDelay={2000}
48-
componentsProps={_.merge(
49-
{
50-
tooltip: {
51-
sx: {
52-
background: tooltipBgColor,
53-
color: tooltipTextColor,
54-
maxWidth: '600px',
55-
fontSize: fontSize || (variant === 'standard' ? '1rem' : '0.75rem'),
56-
fontWeight: { fontWeight },
57-
borderRadius: '0.5rem',
58-
padding: variant === 'standard' ? '0.9rem' : '0.5rem 0.75rem',
59-
boxShadow: useThemeColors
60-
? theme.shadows[4]
61-
: 'rgba(0, 0, 0, 0.6) 0px 4px 10px, rgba(0, 0, 0, 0.5) 0px 2px 4px'
62-
}
63-
},
64-
popper: {
65-
sx: {
66-
zIndex: 9999999999,
67-
opacity: '1'
68-
}
69-
},
70-
arrow: {
71-
sx: {
72-
color: tooltipBgColor
73-
}
33+
componentsProps={{
34+
tooltip: {
35+
sx: {
36+
background: theme.palette.background.paper,
37+
color: theme.palette.text.primary,
38+
maxWidth: '600px',
39+
fontSize: fontSize || (variant === 'standard' ? '1rem' : '0.75rem'),
40+
fontWeight: { fontWeight },
41+
borderRadius: '0.5rem',
42+
padding: variant === 'standard' ? '0.9rem' : '0.5rem 0.75rem',
43+
boxShadow: theme.shadows[4]
44+
}
45+
},
46+
popper: {
47+
sx: {
48+
zIndex: 9999999999,
49+
opacity: '1'
50+
}
51+
},
52+
arrow: {
53+
sx: {
54+
color: theme.palette.background.paper
7455
}
7556
},
76-
componentsProps
77-
)}
57+
...componentsProps
58+
}}
7859
title={typeof title === 'string' ? <RenderMarkdownTooltip content={title} /> : title}
7960
placement={placement}
8061
arrow

src/custom/Markdown/style.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { styled } from '@mui/material';
2-
import { text } from '../../theme/colors/colors';
32

43
export const StyledMarkdown = styled('a')(({ theme }) => ({
54
color: theme.palette.background.brand?.default,
@@ -28,7 +27,7 @@ export const StyledMarkdownP = styled('p')(({ theme }) => ({
2827
}));
2928

3029
export const StyledMarkdownTooltipP = styled('p')(({ theme }) => ({
31-
color: theme.palette.text.constant?.white || text.inverse,
30+
color: theme.palette.text.primary,
3231
marginBlock: '0px',
3332
fontFamily: 'inherit'
3433
}));

0 commit comments

Comments
 (0)