mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
chore: code style optimization (#43865)
This commit is contained in:
parent
a96e1bf04e
commit
3ac6308f2e
@ -5,6 +5,7 @@ import RcTree from 'rc-tree';
|
||||
import type { DataNode, Key } from 'rc-tree/lib/interface';
|
||||
import type { Component } from 'react';
|
||||
import React from 'react';
|
||||
import type { CSSMotionProps } from 'rc-motion';
|
||||
import initCollapseMotion from '../_util/motion';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import useStyle from './style';
|
||||
@ -175,7 +176,7 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
|
||||
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
|
||||
const motion = customMotion ?? {
|
||||
const motion: CSSMotionProps = customMotion ?? {
|
||||
...initCollapseMotion(rootPrefixCls),
|
||||
motionAppear: false,
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ type WalkingState =
|
||||
| typeof DONE_WITH_ELLIPSIS
|
||||
| typeof DONE_WITHOUT_ELLIPSIS;
|
||||
|
||||
const Ellipsis = ({
|
||||
const Ellipsis: React.FC<EllipsisProps> = ({
|
||||
enabledMeasure,
|
||||
children,
|
||||
text,
|
||||
@ -82,7 +82,7 @@ const Ellipsis = ({
|
||||
fontSize,
|
||||
rows,
|
||||
onEllipsis,
|
||||
}: EllipsisProps) => {
|
||||
}) => {
|
||||
const [[startLen, midLen, endLen], setCutLength] = React.useState<
|
||||
[startLen: number, midLen: number, endLen: number]
|
||||
>([0, 0, 0]);
|
||||
|
@ -9,12 +9,12 @@ export interface EllipsisTooltipProps {
|
||||
children: React.ReactElement;
|
||||
}
|
||||
|
||||
const EllipsisTooltip = ({
|
||||
const EllipsisTooltip: React.FC<EllipsisTooltipProps> = ({
|
||||
enabledEllipsis,
|
||||
isEllipsis,
|
||||
children,
|
||||
tooltipProps,
|
||||
}: EllipsisTooltipProps) => {
|
||||
}) => {
|
||||
if (!tooltipProps?.title || !enabledEllipsis) {
|
||||
return children;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user