Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0892885

Browse files
committed
request workspace on completion
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentfe0c662 commit0892885

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

‎web-app/src/containers/Tutorial/components/CompletedBanner.tsx

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import*asReactfrom'react'
22
import{css,jsx}from'@emotion/core'
3-
import{Icon}from'@alifd/next'
3+
import{Button,Icon}from'@alifd/next'
44

55
conststyles={
66
banner:{
77
height:'auto',
88
width:'100%',
99
backgroundColor:'rgb(85, 132, 255)',
1010
color:'white',
11-
padding:'0.5rem',
11+
padding:'0.5rem 1rem',
1212
},
1313
header:{
1414
position:'relative'as'relative',
@@ -26,32 +26,53 @@ const styles = {
2626
section:{
2727
padding:'0rem 0.5rem 1rem 0.5rem',
2828
},
29+
options:{
30+
display:'flex'as'flex',
31+
flexDirection:'row'as'row',
32+
flexWrap:'wrap'as'wrap',
33+
},
34+
optionsLeft:{
35+
flex:3,
36+
},
37+
optionsRight:{
38+
flex:1,
39+
display:'flex'as'flex',
40+
justifyContent:'flex-end'as'flex-end',
41+
alignItems:'flex-end'as'flex-end',
42+
},
2943
}
3044

3145
interfaceProps{
3246
title:string
47+
onRequestWorkspace():void
3348
}
3449

3550
constCompletedBanner=(props:Props)=>{
3651
return(
3752
<divcss={styles.banner}>
3853
<divcss={styles.header}>
39-
{/* <div css={styles.close} onClick={() => setOpen(false)}>
40-
<Icon type="close" size="xs" />
41-
</div> */}
4254
<h3>
4355
<Icontype="success-filling"size="large"/>
4456
<spancss={styles.headerMessage}>Congratulations on completing "{props.title}"!</span>
4557
</h3>
4658
</div>
4759
<divcss={styles.section}>
4860
<h5>You've reached the end of the road...</h5>
49-
<p>To go down another path:</p>
50-
<ul>
51-
<li>- open a new VSCode workspace</li>
52-
<li>- relaunch the CodeRoad app</li>
53-
<li>- select a new tutorial</li>
54-
</ul>
61+
<divcss={styles.options}>
62+
<divcss={styles.optionsLeft}>
63+
<p>To go down another path:</p>
64+
<ul>
65+
<li>- open a new VSCode workspace</li>
66+
<li>- relaunch the CodeRoad app</li>
67+
<li>- select a new tutorial</li>
68+
</ul>
69+
</div>
70+
<divcss={styles.optionsRight}>
71+
<Buttontype="primary"ghost="dark"onClick={props.onRequestWorkspace}>
72+
Open New Workspace
73+
</Button>
74+
</div>
75+
</div>
5576
</div>
5677
</div>
5778
)

‎web-app/src/containers/Tutorial/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ const TutorialPage = (props: PageProps) => {
124124

125125
constdisableOptions=processes.length>0||props.state==='Level.TestRunning'
126126

127-
console.log(`STATE:${props.state}`)
128-
129127
return(
130128
<div>
131129
<divcss={styles.page}>
@@ -150,7 +148,10 @@ const TutorialPage = (props: PageProps) => {
150148

151149
{props.state==='Completed' ?(
152150
<divcss={styles.completeFooter}>
153-
<CompletedBannertitle={tutorial.summary.title||'Unknown'}/>
151+
<CompletedBanner
152+
title={tutorial.summary.title||'Unknown'}
153+
onRequestWorkspace={()=>props.send({type:'REQUEST_WORKSPACE'})}
154+
/>
154155
</div>
155156
) :(
156157
<divcss={styles.footer}>

‎web-app/src/services/state/machine.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ export const createMachine = (options: any) => {
253253
target:'#select-new-tutorial',
254254
actions:['reset'],
255255
},
256+
REQUEST_WORKSPACE:{
257+
actions:'requestWorkspaceSelect',
258+
},
256259
},
257260
},
258261
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp