Skip to content

Commit

Permalink
Merge branch 'feat/last-update' of https://github.com/huythai855/SciPlay
Browse files Browse the repository at this point in the history
 into feat/last-update
  • Loading branch information
huythai855 committed Aug 8, 2023
2 parents cb85748 + 21e0097 commit e7b9e7e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions frontend/src/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function AppRouter() {
<Route path="/quiz" element={<Quiz/>} />
<Route path="/physic-page" element={<Coursepath/>} />
<Route path="/course-path" element={<Coursepath/>} />
<Route path="/" element={<Login/>} />
<Route path = "/interactive" element={<Interactive/>} />

{/* 404 page if you guy wanna edit :> */}
{/*<Route path='*' element={<Home/>} /> */}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Learn/Interactive/Interactive.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
height: 1078.88px;
position: relative;
width: 1922.01px;

}


.interactive-theory .overlap {
height: 970px;
left: 235px;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/Learn/Interactive/Interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ function Interactive() {
);
}

export default Interactive;
export default Interactive;

11 changes: 3 additions & 8 deletions frontend/src/pages/Learn/Interactive/LessonDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const LessonDetails = () => {
useEffect(() => {
async function fetchLessonData() {
try {

const response = await axios.get(`
http://localhost:3000/api/lesson?user_id=${userId}&lesson_id=${lessonId}`
);
Expand All @@ -32,21 +33,19 @@ const LessonDetails = () => {
}
}
fetchLessonData();

}, [userId, lessonId]);


const showNextLine = () => {
if(lessonData !== null) {
if (currentLineIndex <= lessonData.lesson.content.content.length - 1) {
setCurrentLineIndex(currentLineIndex + 1);
}

if(lessonData.lesson.content.content[currentLineIndex].lines !== undefined) {
setDisplayedText(lessonData.lesson.content.content[currentLineIndex].lines[0]);
}

}

};

const typingSpeed = 30; // Tốc độ đánh chữ (ms)
Expand All @@ -57,7 +56,6 @@ const LessonDetails = () => {
<div className="overlap">
<img className="learner" alt="Learner" src={Learner} />


<div className="text-box">
<div className="overlap-group">

Expand All @@ -73,12 +71,9 @@ const LessonDetails = () => {
<div className="next-button">
<button type="button" class="btn btn-primary" onClick={showNextLine}>Tiếp theo</button>
</div>


</div>
</div>


<img className="mentor" alt="Mentor" src={Mentor} />
</div>
<img className="logo" alt="Logo" src={Logo} />
Expand All @@ -88,4 +83,4 @@ const LessonDetails = () => {
);
};

export default LessonDetails;
export default LessonDetails;
3 changes: 2 additions & 1 deletion frontend/src/pages/Learn/Interactive/LineItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ const LineItem = ({line}) => {
return <p>{line}</p>;
};

export default LineItem;

export default LineItem;
3 changes: 2 additions & 1 deletion frontend/src/pages/Learn/Interactive/TypewriterEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ const TypewriterEffect = ({ text, speed }) => {
);
};

export default TypewriterEffect;

export default TypewriterEffect;

0 comments on commit e7b9e7e

Please sign in to comment.