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

Commit6dc13ac

Browse files
authored
Merge pull request#386 from coderoad/feature/style-changes
Feature/style changes
2 parents038e782 +4db9809 commit6dc13ac

31 files changed

+1434
-958
lines changed

‎package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@
3434
"watch":"tsc -watch -p ./"
3535
},
3636
"dependencies": {
37-
"@sentry/node":"^5.18.1",
37+
"@sentry/node":"^5.19.1",
3838
"@types/assert":"^1.5.1",
39-
"@types/jest":"^26.0.3",
39+
"@types/jest":"^26.0.4",
4040
"@types/jsdom":"^16.2.3",
41-
"@types/node":"^14.0.14",
41+
"@types/node":"^14.0.22",
4242
"@types/node-fetch":"^2.5.7",
4343
"@types/semver":"^7.3.1",
44-
"@typescript-eslint/eslint-plugin":"^3.4.0",
45-
"@typescript-eslint/parser":"^3.4.0",
44+
"@typescript-eslint/eslint-plugin":"^3.6.0",
45+
"@typescript-eslint/parser":"^3.6.0",
4646
"chokidar":"^3.4.0",
4747
"dotenv":"^8.2.0",
48-
"eslint":"^7.3.1",
48+
"eslint":"^7.4.0",
4949
"git-url-parse":"^11.1.2",
5050
"jest":"^26.1.0",
51-
"jsdom":"^16.2.2",
51+
"jsdom":"^16.3.0",
5252
"node-fetch":"^2.6.0",
5353
"semver":"^7.3.2",
5454
"ts-jest":"^26.1.1",
55-
"typescript":"^3.9.5"
55+
"typescript":"^3.9.6"
5656
},
5757
"devDependencies": {
5858
"eslint-config-prettier":"^6.11.0",

‎src/channel/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ class Channel implements Channel {
351351

352352
switch(actionType){
353353
case'TEST_PASS':
354-
console.log('TEST_PASS',action)
355354
consttutorial=this.context.tutorial.get()
356355
if(!tutorial){
357356
thrownewError('Error with current tutorial. Tutorial may be missing an id.')

‎typings/index.d.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
import*asEfrom'./error'
22
import*asTTfrom'./tutorial'
33

4-
exporttypeProgressStatus='ACTIVE'|'COMPLETE'|'INCOMPLETE'
4+
exporttypeLevelUI={
5+
id:string
6+
title:string
7+
/** A summary of the level */
8+
summary:string
9+
/** The lesson content of the level, parsed as markdown */
10+
content:string
11+
/** A set of tasks for users linked to unit tests */
12+
steps:StepUI[]
13+
status:ProgressStatus
14+
}
15+
16+
exporttypeStepUI={
17+
id:string
18+
content:string
19+
status:ProgressStatus
20+
hints?:string[]
21+
subtasks?:SubtaskUI[]
22+
}
23+
24+
exporttypeSubtaskUI={name:string;status:ProgressStatus}
25+
26+
exporttypeProgressStatus='ACTIVE'|'COMPLETE'|'INCOMPLETE'|'FAIL'
527

628
exportinterfaceProgress{
729
levels:{

‎typings/tutorial.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export type Step = {
3232
solution:Maybe<StepActions>
3333
hints?:string[]
3434
subtasks?:string[]
35-
status?:ProgressStatus
3635
}
3736

3837
/** A tutorial for use in VSCode CodeRoad */

‎web-app/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"extends":"react-app"
2626
},
2727
"dependencies": {
28-
"@alifd/next":"^1.20.14",
28+
"@alifd/next":"^1.20.18",
2929
"@alifd/theme-4":"^0.3.1",
3030
"@emotion/babel-preset-css-prop":"^10.0.27",
3131
"@emotion/core":"^10.0.28",
32-
"@sentry/browser":"^5.18.1",
32+
"@sentry/browser":"^5.19.1",
3333
"js-yaml":"^3.14.0",
3434
"markdown-it":"^11.0.0",
3535
"markdown-it-emoji":"^1.4.0",
@@ -39,24 +39,24 @@
3939
"react-addons-css-transition-group":"^15.6.2",
4040
"react-dom":"^16.13.1",
4141
"reselect":"^4.0.0",
42-
"xstate":"^4.10.0"
42+
"xstate":"^4.11.0"
4343
},
4444
"devDependencies": {
45-
"@babel/core":"^7.10.3",
45+
"@babel/core":"^7.10.4",
4646
"@storybook/addon-actions":"^5.3.19",
4747
"@storybook/addon-knobs":"^5.3.19",
4848
"@storybook/addon-links":"^5.3.19",
4949
"@storybook/addons":"^5.3.19",
50-
"@storybook/preset-create-react-app":"^3.1.2",
50+
"@storybook/preset-create-react-app":"^3.1.4",
5151
"@storybook/react":"^5.3.19",
5252
"@types/graphql":"^14.5.0",
5353
"@types/highlight.js":"^9.12.4",
54-
"@types/jest":"^26.0.3",
54+
"@types/jest":"^26.0.4",
5555
"@types/js-yaml":"^3.12.5",
5656
"@types/markdown-it":"^10.0.1",
57-
"@types/node":"^14.0.14",
57+
"@types/node":"^14.0.22",
5858
"@types/prismjs":"^1.16.1",
59-
"@types/react":"^16.9.41",
59+
"@types/react":"^16.9.43",
6060
"@types/react-addons-css-transition-group":"^15.0.5",
6161
"@types/react-dom":"^16.9.8",
6262
"babel-loader":"8.1.0",
@@ -68,6 +68,6 @@
6868
"react-app-rewired":"^2.1.6",
6969
"react-scripts":"^3.4.1",
7070
"sass-loader":"^8.0.2",
71-
"typescript":"^3.9.5"
71+
"typescript":"^3.9.6"
7272
}
7373
}

‎web-app/src/components/Markdown/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
importMarkdownItfrom'markdown-it'
2-
//@ts-ignore no types for package
3-
42
importPrismfrom'prismjs'
5-
63
//@ts-ignore no types for package
74
importmarkdownEmojifrom'markdown-it-emoji'
85
import*asReactfrom'react'

‎web-app/src/components/ProcessMessages/TestMessage.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎web-app/src/components/ProcessMessages/index.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
importMessagefrom'../Message'
22
import*asReactfrom'react'
33
import*asTfrom'typings'
4-
importButtonfrom'../Button'
54
import{css,jsx}from'@emotion/core'
6-
importTestMessagefrom'./TestMessage'
75

86
interfaceProps{
9-
testStatus?:T.TestStatus|null
107
processes:T.ProcessEvent[]
11-
onOpenLogs?:(channel:string)=>void
128
}
139

1410
conststyles={
@@ -19,22 +15,7 @@ const styles = {
1915
}
2016

2117
// display a list of active processes
22-
constProcessMessages=({ processes, testStatus, onOpenLogs}:Props)=>{
23-
if(testStatus){
24-
return(
25-
<TestMessage{...testStatus}>
26-
{testStatus.type==='warning' ?(
27-
<Button
28-
onClick={()=>onOpenLogs&&onOpenLogs('CodeRoad (Tests)')}
29-
type="normal"
30-
style={{marginTop:'0.8rem'}}
31-
>
32-
Open Logs
33-
</Button>
34-
) :null}
35-
</TestMessage>
36-
)
37-
}
18+
constProcessMessages=({ processes}:Props)=>{
3819
if(!processes.length){
3920
returnnull
4021
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import*asReactfrom'react'
2+
importIconfrom'../Icon'
3+
import{css,jsx}from'@emotion/core'
4+
5+
conststyles={
6+
container:{
7+
backgroundColor:'#fff3e0',
8+
padding:'0.5rem',
9+
animationDuration:'0.3s',
10+
animationTimingFunction:'ease-in-out',
11+
borderTopLeftRadius:'4px',
12+
borderTopRightRadius:'4px',
13+
color:'rgb(51, 51, 51)',
14+
fontSize:'0.8rem',
15+
},
16+
icon:{
17+
color:'#ff9300',
18+
},
19+
content:{
20+
marginLeft:'0.5rem',
21+
},
22+
}
23+
24+
interfaceProps{
25+
message?:string
26+
}
27+
28+
constTestMessage=(props:Props)=>{
29+
const[visible,setVisible]=React.useState(true)
30+
31+
React.useEffect(()=>{
32+
setVisible(true)
33+
consttimeout=setTimeout(()=>{
34+
setVisible(false)
35+
},4500)
36+
return()=>{
37+
clearTimeout(timeout)
38+
}
39+
},[props.message])
40+
41+
returnvisible&&props.message ?(
42+
<divcss={styles.container}>
43+
<Icontype="warning"style={styles.icon}size="xs"/>
44+
<spancss={styles.content}>{props.message}</span>
45+
</div>
46+
) :null
47+
}
48+
49+
exportdefaultTestMessage
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import*asReactfrom'react'
2+
importMarkdownfrom'../../../components/Markdown'
3+
4+
conststyles={
5+
text:{
6+
padding:'0rem 1rem',
7+
paddingBottom:'1rem',
8+
},
9+
title:{
10+
fontSize:'1.2rem',
11+
fontWeight:'bold'as'bold',
12+
lineHeight:'1.2rem',
13+
},
14+
}
15+
16+
interfaceProps{
17+
title:string
18+
content:string
19+
}
20+
21+
constContent=(props:Props)=>{
22+
if(!props.content.length){
23+
returnnull
24+
}
25+
return(
26+
<divcss={styles.text}>
27+
<h2css={styles.title}>{props.title}</h2>
28+
<Markdown>{props.content||''}</Markdown>
29+
</div>
30+
)
31+
}
32+
33+
exportdefaultContent

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

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,59 @@
11
import*asReactfrom'react'
2+
import{css,jsx}from'@emotion/core'
23
importMarkdownfrom'../../../components/Markdown'
34
importButtonfrom'../../../components/Button'
45

56
conststyles={
67
hints:{
7-
marginTop:'1rem',
8+
marginTop:'0.5rem',
89
},
910
hintList:{
1011
marginBottom:'0.5rem',
1112
},
1213
hint:{
13-
margin:'0.5rem 0',
14+
marginBottom:'0.5rem',
1415
backgroundColor:'rgba(255,229,100,0.3)',
1516
borderLeft:'#ffe564',
16-
padding:'0.5rem',
17+
borderRadius:'2px',
18+
padding:'0 0.5rem',
1719
},
1820
}
1921

2022
interfaceProps{
2123
hints:string[]
22-
hintIndex:number
23-
setHintIndex(value:number):void
2424
}
2525

2626
constHints=(props:Props)=>{
27-
constisFinalHint=props.hints.length-1===props.hintIndex
27+
// hold state for hints for the level
28+
const[hintIndex,setHintIndex]=React.useState<number>(-1)
29+
30+
if(!props.hints||!props.hints.length){
31+
returnnull
32+
}
33+
34+
constisFinalHint=props.hints.length-1===hintIndex
35+
2836
constnextHint=()=>{
2937
if(isFinalHint){
3038
return
3139
}
32-
props.setHintIndex(props.hintIndex+1)
40+
setHintIndex(hintIndex+1)
3341
}
42+
3443
return(
35-
<divstyle={styles.hints}>
36-
<divstyle={styles.hintList}>
44+
<divcss={styles.hints}>
45+
<divcss={styles.hintList}>
3746
{/* only show revealed hints */}
38-
{props.hints.map((h,i)=>{
39-
returni<=props.hintIndex ?(
40-
<divkey={i}style={styles.hint}>
41-
<Markdown>{h}</Markdown>
47+
{props.hints.map((hint,index)=>{
48+
if(index>hintIndex){
49+
// hint not yet revealed
50+
returnnull
51+
}
52+
return(
53+
<divkey={index}css={styles.hint}>
54+
<Markdown>{`${index+1}.&nbsp;${hint}`}</Markdown>
4255
</div>
43-
) :null
56+
)
4457
})}
4558
</div>
4659
<ButtononClick={nextHint}disabled={isFinalHint}>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp