Skip to content

Commit a898637

Browse files
committed
adjust tab styles
1 parent ac9dbd0 commit a898637

File tree

8 files changed

+50
-13
lines changed

8 files changed

+50
-13
lines changed

lib/components/Page/Hints/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
"use strict";
22
var React = require('react');
33
var List_1 = require('material-ui/List');
4+
var styles = {
5+
add: {
6+
textAlign: 'center',
7+
},
8+
};
49
var Hints = function (_a) {
510
var hints = _a.hints;
6-
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)}); })));
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}, "+")})));
712
};
813
Object.defineProperty(exports, "__esModule", { value: true });
914
exports.default = Hints;

lib/components/Page/Task/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var index_1 = require('../../index');
44
var colors_1 = require('material-ui/styles/colors');
55
var styles = {
66
margin: '5px',
7-
padding: '10px 5px',
7+
padding: '10px 10px',
88
};
99
function getStatus(index, taskPosition, testRun) {
1010
return index < taskPosition ? colors_1.lightGreen200 : 'inherit';

lib/components/Page/TaskActions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var TaskActions = (function (_super) {
3030
return obj;
3131
});
3232
return (React.createElement(Stepper_1.Stepper, {activeStep: stepIndex, linear: false, orientation: 'vertical'}, actionList.map(function (a, index) { return (React.createElement(Stepper_1.Step, null, React.createElement(Stepper_1.StepButton, {onClick: function () { return _this.setState({ stepIndex: index }); }}, a.action + (a.singleLine ? ' ' + a.content : '')), React.createElement(Stepper_1.StepContent, null, a.singleLine ? ''
33-
: React.createElement(index_1.Markdown, null, a.content)))); })));
33+
: React.createElement(index_1.Markdown, null, '```js\n' + a.content + '\n```')))); })));
3434
};
3535
return TaskActions;
3636
}(React.Component));

lib/components/TopPanel/TopPanel.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var Tabs_1 = require('material-ui/Tabs');
19-
var add_1 = require('material-ui/svg-icons/content/add');
2019
var actions_1 = require('../../actions');
2120
var styles = {
22-
tabs: {
21+
all: {
2322
marginRight: '400px',
23+
height: '33px',
24+
top: '-15px',
25+
position: 'relative',
26+
},
27+
tabs: {
28+
height: '33px',
29+
backgroundColor: 'black',
30+
},
31+
tab: {
32+
fontSize: '12px',
2433
},
2534
};
2635
var TopPanel = (function (_super) {
@@ -34,9 +43,9 @@ var TopPanel = (function (_super) {
3443
if (!tutorial || !tutorial.pages) {
3544
return null;
3645
}
37-
return (React.createElement(Tabs_1.Tabs, {style: styles.tabs}, tutorial.pages.map(function (page, index) {
38-
return (React.createElement(Tabs_1.Tab, {key: index.toString(), label: page.title.substring(0, 10), onClick: pageSet.bind(_this, index)}));
39-
}), React.createElement(Tabs_1.Tab, {icon: React.createElement(add_1.default, {onClick: pageAdd})})));
46+
return (React.createElement(Tabs_1.Tabs, {tabItemContainerStyle: styles.tabs, style: styles.all}, tutorial.pages.map(function (page, index) {
47+
return (React.createElement(Tabs_1.Tab, {style: styles.tab, key: index.toString(), label: page.title.substring(0, 10), onClick: pageSet.bind(_this, index)}));
48+
}), React.createElement(Tabs_1.Tab, {style: styles.tab, label: '+'})));
4049
};
4150
TopPanel = __decorate([
4251
react_redux_1.connect(null, function (dispatch) {

src/components/Page/Hints/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@ import * as React from 'react';
22
import {List, ListItem} from 'material-ui/List';
33
import FontIcon from 'material-ui/FontIcon';
44

5+
const styles = {
6+
add: {
7+
textAlign: 'center',
8+
},
9+
};
10+
511
const Hints: React.StatelessComponent<{
612
hints: string[]
713
}> = ({hints}) => (
814
<List>
915
{hints.map((hint, index) => <ListItem secondaryText={
1016
<p>{index + 1}. {hint}</p>
1117
} />)}
18+
<ListItem secondaryText={
19+
<p style={styles.add}>+</p>
20+
} />
1221
</List>
1322
);
1423
export default Hints;

src/components/Page/Task/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {lightGreen200, orange200} from 'material-ui/styles/colors';
66

77
const styles = {
88
margin: '5px',
9-
padding: '10px 5px',
9+
padding: '10px 10px',
1010
};
1111

1212
function getStatus(

src/components/Page/TaskActions/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class TaskActions extends React.Component<{
4242
</StepButton>
4343
<StepContent>
4444
{a.singleLine ? ''
45-
: <Markdown>{a.content}</Markdown>
45+
: <Markdown>{'```js\n' + a.content + '\n```'}</Markdown>
4646
}
4747
</StepContent>
4848
</Step>

src/components/TopPanel/TopPanel.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ import Add from 'material-ui/svg-icons/content/add';
55
import {pageSet, tutorialPageAdd} from '../../actions';
66

77
const styles = {
8-
tabs: {
8+
all: {
99
marginRight: '400px',
10+
height: '33px',
11+
top: '-15px',
12+
position: 'relative',
13+
},
14+
tabs: {
15+
height: '33px',
16+
backgroundColor: 'black',
17+
},
18+
tab: {
19+
fontSize: '12px',
1020
},
1121
};
1222

@@ -27,17 +37,21 @@ export default class TopPanel extends React.Component<{
2737
if (!tutorial || !tutorial.pages) { return null; }
2838

2939
return (
30-
<Tabs style={styles.tabs}>
40+
<Tabs tabItemContainerStyle={styles.tabs} style={styles.all}>
3141
{tutorial.pages.map((page: CR.Page, index) => {
3242
return (
3343
<Tab
44+
style={styles.tab}
3445
key={index.toString()}
3546
label={page.title.substring(0, 10)}
3647
onClick={pageSet.bind(this, index)}
3748
/>
3849
);
3950
})}
40-
<Tab icon={<Add onClick={pageAdd}/>} />
51+
<Tab
52+
style={styles.tab}
53+
label='+'
54+
/>
4155
</Tabs>
4256
);
4357
}

0 commit comments

Comments
 (0)