From 6360d09c87c2921677abc56efc59ab4dbbd5af86 Mon Sep 17 00:00:00 2001 From: Eitan Elbaz Date: Tue, 27 Jun 2023 16:08:37 +0100 Subject: [PATCH] updated component visibility prop nesting on main RGT component --- src/ReactGrandTour.tsx | 13 +++++++++++-- src/types.ts | 6 ++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ReactGrandTour.tsx b/src/ReactGrandTour.tsx index f82bbdb..7e398ea 100644 --- a/src/ReactGrandTour.tsx +++ b/src/ReactGrandTour.tsx @@ -55,7 +55,11 @@ const ReactGrandTour: React.FC = ({ disableCloseOnBackdropClick = false, stylingOverrides = emptyStyles, keyboardShortcuts, - componentVisibility = emptyVisibility, + hideCloseButton, + hideCurrentStepLabel, + hideNextStepButton, + hidePreviousStepButton, + hideStepButtons, }) => { const [open, setOpen] = useState(defaultOpen); const [currentIndex, setCurrentIndex] = useState(openAt); @@ -172,6 +176,7 @@ const ReactGrandTour: React.FC = ({ }; }, [onKeyUp]); + console.log(steps[currentIndex]); return ( = ({ {' '}
void; onClose?: (reason: ReactGrandTourCloseReason) => void; @@ -14,8 +14,6 @@ export type ReactGrandTourProps = { disableCloseOnBackdropClick?: boolean; stylingOverrides?: ReactGrandTourStylingOverrides; keyboardShortcuts?: ReactGrandTourShortcuts; - - componentVisibility?: ComponentVisibility; }; export type ComponentVisibility = { @@ -113,7 +111,7 @@ export type ReactGrandTourContextType = { goBack: () => void; }; -export type ReactGrandTourStep = { +export type ReactGrandTourStep = ComponentVisibility & { content: ReactNode; /** * Use the `component` prop if you want to customise the content of the step.