Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/TourStep/DefaultPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default function DefaultPanel(props: DefaultPanelProps) {
onClick={onClose}
aria-label="Close"
{...ariaProps}
className={`${prefixCls}-close`}
className={clsx(`${prefixCls}-close`, tourClassNames?.close)}
style={styles?.close}
>
{closeIcon}
</button>
Expand Down
3 changes: 2 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export type SemanticName =
| 'header'
| 'title'
| 'description'
| 'mask';
| 'mask'
| 'close';


export type HTMLAriaDataAttributes = React.AriaAttributes & {
Expand Down
7 changes: 7 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ describe('Tour', () => {
section: 'custom-section',
footer: 'custom-footer',
description: 'custom-description',
close: 'custom-close',
};
const customStyles = {
mask: { color: 'white' },
Expand All @@ -1136,6 +1137,7 @@ describe('Tour', () => {
section: { padding: '10px' },
footer: { borderTop: '1px solid black' },
description: { fontStyle: 'italic' },
close: { color: 'red' },
};
const Demo = () => {
const btnRef = useRef<HTMLButtonElement>(null);
Expand Down Expand Up @@ -1178,6 +1180,9 @@ describe('Tour', () => {
const descriptionElement = document.querySelector(
'.rc-tour-description',
) as HTMLElement;
const closeElement = document.querySelector(
'.rc-tour-close',
) as HTMLElement;

// check classNames
expect(maskElement.classList).toContain('custom-mask');
Expand All @@ -1187,6 +1192,7 @@ describe('Tour', () => {
expect(sectionElement.classList).toContain('custom-section');
expect(footerElement.classList).toContain('custom-footer');
expect(descriptionElement.classList).toContain('custom-description');
expect(closeElement.classList).toContain('custom-close');

// check styles
expect(maskElement.style.color).toBe('white');
Expand All @@ -1196,6 +1202,7 @@ describe('Tour', () => {
expect(sectionElement.style.padding).toBe('10px');
expect(footerElement.style.borderTop).toBe('1px solid black');
expect(descriptionElement.style.fontStyle).toBe('italic');
expect(closeElement.style.color).toBe('red');
});

it('inline', async () => {
Expand Down