Skip to content

Commit 4e46600

Browse files
committed
restructure components, style fixes
1 parent 9732c82 commit 4e46600

File tree

33 files changed

+68
-58
lines changed

33 files changed

+68
-58
lines changed

lib/components/AppMenu/MenuLink.js renamed to lib/components/AppMenu/MenuLink/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var MenuItem_1 = require('material-ui/MenuItem');
19-
var actions_1 = require('../../actions');
19+
var actions_1 = require('../../../actions');
2020
var MenuLink = (function (_super) {
2121
__extends(MenuLink, _super);
2222
function MenuLink() {

lib/components/AppMenu/Quit.js renamed to lib/components/AppMenu/Quit/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515
};
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
18-
var mount_1 = require('../mount');
19-
var subscriptions_1 = require('../../atom/subscriptions');
18+
var mount_1 = require('../../mount');
19+
var subscriptions_1 = require('../../../atom/subscriptions');
2020
var MenuItem_1 = require('material-ui/MenuItem');
2121
var Quit = (function (_super) {
2222
__extends(Quit, _super);
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var React = require('react');
3-
var path = require('path');
3+
var path_1 = require('path');
44
var mode_edit_1 = require('material-ui/svg-icons/editor/mode-edit');
55
var editStyle = {
66
position: 'absolute',
@@ -10,7 +10,7 @@ var editStyle = {
1010
exports.EditPage = function (_a) {
1111
var tutorial = _a.tutorial;
1212
if (tutorial && tutorial.edit && tutorial.repo) {
13-
var repoPath = path.join(tutorial.repo, 'edit', 'master', tutorial.repo);
13+
var repoPath = path_1.join(tutorial.repo, 'edit', 'master', tutorial.repo);
1414
return (React.createElement("a", {href: repoPath}, React.createElement(mode_edit_1.default, {style: editStyle})));
1515
}
1616
};

lib/components/Page/PageComplete/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var index_1 = require('../../index');
55
var colors_1 = require('material-ui/styles/colors');
66
var styles = {
77
backgroundColor: colors_1.cyan500,
8+
zIndex: '0',
89
position: 'fixed',
910
bottom: '20px',
1011
padding: '10px 15px 30px',

lib/components/Page/PageContent.js renamed to lib/components/Page/PageContent/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var React = require('react');
3-
var index_1 = require('../index');
3+
var index_1 = require('../../index');
44
var Card_1 = require('material-ui/Card');
55
var styles = {
66
margin: '5px'

lib/components/Page/PageToolbar/Continue.js renamed to lib/components/Page/PageToolbar/Continue/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var FlatButton_1 = require('material-ui/FlatButton');
19-
var actions_1 = require('../../../actions');
19+
var actions_1 = require('../../../../actions');
20+
var styles = {
21+
zIndex: '10000',
22+
};
2023
var Continue = (function (_super) {
2124
__extends(Continue, _super);
2225
function Continue() {
2326
_super.apply(this, arguments);
2427
}
2528
Continue.prototype.render = function () {
26-
return (React.createElement(FlatButton_1.default, {label: 'Continue', primary: true, onTouchTap: this.props.callNextPage}));
29+
return (React.createElement(FlatButton_1.default, {style: styles, label: 'Continue', secondary: true, onTouchTap: this.props.callNextPage}));
2730
};
2831
Continue = __decorate([
2932
react_redux_1.connect(null, function (dispatch, state) {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use strict";
22
var React = require('react');
33
var FlatButton_1 = require('material-ui/FlatButton');
4-
var editor_1 = require('../../../atom/editor');
4+
var editor_1 = require('../../../../atom/editor');
55
exports.Save = function () { return (React.createElement(FlatButton_1.default, {label: 'Save', secondary: true, onTouchTap: editor_1.save})); };
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
var React = require('react');
33
var code_1 = require('material-ui/svg-icons/action/code');
4-
var actions_1 = require('../../../atom/actions');
4+
var actions_1 = require('../../../../atom/actions');
55
var FlatButton_1 = require('material-ui/FlatButton');
66
exports.ToggleLog = function () { return (React.createElement(FlatButton_1.default, {icon: React.createElement(code_1.default, null), onTouchTap: actions_1.toggleDevTools})); };

lib/components/Page/PageToolbar/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var ToggleLog_1 = require('./ToggleLog');
55
var Save_1 = require('./Save');
66
var Continue_1 = require('./Continue');
77
var styles = {
8-
zIndex: '10000',
8+
zIndex: '1000',
99
position: 'fixed',
1010
bottom: '0',
1111
right: '0',

lib/components/Progress/ProgressPage.js renamed to lib/components/Progress/ProgresPage/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515
};
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
18-
var actions_1 = require('../../actions');
18+
var actions_1 = require('../../../actions');
1919
var List_1 = require('material-ui/List');
20-
var progressIcon_1 = require('./progressIcon');
20+
var progressIcon_1 = require('../progressIcon');
2121
var colors_1 = require('material-ui/styles/colors');
2222
var styles = {
2323
paddingLeft: '15px',

lib/components/Progress/ProgressChapter.js renamed to lib/components/Progress/ProgressChapter/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
22
var React = require('react');
33
var List_1 = require('material-ui/List');
4-
var ProgressPage_1 = require('./ProgressPage');
5-
var index_1 = require('../index');
4+
var ProgressPage_1 = require('../ProgressPage');
5+
var index_1 = require('../../index');
66
var styles = {
77
marginBottom: '0'
88
};

lib/components/Progress/progressIcon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var play_circle_filled_1 = require('material-ui/svg-icons/av/play-circle-filled'
66
var check_box_outline_blank_1 = require('material-ui/svg-icons/toggle/check-box-outline-blank');
77
function progressIcon(completed, current) {
88
if (completed) {
9-
return React.createElement(check_box_1.default, null);
9+
return React.createElement(check_box_1.default, {color: colors_1.green300});
1010
}
1111
else if (current) {
1212
return React.createElement(play_circle_filled_1.default, {color: colors_1.pink500});

lib/components/Tutorials/LoadTutorials.js renamed to lib/components/Tutorials/LoadTutorials/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515
};
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
18-
var actions_1 = require('../../actions');
18+
var actions_1 = require('../../../actions');
1919
var FlatButton_1 = require('material-ui/FlatButton');
2020
var LoadTutorials = (function (_super) {
2121
__extends(LoadTutorials, _super);

lib/components/Tutorials/SelectTutorial.js renamed to lib/components/Tutorials/SelectTutorial/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var FlatButton_1 = require('material-ui/FlatButton');
19-
var actions_1 = require('../../actions');
19+
var actions_1 = require('../../../actions');
2020
function displayName(name) {
2121
if (name.match(/^coderoad-tutorial-/)) {
2222
return name.slice(18);

src/components/AppMenu/MenuLink.tsx renamed to src/components/AppMenu/MenuLink/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
33
import MenuItem from 'material-ui/MenuItem';
4-
import {pageSet, routeSet} from '../../actions';
4+
import {pageSet, routeSet} from '../../../actions';
55

66
@connect(null, (dispatch) => {
77
return {

src/components/AppMenu/Quit.tsx renamed to src/components/AppMenu/Quit/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
3-
import {togglePanel} from '../mount';
4-
import {onDeactivate} from '../../atom/subscriptions';
3+
import {togglePanel} from '../../mount';
4+
import {onDeactivate} from '../../../atom/subscriptions';
55
import MenuItem from 'material-ui/MenuItem';
66

77
@connect(null, (dispatch) => {

src/components/Page/EditPage.tsx renamed to src/components/Page/EditPage/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import * as path from 'path';
3-
import {store} from '../../store';
2+
import {join} from 'path';
3+
import {store} from '../../../store';
44

55
import NavigationClose from 'material-ui/svg-icons/navigation/close';
66
import ModeEdit from 'material-ui/svg-icons/editor/mode-edit';
@@ -14,7 +14,7 @@ export const EditPage: React.StatelessComponent<{
1414
tutorial: Tutorial.Config
1515
}> = ({tutorial}) => {
1616
if (tutorial && tutorial.edit && tutorial.repo) {
17-
const repoPath = path.join(tutorial.repo, 'edit', 'master', tutorial.repo);
17+
const repoPath = join(tutorial.repo, 'edit', 'master', tutorial.repo);
1818
return (
1919
<a href={repoPath}>
2020
<ModeEdit style={editStyle}/>

src/components/Page/PageComplete/index.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {cyan500, grey100} from 'material-ui/styles/colors';
55

66
const styles = {
77
backgroundColor: cyan500,
8+
zIndex: '0',
89
position: 'fixed',
910
bottom: '20px',
1011
padding: '10px 15px 30px',
@@ -23,12 +24,12 @@ export const PageComplete: React.StatelessComponent<{
2324
}> = ({page}) => (
2425
<div className='cr-page-onComplete'>
2526
{page.completed && page.onPageComplete
26-
? <Card style={styles}>
27-
<CardText>
28-
<Markdown style={textStyles}>{page.onPageComplete}</Markdown>
29-
</CardText>
30-
</Card>
31-
: null
27+
? <Card style={styles}>
28+
<CardText>
29+
<Markdown style={textStyles}>{page.onPageComplete}</Markdown>
30+
</CardText>
31+
</Card>
32+
: null
3233
}
3334
</div>
3435
);

src/components/Page/PageContent.tsx renamed to src/components/Page/PageContent/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import {Markdown} from '../index';
2+
import {Markdown} from '../../index';
33
import {Card, CardHeader, CardText} from 'material-ui/Card';
44

55
const styles = {

src/components/Page/PageToolbar/Continue.tsx renamed to src/components/Page/PageToolbar/Continue/index.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
33
import FlatButton from 'material-ui/FlatButton';
4-
import {pageNext, testsLoad} from '../../../actions';
4+
import {pageNext, testsLoad} from '../../../../actions';
5+
6+
const styles = {
7+
zIndex: '10000',
8+
};
59

610
@connect(null, (dispatch, state) => {
711
return {
@@ -17,8 +21,9 @@ export class Continue extends React.Component<{
1721
render() {
1822
return (
1923
<FlatButton
24+
style={styles}
2025
label='Continue'
21-
primary={true}
26+
secondary={true}
2227
onTouchTap={this.props.callNextPage}
2328
/>
2429
);

src/components/Page/PageToolbar/Save.tsx renamed to src/components/Page/PageToolbar/Save/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import FlatButton from 'material-ui/FlatButton';
3-
import {save} from '../../../atom/editor';
3+
import {save} from '../../../../atom/editor';
44

55
export const Save = () => (
66
<FlatButton

src/components/Page/PageToolbar/ToggleLog.tsx renamed to src/components/Page/PageToolbar/ToggleLog/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import Code from 'material-ui/svg-icons/action/code';
3-
import {toggleDevTools} from '../../../atom/actions';
3+
import {toggleDevTools} from '../../../../atom/actions';
44
import FlatButton from 'material-ui/FlatButton';
55

66
export const ToggleLog = () => (

src/components/Page/PageToolbar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Save} from './Save';
55
import {Continue} from './Continue';
66

77
const styles = {
8-
zIndex: '10000',
8+
zIndex: '1000',
99
position: 'fixed',
1010
bottom: '0',
1111
right: '0',

src/components/Progress/ProgressPage.tsx renamed to src/components/Progress/ProgresPage/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
3-
import {pageSet, routeSet, testsLoad} from '../../actions';
3+
import {pageSet, routeSet, testsLoad} from '../../../actions';
44
import * as classnames from 'classnames';
55
import {ListItem} from 'material-ui/List';
6-
import {progressIcon} from './progressIcon';
6+
import {progressIcon} from '../progressIcon';
77
import {grey400} from 'material-ui/styles/colors';
88

99
const styles = {

src/components/Progress/ProgressChapter.tsx renamed to src/components/Progress/ProgressChapter/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import {ListItem} from 'material-ui/List';
3-
import {ProgressPage} from './ProgressPage';
4-
import {progressIcon} from './progressIcon';
5-
import {Markdown} from '../index';
3+
import {ProgressPage} from '../ProgressPage';
4+
import {progressIcon} from '../progressIcon';
5+
import {Markdown} from '../../index';
66

77
const styles = {
88
marginBottom: '0'

src/components/Progress/progressIcon.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as React from 'react';
2-
import {pink500} from 'material-ui/styles/colors';
2+
import {pink500, green300} from 'material-ui/styles/colors';
33
import CheckBox from 'material-ui/svg-icons/toggle/check-box';
44
import PlayCircleFilled from 'material-ui/svg-icons/av/play-circle-filled';
55
import CheckBoxOutlineBlank from 'material-ui/svg-icons/toggle/check-box-outline-blank';
66

77
export function progressIcon(completed: boolean, current?: boolean) {
88
if (completed) {
9-
return <CheckBox />;
9+
return <CheckBox color={green300} />;
1010
} else if (current) {
1111
return <PlayCircleFilled color={pink500} />;
1212
} else {

src/components/Tutorials/LoadTutorials.tsx renamed to src/components/Tutorials/LoadTutorials/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
3-
import {tutorialsFind} from '../../actions';
3+
import {tutorialsFind} from '../../../actions';
44
import FlatButton from 'material-ui/FlatButton';
55

66
@connect(null, (dispatch) => {

src/components/Tutorials/SelectTutorial.tsx renamed to src/components/Tutorials/SelectTutorial/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
33
import FlatButton from 'material-ui/FlatButton';
44
import {
55
positionSet, tutorialSet, progressLoad, routeSet
6-
} from '../../actions';
6+
} from '../../../actions';
77

88
function displayName(name: string): string {
99
if (name.match(/^coderoad-tutorial-/)) {

tsconfig.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,32 @@
112112
"src/components/AppMenu/issuesLink.tsx",
113113
"src/components/AppMenu/menuIconLeft.tsx",
114114
"src/components/AppMenu/menuIconRight.tsx",
115-
"src/components/AppMenu/MenuLink.tsx",
115+
"src/components/AppMenu/MenuLink/index.tsx",
116116
"src/components/AppMenu/menuRight.tsx",
117117
"src/components/AppMenu/menuRightRouteOptions.tsx",
118-
"src/components/AppMenu/Quit.tsx",
118+
"src/components/AppMenu/Quit/index.tsx",
119119
"src/components/Common/RouteButton.tsx",
120120
"src/components/FinalPage/index.tsx",
121121
"src/components/Markdown/index.tsx",
122122
"src/components/Page/Chapter/index.tsx",
123-
"src/components/Page/EditPage.tsx",
123+
"src/components/Page/EditPage/index.tsx",
124124
"src/components/Page/Hints/HintButton.tsx",
125125
"src/components/Page/Hints/index.tsx",
126126
"src/components/Page/index.tsx",
127127
"src/components/Page/PageComplete/index.tsx",
128-
"src/components/Page/PageContent.tsx",
129-
"src/components/Page/PageToolbar/Continue.tsx",
128+
"src/components/Page/PageContent/index.tsx",
129+
"src/components/Page/PageToolbar/Continue/index.tsx",
130130
"src/components/Page/PageToolbar/index.tsx",
131-
"src/components/Page/PageToolbar/Save.tsx",
132-
"src/components/Page/PageToolbar/ToggleLog.tsx",
133-
"src/components/Page/ProgressBar.tsx",
131+
"src/components/Page/PageToolbar/Save/index.tsx",
132+
"src/components/Page/PageToolbar/ToggleLog/index.tsx",
133+
"src/components/Page/ProgressBar/index.tsx",
134134
"src/components/Page/Tasks/index.tsx",
135135
"src/components/Page/Tasks/Task.tsx",
136136
"src/components/Page/Tasks/TaskCheckbox.tsx",
137137
"src/components/Progress/index.tsx",
138-
"src/components/Progress/ProgressChapter.tsx",
138+
"src/components/Progress/ProgresPage/index.tsx",
139+
"src/components/Progress/ProgressChapter/index.tsx",
139140
"src/components/Progress/progressIcon.tsx",
140-
"src/components/Progress/ProgressPage.tsx",
141141
"src/components/render.tsx",
142142
"src/components/Routes/index.tsx",
143143
"src/components/Start/Checks/DynamicStepper.tsx",
@@ -150,9 +150,9 @@
150150
"src/components/Start/index.tsx",
151151
"src/components/Start/Welcome/index.tsx",
152152
"src/components/Tutorials/index.tsx",
153-
"src/components/Tutorials/LoadTutorials.tsx",
154-
"src/components/Tutorials/SelectTutorial.tsx",
155-
"src/components/Tutorials/UpdateTutorial.tsx"
153+
"src/components/Tutorials/LoadTutorials/index.tsx",
154+
"src/components/Tutorials/SelectTutorial/index.tsx",
155+
"src/components/Tutorials/UpdateTutorial/index.tsx"
156156
],
157157
"exclude": [
158158
"node_modules"

0 commit comments

Comments
 (0)