Skip to content

Commit 6cd7f72

Browse files
committed
create tutorial item type, fix typings
1 parent 0307ad1 commit 6cd7f72

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/components/Tutorials/SelectTutorial/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import FlatButton from 'material-ui/FlatButton';
77
selectTutorial: (name: string) => dispatch(tutorialSet(name)),
88
}))
99
export default class SelectTutorial extends React.Component<{
10-
tutorial: Tutorial.Info, selectTutorial?: any
10+
tutorial: Tutorial.Item, selectTutorial?: any
1111
}, {}> {
1212
displayName(name: string): string {
1313
if (name.match(/^coderoad-tutorial-/)) {
@@ -19,7 +19,7 @@ export default class SelectTutorial extends React.Component<{
1919
}
2020
render() {
2121
const {tutorial, selectTutorial} = this.props;
22-
const {name} = tutorial;
22+
const name = tutorial.name;
2323
return (
2424
<FlatButton
2525
label={this.displayName(name)}

src/components/Tutorials/UpdateTutorial/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const styles = {
1313
tutorialUpdate: (title: string) => dispatch(tutorialUpdate(title)),
1414
}))
1515
export default class UpdateTutorial extends React.Component<{
16-
tutorial: Tutorial.Info, tutorialUpdate?: any
16+
tutorial: Tutorial.Item, tutorialUpdate?: any
1717
}, {}> {
1818
render() {
1919
const {tutorial, tutorialUpdate} = this.props;
@@ -22,8 +22,8 @@ export default class UpdateTutorial extends React.Component<{
2222
<Update
2323
style={styles}
2424
color={pink500}
25-
onTouchTap={tutorialUpdate.bind(this, tutorial.title)}
26-
/>
25+
onTouchTap={tutorialUpdate.bind(this, tutorial.name)}
26+
/>``
2727
<span style={{marginLeft: '10px'}}>{tutorial.latest}</span>
2828
</span>
2929
);

src/components/Tutorials/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const styles = {
1919
loadTutorials: () => dispatch(tutorialsFind()),
2020
}))
2121
export default class Tutorials extends React.Component<{
22-
tutorials?: Tutorial.Info[], loadTutorials?: any
22+
tutorials?: Tutorial.Item[], loadTutorials?: any
2323
}, {}> {
2424
constructor(props) {
2525
super(props);
@@ -45,7 +45,7 @@ export default class Tutorials extends React.Component<{
4545

4646
<TableBody displayRowCheckbox={false}>
4747
{tutorials.map(function tutorialRow(
48-
tutorial: Tutorial.Info, index: number
48+
tutorial: Tutorial.Item, index: number
4949
) {
5050
return (
5151
<TableRow key={index}>

0 commit comments

Comments
 (0)