|
|
@@ -3,6 +3,7 @@ import img from '../../assets/icons/skill_Information.svg'; |
|
|
|
|
|
|
|
import { IonButton, IonIcon } from '@ionic/react'; |
|
|
|
import { lockOpen, lockClosed } from 'ionicons/icons' |
|
|
|
import { useEffect, useRef } from 'react'; |
|
|
|
|
|
|
|
interface Props { |
|
|
|
stepNumber: number; |
|
|
@@ -13,8 +14,18 @@ interface Props { |
|
|
|
} |
|
|
|
|
|
|
|
const StepsDescription: React.FC<Props> = (props) => { |
|
|
|
|
|
|
|
const itemRef = useRef<null | HTMLDivElement>(null); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (itemRef && itemRef.current) { |
|
|
|
|
|
|
|
itemRef.current.scrollIntoView(); |
|
|
|
} |
|
|
|
}, [props.stepNumber]); |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className={styles.stepDescription}> |
|
|
|
<div className={styles.stepDescription} ref={itemRef}> |
|
|
|
<div className={styles.header}> |
|
|
|
<IonIcon icon={props.isUnlocked ? lockOpen : lockClosed} color={props.isUnlocked ? '' : "dark"} ></IonIcon> |
|
|
|
|
|
|
|