@@ -15,9 +15,9 @@ export function LearnPage() {
1515 const [ loaded , setLoaded ] = useState ( null ) ;
1616 const nonceRef = useRef ( 0 ) ;
1717
18- function runLesson ( code ) {
19- if ( ! code ) return ;
20- setLoaded ( { code, nonce : ( nonceRef . current += 1 ) } ) ;
18+ function runLesson ( lesson ) {
19+ if ( ! lesson || ! lesson . code ) return ;
20+ setLoaded ( { code : lesson . code , title : lesson . title , direction : lesson . direction , nonce : ( nonceRef . current += 1 ) } ) ;
2121 if ( typeof document !== "undefined" ) {
2222 const el = document . getElementById ( "py-runner" ) ;
2323 if ( el ) el . scrollIntoView ( { behavior : "smooth" , block : "start" } ) ;
@@ -63,6 +63,15 @@ export function LearnPage() {
6363 불러오세요. 이 탭 안에서 진짜 CPython이 돕니다.
6464 </ Text >
6565 </ div >
66+ { loaded && loaded . title && (
67+ < div className = "learnActiveLesson" >
68+ < Badge variant = "accent" label = "레슨" />
69+ < div >
70+ < Text type = "body-sm" weight = "600" > { loaded . title } </ Text >
71+ { loaded . direction && < Text type = "body-sm" color = "muted" > { loaded . direction } </ Text > }
72+ </ div >
73+ </ div >
74+ ) }
6675 < PythonRunner load = { loaded } />
6776 </ section >
6877
@@ -93,7 +102,7 @@ export function LearnPage() {
93102 className = "learnLessonButton"
94103 disabled = { ! lesson . code }
95104 title = { lesson . code ? "이 레슨의 코드를 실행기로 불러오기" : "실행 코드 없음" }
96- onClick = { ( ) => runLesson ( lesson . code ) }
105+ onClick = { ( ) => runLesson ( lesson ) }
97106 >
98107 < Card padding = { 4 } >
99108 < div className = "learnLessonCard" >
0 commit comments