Skip to content

Commit bb0c279

Browse files
committed
handle page changes from tabs
1 parent a898637 commit bb0c279

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Diff for: lib/components/Page/Hints/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ var styles = {
88
};
99
var Hints = function (_a) {
1010
var hints = _a.hints;
11-
return (React.createElement(List_1.List, null, hints.map(function (hint, index) { return React.createElement(List_1.ListItem, {secondaryText: React.createElement("p", null, index + 1, ". ", hint)}); }), React.createElement(List_1.ListItem, {secondaryText: React.createElement("p", {style: styles.add}, "+")})));
11+
return (React.createElement(List_1.List, null, !hints || !hints.length
12+
? []
13+
: hints.map(function (hint, index) { return React.createElement(List_1.ListItem, {secondaryText: React.createElement("p", null, index + 1, ". ", hint)}); }), React.createElement(List_1.ListItem, {secondaryText: React.createElement("p", {style: styles.add}, "+")})));
1214
};
1315
Object.defineProperty(exports, "__esModule", { value: true });
1416
exports.default = Hints;

Diff for: lib/components/Page/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var styles = {
99
var Page = function (_a) {
1010
var tutorial = _a.tutorial, pagePosition = _a.pagePosition;
1111
var page = tutorial.pages[pagePosition];
12+
console.log(page);
1213
if (!page) {
1314
return null;
1415
}

Diff for: src/components/Page/Hints/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const Hints: React.StatelessComponent<{
1212
hints: string[]
1313
}> = ({hints}) => (
1414
<List>
15-
{hints.map((hint, index) => <ListItem secondaryText={
15+
{!hints || !hints.length
16+
? []
17+
: hints.map((hint, index) => <ListItem secondaryText={
1618
<p>{index + 1}. {hint}</p>
1719
} />)}
1820
<ListItem secondaryText={

Diff for: src/components/Page/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const Page: React.StatelessComponent<{
1313
tutorial: CR.Tutorial, pagePosition: number
1414
}> = ({tutorial, pagePosition}) => {
1515
const page = tutorial.pages[pagePosition];
16+
console.log(page);
1617

1718
if (!page) { return null; }
1819

0 commit comments

Comments
 (0)