Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 54: Add level progress to selector #66

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build/
# Never commit individual sessions
.DS_Store
.vscode/
.idea/

# misc
.env.local
Expand Down
4 changes: 2 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,7 @@ function App(): JSX.Element {
return (
<div>
<main>
<LessonSide />
<LessonSide levelNum={exerciseCount + 1} />
<ExerciseSide
incrementExercise={() => setExerciseCount(exerciseCount + 1)}
/>
Expand Down
10 changes: 7 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(levelNum: number): JSX.Element {
return (
<section id="lesson-side-container">
<div>
Expand All @@ -34,8 +34,12 @@ 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={levelNum}
maxLevelReached={6}
/>
</div>
<Footer />
</section>
Expand Down
Loading