Skip to content

Commit

Permalink
Merge branch 'main' into 99-turtle-above-0-axis-exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjnaT41756 authored May 29, 2024
2 parents 8982e9f + 304b7da commit f85d6a5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 25 deletions.
36 changes: 19 additions & 17 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState, useEffect } from 'react';
import CongratsPage from './shared/Congratulations';
import ExerciseSide from './shared/ExerciseSide';
import LessonSide from './shared/LessonSide/LessonSide';
import '../assets/WestwoodSans-Regular.ttf';
Expand All @@ -24,25 +23,28 @@ function App(): JSX.Element {
}
};

if (exerciseCount == 5) {
return (
<main>
<CongratsPage />
</main>
);
}
// change it to be max exercise
return (
<div>
<main>
<LessonSide
levelNum={exerciseCount + 1}
updateLevel={updateLevel}
maxLevel={completeExercises}
/>
<ExerciseSide
ExercisesNum={exerciseCount}
incrementExercise={() => setExerciseCount(exerciseCount + 1)}
/>
{exerciseCount < 7 ? (
<>
<LessonSide
levelNum={exerciseCount + 1}
updateLevel={updateLevel}
maxLevel={completeExercises}
/>
<ExerciseSide
ExercisesNum={exerciseCount}
incrementExercise={() => setExerciseCount(exerciseCount + 1)}
/>
</>
) : (
<ExerciseSide
ExercisesNum={exerciseCount}
incrementExercise={() => setExerciseCount(exerciseCount + 1)}
/>
)}
</main>
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/components/shared/ExerciseSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../../styles/ExerciseSide.scss';

//import AxisExercise from './Exercises/AxisExercise';
//import AxisInput from './Exercises/AxisInputs';
import CongratsPage from './Congratulations';
import AxisParent from './Exercises/AxisParent';
import GraphExercise from './Exercises/GraphExercise';
import GraphInput from './Exercises/GraphInput';
Expand All @@ -26,8 +27,8 @@ ExerciseSideProps): JSX.Element {
const [displayExercise, setDisplayExercise] = useState(0);

type availableExercises =
| 'axis'
| 'congrats'
| 'axis'
| 'graph0'
| 'unitcircle'
| 'graph1';
Expand Down Expand Up @@ -260,6 +261,8 @@ ExerciseSideProps): JSX.Element {
</div>
</div>
);
} else if (exercises[displayExercise] === 'congrats') {
return (curExercise = <CongratsPage></CongratsPage>);
}

return (
Expand Down
20 changes: 13 additions & 7 deletions src/styles/Congratulations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

#congrats-page-container {
background-color: colors.$primary-green;
flex-grow: 1;
display: flex;
height: 100%;
position: relative;
width: 100%;
}

#turtle-logo {
Expand All @@ -34,27 +36,28 @@
#turtle-image {
display: inline-block;
vertical-align: middle;
//float:left;
}

.speech-bubble {
height: auto;
padding-left: 12.816vw;
padding-right: 16.463vw;
padding-right: 18.463vw;
padding-top: 6vh;
position: absolute;
width: auto;
}

#speech-bubble-image {
height: auto;
width: 94%;
width: 75%;
}

#congratsTxt {
color: colors.$primary-green;
font-family: 'PT Sans', sans-serif;
font-size: 5vw;
font-size: 4vw;
font-weight: bold;
left: 54%;
left: 52%;
position: absolute;
top: 26%;
transform: translate(-64%, -26%);
Expand All @@ -63,7 +66,7 @@
#blurb {
color: colors.$primary-green;
font-family: 'PT Sans', sans-serif;
font-size: 3.8vw;
font-size: 2.8vw;
font-weight: bold;
left: 50%;
position: absolute;
Expand All @@ -80,6 +83,7 @@
}

#turtle-picture {
padding-left: 6vw;
width: 14vw;
}

Expand All @@ -97,8 +101,10 @@
font-family: 'PT Sans', sans-serif;
font-size: 4vh;
font-weight: bold;
height: auto;
position: absolute;
right: 10vw;
width: auto;
}

#rectangle1 {
Expand Down

0 comments on commit f85d6a5

Please sign in to comment.