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

Commit4832c0a

Browse files
committed
cleanup
1 parent380db3e commit4832c0a

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import{ApolloError}from'apollo-boost'
21
import*asReactfrom'react'
32
import{css,jsx}from'@emotion/core'
43
importonErrorfrom'../../services/sentry/onError'
@@ -14,7 +13,7 @@ const styles = {
1413
}
1514

1615
interfaceProps{
17-
error?:ApolloError
16+
error?:Error
1817
}
1918

2019
constErrorView=({ error}:Props)=>{

‎web-app/src/containers/SelectTutorial/LoadTutorialSummary.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react'
22
importuseFetchfrom'../../services/hooks/useFetch'
33
import*asTTfrom'typings/tutorial'
44
importTutorialOverviewfrom'../../components/TutorialOverview'
5+
importLoadingfrom'../Loading'
56

67
interfaceProps{
78
url:string
@@ -12,13 +13,14 @@ interface Props {
1213
constLoadTutorialSummary=(props:Props)=>{
1314
const{ data, error, loading}=useFetch<TT.Tutorial>(props.url)
1415
if(loading){
15-
return<div>Loading...</div>
16+
return<Loadingtext="Loading tutorial summary..."/>
1617
}
18+
// TODO: improve error handling
1719
if(error){
1820
return<div>{JSON.stringify(error)}</div>
1921
}
2022
if(!data){
21-
return<div>No data returned</div>
23+
return<div>No data returned for tutorial</div>
2224
}
2325
constonNext=()=>{
2426
props.send({

‎web-app/src/containers/SelectTutorial/SelectTutorialForm.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const styles = {
1111
padding:'1rem',
1212
width:'100%',
1313
height:'auto',
14-
backgroundColor:'yellow',
1514
},
1615
}
1716

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
import*asReactfrom'react'
2-
import*asTfrom'typings'
3-
import*asTTfrom'typings/tutorial'
42
importSelectTutorialFormfrom'./SelectTutorialForm'
53
importLoadTutorialSummaryfrom'./LoadTutorialSummary'
64

75
conststyles={
86
page:{
7+
position:'relative'as'relative',
8+
height:'auto',
99
width:'100%',
1010
},
11-
header:{
11+
selectPage:{
1212
padding:'1rem',
1313
},
1414
}
1515

16-
interfaceContainerProps{
17-
send(action:T.Action):void
18-
context:T.MachineContext
19-
}
20-
21-
interfaceTutorialsData{
22-
tutorials:TT.Tutorial[]
23-
}
24-
2516
interfaceProps{
2617
send:any
2718
context:any
@@ -31,11 +22,7 @@ const SelectTutorialPage = (props: Props) => {
3122
const[url,setUrl]=React.useState<string|null>(null)
3223
return(
3324
<divcss={styles.page}>
34-
{!url&&(
35-
<divcss={styles.header}>
36-
<SelectTutorialFormonUrlChange={setUrl}/>
37-
</div>
38-
)}
25+
{!url&&<SelectTutorialFormonUrlChange={setUrl}/>}
3926
{url&&<LoadTutorialSummaryurl={url}send={props.send}onClear={()=>setUrl(null)}/>}
4027
</div>
4128
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp