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

add author to tutorial list#149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 1 commit intomasterfromfix/author-tutorial-name
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const SelectTutorial = (props: Props) => {
onSelect={() => onSelect(tutorial)}
title={tutorial.summary.title || ''}
description={tutorial.summary.description || ''}
createdBy={tutorial.createdBy}
/>
))}
</div>
Expand Down
10 changes: 6 additions & 4 deletionsweb-app/src/containers/SelectTutorial/TutorialItem.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
import * as React from 'react'
import * as G from 'typings/graphql'
import { css, jsx } from '@emotion/core'
import Card from '../../components/Card'
import Tag from '../../components/Tag'
Expand DownExpand Up@@ -46,8 +47,9 @@ const styles = {
}

interface Props {
title?: string
description?: string
title: string
description: string
createdBy?: G.User | null
onSelect(): void
}

Expand All@@ -69,8 +71,8 @@ const TutorialItem = (props: Props) => (
<img src="https://via.placeholder.com/75/75" height="75px" width="75px" />
</div>
<div css={styles.right}>
<h2 css={styles.title}>{props.title || 'Title'}</h2>
<h3 css={styles.author}>Author Name</h3>
<h2 css={styles.title}>{props.title}</h2>
{props.createdBy &&<h3 css={styles.author}>{props.createdBy.name}</h3>}
<div css={styles.tags}>
<Tag>javascript</Tag>
</div>
Expand Down
7 changes: 7 additions & 0 deletionsweb-app/stories/SelectTutorial.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,19 @@ const tutorialList = [
title: 'Tutorial 1',
description: 'The first one',
},
createdBy: {
name: 'First Lastname',
},
},
{
id: '2',
summary: {
title: 'Tutorial 2',
description: 'The second one',
},
createdBy: {
name: 'Joe Schmo',
},
},
]

Expand All@@ -34,6 +40,7 @@ storiesOf('Select Tutorial', module)
onSelect={action('onSelect')}
title={tutorial.summary.title}
description={tutorial.summary.description}
createdBy={{ name: 'First Lastname' }}
/>
)
})

[8]ページ先頭

©2009-2025 Movatter.jp