1- import { faArrowRight , faCaretRight } from '@fortawesome/free-solid-svg-icons'
1+ import { faArrowRight } from '@fortawesome/free-solid-svg-icons'
22import { FaIcon } from './ui/FaIcon'
3- import { Play } from 'next/font/google'
4- import { PlayerProfileStore } from '../../store/player-profile-store'
3+ import {
4+ PlayerProfileStore ,
5+ updatePlayerProfileStore ,
6+ } from '../../store/player-profile-store'
7+ import { ExerciseViewStore } from './exercise-view/state/exercise-view-store'
58
6- export function BirdieOverlay ( { context } : { context : 'map' } ) {
9+ export function BirdieOverlay ( { context } : { context : 'map' | 'exercise' } ) {
710 const birdieIntros = PlayerProfileStore . useState ( s => s . birdieIntros )
811
912 let text = ''
1013 let step = ''
1114
15+ const exerciseWithExample =
16+ ExerciseViewStore . getRawState ( ) . hasExamplePrescreen
17+
18+ const tag = ExerciseViewStore . getRawState ( ) . tag
19+
20+ console . log ( tag )
21+
1222 if ( context == 'map' ) {
1323 if ( ! birdieIntros . includes ( 'map-1' ) ) {
1424 text =
@@ -29,6 +39,29 @@ export function BirdieOverlay({ context }: { context: 'map' }) {
2939 }
3040 }
3141
42+ if ( context == 'exercise' ) {
43+ if ( exerciseWithExample ) {
44+ if ( ! birdieIntros . includes ( 'exercise-example-1' ) ) {
45+ text =
46+ 'Schau dir diese Beispiel-Aufgabe an. Unten findest du die Lösung dazu.'
47+ step = 'exercise-example-1'
48+ } else if ( ! birdieIntros . includes ( 'exercise-example-2' ) ) {
49+ text =
50+ 'Wenn du die Lösung verstanden hast, gehe weiter zur nächsten Aufgabe.'
51+ step = 'exercise-example-2'
52+ }
53+ } else if ( tag == 'Grundlagen - Challenge 1#' ) {
54+ if ( ! birdieIntros . includes ( 'challenge-1' ) ) {
55+ text = 'Jetzt hast du schon die ersten Skills gemeistert!'
56+ step = 'challenge-1'
57+ } else if ( ! birdieIntros . includes ( 'challenge-2' ) ) {
58+ text =
59+ 'Bist du bereit für die 1. Challenge? Hier kannst du zeigen, was du gelernt hast!'
60+ step = 'challenge-2'
61+ }
62+ }
63+ }
64+
3265 if ( ! text ) return null
3366
3467 return (
@@ -41,7 +74,7 @@ export function BirdieOverlay({ context }: { context: 'map' }) {
4174 < button
4275 className = "w-12 h-12 bg-blue-300 rounded-full hover:bg-blue-400 mt-5"
4376 onClick = { ( ) => {
44- PlayerProfileStore . update ( s => {
77+ updatePlayerProfileStore ( s => {
4578 s . birdieIntros . push ( step )
4679 } )
4780 } }
0 commit comments