refactor(divider): remove unnecessary judgments (#49169)

This commit is contained in:
ice 2024-06-01 16:37:13 +08:00 committed by GitHub
parent ea1927cf5b
commit 5d040439b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,6 @@ const Divider: React.FC<DividerProps> = (props) => {
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
const hasChildren = !!children;
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
@ -50,7 +49,7 @@ const Divider: React.FC<DividerProps> = (props) => {
`${prefixCls}-${type}`,
{
[`${prefixCls}-with-text`]: hasChildren,
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
[`${prefixCls}-with-text-${orientation}`]: hasChildren,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-plain`]: !!plain,
[`${prefixCls}-rtl`]: direction === 'rtl',