Skip to content

Commit

Permalink
Issue 54: Add level progress to selector
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyyvinay committed Oct 18, 2023
1 parent 9500ea6 commit 1acc2cf
Show file tree
Hide file tree
Showing 4 changed files with 572 additions and 385 deletions.
6 changes: 4 additions & 2 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../assets/WestwoodSans-Regular.ttf';

function App(): JSX.Element {
const [exerciseCount, setExerciseCount] = useState(0);
if (exerciseCount == 2) {
if (exerciseCount == 5) {
return (
<main>
<CongratsPage />
Expand All @@ -16,7 +16,9 @@ function App(): JSX.Element {
return (
<div>
<main>
<LessonSide />
<LessonSide
levelNum={exerciseCount+1}
/>
<ExerciseSide
incrementExercise={() => setExerciseCount(exerciseCount + 1)}
/>
Expand Down
6 changes: 4 additions & 2 deletions src/components/shared/ExerciseSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ function ExerciseSide({ incrementExercise }: ExerciseSideProps): JSX.Element {

const exercises: availableExercises[] = [
'axis',
'graph',
'circle',
'axis',
'axis',
'axis',
'axis',
'congrats',
];
let curExercise;
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/LessonSide/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const exArray: { id: string; text: string }[] = [
},
];

function LessonSide(): JSX.Element {
function LessonSide(props: any): JSX.Element {
return (
<section id="lesson-side-container">
<div>
Expand All @@ -34,8 +34,8 @@ function LessonSide(): JSX.Element {
<div>
<Turtle turtleID="your-genius" />

{/* don't change this next line */}
<LevelSelector numLevels={5} currentLevel={2} maxLevelReached={4} />
{/* passed from parent component */}
<LevelSelector numLevels={6} currentLevel={props.levelNum} maxLevelReached={6} />
</div>
<Footer />
</section>
Expand Down
Loading

0 comments on commit 1acc2cf

Please sign in to comment.