File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
packages/docs/src/routes/tutorial Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export default component$(() => {
3131 entryStrategy : 'segment' ,
3232 files : [ ] ,
3333 version : '' ,
34+ isShowingSolution : false ,
3435 } ;
3536 return initStore ;
3637 } ) ;
@@ -47,6 +48,7 @@ export default component$(() => {
4748 store . appId = t . app . id ;
4849 store . prev = t . prev ;
4950 store . next = t . next ;
51+ store . isShowingSolution = false ;
5052 } ) ;
5153
5254 return (
@@ -166,6 +168,7 @@ export interface TutorialStore extends ReplAppInput {
166168 app : TutorialApp ;
167169 prev : TutorialApp | undefined ;
168170 next : TutorialApp | undefined ;
171+ isShowingSolution : boolean ;
169172}
170173
171174export const PANELS = [ 'Tutorial' , 'Input' , 'Output' ] ;
Original file line number Diff line number Diff line change 1- import { component$ , useSignal } from '@builder.io/qwik' ;
1+ import { component$ } from '@builder.io/qwik' ;
22import { ensureDefaultFiles , type TutorialStore } from './layout' ;
33import { Link } from '@builder.io/qwik-city' ;
44
55export const TutorialContentFooter = component$ ( ( { store } : TutorialContentFooterProps ) => {
6- let solutionViewSig = useSignal ( false ) ;
7-
86 return (
97 < div class = "content-footer" >
108 < div >
11- { solutionViewSig . value ? (
9+ { store . isShowingSolution ? (
1210 < button
1311 preventdefault :click
1412 class = "show-me"
1513 onClick$ = { ( ) => {
1614 store . files = ensureDefaultFiles ( store . app . problemInputs ) ;
17- solutionViewSig . value = false ;
15+ store . isShowingSolution = false ;
1816 } }
1917 type = "button"
2018 >
@@ -26,7 +24,7 @@ export const TutorialContentFooter = component$(({ store }: TutorialContentFoote
2624 class = "show-me"
2725 onClick$ = { ( ) => {
2826 store . files = ensureDefaultFiles ( store . app . solutionInputs ) ;
29- solutionViewSig . value = true ;
27+ store . isShowingSolution = true ;
3028 } }
3129 type = "button"
3230 >
You can’t perform that action at this time.
0 commit comments