diff --git a/src/Onboarding.jsx b/src/Onboarding.jsx index d812efd..7fbaae6 100644 --- a/src/Onboarding.jsx +++ b/src/Onboarding.jsx @@ -86,13 +86,13 @@ export default function Onboarding() { }} > {/* start: progress bar animation section wrapper */} -
+ {/*
-
+
*/} {/* end: progress bar animation section wrapper */}
@@ -130,12 +130,12 @@ export default function Onboarding() { currently, it's not working but saving it for future references */} - {/* + - */} +
@@ -211,4 +211,46 @@ function manageOnboardingContent_onSlide(currentState=0) { ]; return { content: onboardingContent[currentState], totalSlideCount: onboardingContent.length - 1}; +} + +// ShowSlideNavigation - method to render dot-sliding component +function ShowSlideNavigation({totalSlideCount, activeSlideIndex}) { + const [activeDotIndexRef, setActiveDotIndex] = useState(activeSlideIndex); + let dotSliderRef = []; + useEffect(() => { + setActiveDotIndex(activeSlideIndex); + }, [activeSlideIndex]); + // rendering html-DOM elements as dots inside the dotSlideRef array + for (let dotCount = 0; dotCount <= totalSlideCount; dotCount++) { + dotSliderRef.push( + +
+ + ) + } + return ( + +
+ {dotSliderRef.map((dot, dotIndex) => { + if (dotIndex === activeDotIndexRef-1) { + return ( + + + {dot} + + + ) + } else { + return ( + + + {dot} + + + ) + } + })} +
+
+ ) } \ No newline at end of file