Skip to content

Commit

Permalink
fix: review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
logeekal committed Dec 12, 2023
1 parent 0027965 commit 97a905c
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ const TimelineTourComp = (props: TimelineTourProps) => {

const currentStepConfig = timelineTourSteps[tourState.currentTourStep - 1];

const tourStep = useMemo((step: typeof timelineTourSteps[number], idx: number) => {}, []);

if (currentStepConfig?.timelineTab && currentStepConfig.timelineTab !== activeTab) {
switchToTab(currentStepConfig.timelineTab);
}
Expand All @@ -106,15 +108,16 @@ const TimelineTourComp = (props: TimelineTourProps) => {
return (
<>
{timelineTourSteps.map((steps, idx) => {
const step = idx + 1;
if (tourState.currentTourStep !== step) return null;
const stepCount = idx + 1;
if (tourState.currentTourStep !== stepCount) return null;
const panelProps = {
'data-test-subj': `timeline-tour-step-${idx + 1}`,
};
return (
<EuiTourStep
panelProps={{
'data-test-subj': `timeline-tour-step-${idx + 1}`,
}}
panelProps={panelProps}
key={idx}
step={step}
step={stepCount}
isStepOpen={tourState.isTourActive && tourState.currentTourStep === idx + 1}
minWidth={tourState.tourPopoverWidth}
stepsTotal={timelineTourSteps.length}
Expand All @@ -123,7 +126,7 @@ const TimelineTourComp = (props: TimelineTourProps) => {
content={steps.content}
anchor={`#${steps.anchor}`}
subtitle={tourConfig.tourSubtitle}
footerAction={getFooterAction(step)}
footerAction={getFooterAction(stepCount)}
/>
);
})}
Expand Down

0 comments on commit 97a905c

Please sign in to comment.