V4.7-alpha (#985)

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-03-13 10:50:02 +08:00
committed by GitHub
parent 5bca15f12f
commit 9501c3f3a1
170 changed files with 5786 additions and 2342 deletions

View File

@@ -1,12 +1,14 @@
import React from 'react';
import { Tooltip, TooltipProps } from '@chakra-ui/react';
import { Tooltip, TooltipProps, useMediaQuery } from '@chakra-ui/react';
interface Props extends TooltipProps {
forceShow?: boolean;
}
const MyTooltip = ({ children, shouldWrapChildren = true, ...props }: Props) => {
return (
const MyTooltip = ({ children, forceShow = false, shouldWrapChildren = true, ...props }: Props) => {
const [isPc] = useMediaQuery('(min-width: 900px)');
return isPc || forceShow ? (
<Tooltip
className="tooltip"
bg={'white'}
@@ -25,6 +27,8 @@ const MyTooltip = ({ children, shouldWrapChildren = true, ...props }: Props) =>
>
{children}
</Tooltip>
) : (
<>{children}</>
);
};