Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkasany committed Jan 8, 2025
1 parent 9c6b70b commit f60e0cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/PanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ const PanelContent = React.forwardRef<
<div
ref={ref}
className={classnames(
`${prefixCls}-content`,
customizeClassNames?.content,
`${prefixCls}-panel`,
{
[`${prefixCls}-content-active`]: isActive,
[`${prefixCls}-content-inactive`]: !isActive,
},
className,
)}
style={{ ...style, ...styles?.content }}
style={style}
role={role}
>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface CollapseProps {
items?: ItemType[];
}

export type SemanticName = 'header' | 'title' | 'body' | 'icon' | 'content';
export type SemanticName = 'header' | 'title' | 'body' | 'icon';
export interface CollapsePanelProps extends React.DOMAttributes<HTMLDivElement> {
id?: string;
header?: string | React.ReactNode;
Expand Down
5 changes: 0 additions & 5 deletions tests/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -866,14 +866,12 @@ describe('collapse', () => {
body: { color: 'blue' },
title: { color: 'green' },
icon: { color: 'yellow' },
content: { color: 'purple' },
};
const customClassnames = {
header: 'custom-header',
body: 'custom-body',
title: 'custom-title',
icon: 'custom-icon',
content: 'custom-content',
};

const { container } = render(
Expand All @@ -891,21 +889,18 @@ describe('collapse', () => {
);
const headerElement = container.querySelector('.rc-collapse-header') as HTMLElement;
const bodyElement = container.querySelector('.rc-collapse-body') as HTMLElement;
const contentElement = container.querySelector('.rc-collapse-content') as HTMLElement;
const titleElement = container.querySelector('.rc-collapse-title') as HTMLElement;
const iconElement = container.querySelector('.rc-collapse-expand-icon') as HTMLElement;

// check classNames
expect(headerElement.classList).toContain('custom-header');
expect(bodyElement.classList).toContain('custom-body');
expect(contentElement.classList).toContain('custom-content');
expect(titleElement.classList).toContain('custom-title');
expect(iconElement.classList).toContain('custom-icon');

// check styles
expect(headerElement.style.color).toBe('red');
expect(bodyElement.style.color).toBe('blue');
expect(contentElement.style.color).toBe('purple');
expect(titleElement.style.color).toBe('green');
expect(iconElement.style.color).toBe('yellow');
});
Expand Down

0 comments on commit f60e0cb

Please sign in to comment.