Skip to content

Commit

Permalink
no longer forcibly warpping an overriden close button with a button
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Elbaz committed Jun 28, 2023
1 parent d9e798f commit 346662f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/components/CloseButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { CloseButtonProps } from '../types';
import { Close } from '../components/Icons';

const CloseButton: React.FC<CloseButtonProps> = ({ close, children }) => (
<button
Expand All @@ -10,7 +11,7 @@ const CloseButton: React.FC<CloseButtonProps> = ({ close, children }) => (
}}
className="__react-grand-tour__close-button"
>
{children}
<Close />
</button>
);

Expand Down
12 changes: 3 additions & 9 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Modal = ({
renderedContent: content,
scrollToElement,
arrow: Arrow,
closeButton: CloseButtonOverride,
closeButton: CloseButton,
currentStepLabel: CurrentStepLabel,
dialogWrapper: DialogWrapper,
nextStepButton: NextStepButton,
Expand Down Expand Up @@ -95,14 +95,8 @@ const Modal = ({
),
[allSteps, stepIndex, changeStep, StepButton, StepButtonWrapper],
);
const closeButton = useMemo(
() => (
<CloseButton close={close}>
<CloseButtonOverride close={close} />
</CloseButton>
),
[close, CloseButtonOverride],
);

const closeButton = useMemo(() => <CloseButton close={close} />, [close, CloseButton]);

return (
<FadeIn>
Expand Down

0 comments on commit 346662f

Please sign in to comment.