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

Commit4992b32

Browse files
authored
Merge pull requestcoderoad#149 from ShMcK/fix/author-tutorial-name
add author to tutorial list
2 parents85c05e1 +bbd7cd2 commit4992b32

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const SelectTutorial = (props: Props) => {
4242
onSelect={()=>onSelect(tutorial)}
4343
title={tutorial.summary.title||''}
4444
description={tutorial.summary.description||''}
45+
createdBy={tutorial.createdBy}
4546
/>
4647
))}
4748
</div>

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import*asReactfrom'react'
2+
import*asGfrom'typings/graphql'
23
import{css,jsx}from'@emotion/core'
34
importCardfrom'../../components/Card'
45
importTagfrom'../../components/Tag'
@@ -46,8 +47,9 @@ const styles = {
4647
}
4748

4849
interfaceProps{
49-
title?:string
50-
description?:string
50+
title:string
51+
description:string
52+
createdBy?:G.User|null
5153
onSelect():void
5254
}
5355

@@ -69,8 +71,8 @@ const TutorialItem = (props: Props) => (
6971
<imgsrc="https://via.placeholder.com/75/75"height="75px"width="75px"/>
7072
</div>
7173
<divcss={styles.right}>
72-
<h2css={styles.title}>{props.title||'Title'}</h2>
73-
<h3css={styles.author}>Author Name</h3>
74+
<h2css={styles.title}>{props.title}</h2>
75+
{props.createdBy&&<h3css={styles.author}>{props.createdBy.name}</h3>}
7476
<divcss={styles.tags}>
7577
<Tag>javascript</Tag>
7678
</div>

‎web-app/stories/SelectTutorial.stories.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ const tutorialList = [
1212
title:'Tutorial 1',
1313
description:'The first one',
1414
},
15+
createdBy:{
16+
name:'First Lastname',
17+
},
1518
},
1619
{
1720
id:'2',
1821
summary:{
1922
title:'Tutorial 2',
2023
description:'The second one',
2124
},
25+
createdBy:{
26+
name:'Joe Schmo',
27+
},
2228
},
2329
]
2430

@@ -34,6 +40,7 @@ storiesOf('Select Tutorial', module)
3440
onSelect={action('onSelect')}
3541
title={tutorial.summary.title}
3642
description={tutorial.summary.description}
43+
createdBy={{name:'First Lastname'}}
3744
/>
3845
)
3946
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp