Skip to content

Commit

Permalink
Merge pull request #693 from sudhanshutech/table/tooltip
Browse files Browse the repository at this point in the history
Add `customtooltip` as default for tables and fix around it
  • Loading branch information
dragon-slayer875 authored Jul 29, 2024
2 parents b18a230 + a7e6225 commit 47ac900
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/custom/CustomTooltip/customTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function CustomTooltip({
onClick={onClick}
{...props}
>
{children}
<div>{children}</div>
</Tooltip>
);
}
Expand Down
8 changes: 7 additions & 1 deletion src/custom/ResponsiveDataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Theme, ThemeProvider, createTheme } from '@mui/material';
import MUIDataTable from 'mui-datatables';
import React, { useCallback } from 'react';
import { CustomTooltip } from './CustomTooltip';

const dataTableTheme = (theme: Theme) =>
createTheme({
...theme,
components: {
...theme.components,
MuiTable: {
styleOverrides: {
root: {
Expand Down Expand Up @@ -253,7 +256,10 @@ const ResponsiveDataTable = ({
columns={tableCols ?? []}
data={data || []}
title={undefined}
components={components}
components={{
Tooltip: CustomTooltip as unknown as React.ReactNode,
...components
}}
options={updatedOptions}
{...props}
/>
Expand Down

0 comments on commit 47ac900

Please sign in to comment.