Prevent tooltip on disabled button warning
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Button from '@mui/material/Button';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { CustomTooltip } from '@/modules/core/components/CustomTooltip.tsx';
|
||||
import { MultiValueButtonProps } from '@/modules/core/Core.types.ts';
|
||||
import { Superscript } from '@/modules/core/components/Superscript.tsx';
|
||||
|
||||
@@ -39,7 +39,7 @@ export const ButtonSelect = <Value extends string | number>({
|
||||
: t(valueToDisplayData[displayValue].title);
|
||||
|
||||
return (
|
||||
<Tooltip key={displayValue} title={isDefault ? t('reader.settings.active_setting') : ''}>
|
||||
<CustomTooltip key={displayValue} title={isDefault ? t('reader.settings.active_setting') : ''}>
|
||||
<Button
|
||||
onClick={() => setValue(displayValue)}
|
||||
variant={displayValue === value ? 'contained' : 'outlined'}
|
||||
@@ -47,7 +47,7 @@ export const ButtonSelect = <Value extends string | number>({
|
||||
>
|
||||
{isDefault ? <Superscript i18nKey="global.label.footnote" value={text} /> : text}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</CustomTooltip>
|
||||
);
|
||||
})}
|
||||
</Stack>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
import Button, { ButtonProps } from '@mui/material/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import RestartAltIcon from '@mui/icons-material/RestartAlt';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import IconButton, { IconButtonProps } from '@mui/material/IconButton';
|
||||
import { CustomTooltip } from '@/modules/core/components/CustomTooltip.tsx';
|
||||
|
||||
type PropsIconButton = { asIconButton: true } & IconButtonProps;
|
||||
type PropsButton = { asIconButton?: false } & ButtonProps;
|
||||
@@ -21,11 +21,11 @@ export const ResetButton = ({ asIconButton, ...props }: Props) => {
|
||||
|
||||
if (asIconButton) {
|
||||
return (
|
||||
<Tooltip title={t('global.button.reset')}>
|
||||
<CustomTooltip title={t('global.button.reset')}>
|
||||
<IconButton color="inherit" {...props}>
|
||||
<RestartAltIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</CustomTooltip>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ReactNode, useMemo } from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { CustomTooltip } from '@/modules/core/components/CustomTooltip.tsx';
|
||||
import { MultiValueButtonProps } from '@/modules/core/Core.types.ts';
|
||||
import { getNextRotationValue } from '@/modules/core/utils/ValueRotationButton.utils.ts';
|
||||
import { Superscript } from '@/modules/core/components/Superscript.tsx';
|
||||
@@ -37,7 +37,7 @@ export const ValueRotationButton = <Value extends string | number>({
|
||||
}, [value, values]);
|
||||
|
||||
return (
|
||||
<Tooltip title={tooltip}>
|
||||
<CustomTooltip title={tooltip}>
|
||||
{isDefault ? (
|
||||
<Button
|
||||
onClick={() => setValue(values[0])}
|
||||
@@ -81,6 +81,6 @@ export const ValueRotationButton = <Value extends string | number>({
|
||||
: t(valueToDisplayData[value].title)}
|
||||
</Button>
|
||||
)}
|
||||
</Tooltip>
|
||||
</CustomTooltip>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user