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

Commit2f329ba

Browse files
committed
load Markdown, Alert, render from core
1 parent7d8152d commit2f329ba

File tree

17 files changed

+55
-119
lines changed

17 files changed

+55
-119
lines changed

‎lib/components/SidePanel/SidePanel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ var SidePanel = (function (_super) {
2424
_super.apply(this,arguments);
2525
}
2626
SidePanel.prototype.render=function(){
27-
varwindowToggle=this.props.windowToggle;
28-
return(React.createElement("section",null,React.createElement(Drawer_1.default,{width:400,openSecondary:true,open:windowToggle},React.createElement("div",{className:'cr-bg'},React.createElement(index_1.AppMenu,null),React.createElement(Routes_1.default,null))),React.createElement(index_1.Alert,null)));
27+
varisWindowOpen=this.props.isWindowOpen;
28+
return(React.createElement("section",null,React.createElement(Drawer_1.default,{width:400,openSecondary:true,open:isWindowOpen},React.createElement("div",{className:'cr-bg'},React.createElement(index_1.AppMenu,null),React.createElement(Routes_1.default,null))),React.createElement(index_1.Alert,null)));
2929
};
3030
SidePanel=__decorate([
3131
react_redux_1.connect(function(state){return({
32-
windowToggle:state.windowToggle,
32+
isWindowOpen:state.window,
3333
});}),
3434
__metadata('design:paramtypes',[])
3535
],SidePanel);

‎lib/components/Start/Welcome/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ var styles = {
2727
textShadow:'1px 1px 0px #000',
2828
},
2929
};
30-
varWelcome=function(){return(React.createElement("div",{style:styles.header,className:'cr-bg'},React.createElement("div",{style:styles.title},"CodeRoad"),React.createElement("div",{style:styles.tagline},"Tutorials in your Editor"),React.createElement("br",null),React.createElement("br",null),React.createElement(index_1.RouteButton,{label:'Start',route:'tutorials',style:styles.button})));};
30+
varWelcome=function(_a){
31+
vartitle=_a.title,tagline=_a.tagline,firstRoute=_a.firstRoute;
32+
return(React.createElement("div",{style:styles.header,className:'cr-bg'},React.createElement("div",{style:styles.title},title),React.createElement("div",{style:styles.tagline},tagline),React.createElement("br",null),React.createElement("br",null),React.createElement(index_1.RouteButton,{label:'Start',route:firstRoute,style:styles.button})));
33+
};
3134
Object.defineProperty(exports,"__esModule",{value:true});
3235
exports.default=Welcome;

‎lib/components/Start/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ var Start = (function (_super) {
3030
}
3131
Start.prototype.render=function(){
3232
varready=this.props.ready;
33-
return(React.createElement("section",{className:'cr-start'},React.createElement("div",{style:headerStyles},ready ?React.createElement(Welcome_1.default,null) :React.createElement(Checks_1.default,null))));
33+
return(React.createElement("section",{className:'cr-start'},React.createElement("div",{style:headerStyles},ready
34+
?React.createElement(Welcome_1.default,{title:'CodeRoad',tagline:'Tutorials in your Editor',firstRoute:'tutorials'})
35+
:React.createElement(Checks_1.default,null))));
3436
};
3537
Start=__decorate([
3638
react_redux_1.connect(function(state){return({

‎lib/components/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
2-
varAlert_1=require('./Alert');
3-
exports.Alert=Alert_1.default;
2+
varcore_coderoad_1=require('core-coderoad');
3+
exports.Alert=core_coderoad_1.Alert;
4+
exports.Markdown=core_coderoad_1.Markdown;
45
varAppMenu_1=require('./AppMenu');
56
exports.AppMenu=AppMenu_1.default;
67
varFinalPage_1=require('./FinalPage');
@@ -15,9 +16,7 @@ var Start_1 = require('./Start');
1516
exports.Start=Start_1.default;
1617
varTutorials_1=require('./Tutorials');
1718
exports.Tutorials=Tutorials_1.default;
18-
varMarkdown_1=require('./common/Markdown');
19-
exports.Markdown=Markdown_1.default;
20-
varContentCard_1=require('./common/ContentCard');
21-
exports.ContentCard=ContentCard_1.default;
2219
varRouteButton_1=require('./common/RouteButton');
2320
exports.RouteButton=RouteButton_1.default;
21+
varContentCard_1=require('./common/ContentCard');
22+
exports.ContentCard=ContentCard_1.default;

‎lib/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ exports.default = redux_1.combineReducers({
1313
alert:core_coderoad_1.alertReducer,checks:setup_1.checks,editor:core_coderoad_1.editorReducer,dir:core_coderoad_1.dirReducer,hintPosition:hints_1.reducer,
1414
packageJson:setup_1.packageJson,pagePosition:page_1.pagePosition,progress:progress_1.reducer,route:core_coderoad_1.routeReducer,
1515
tutorial:tutorial_1.reducer,tutorials:tutorials_1.reducer,
16-
taskActions:page_1.taskActions,taskPosition:tests_1.taskPosition,taskTests:page_1.taskTests,testRun:tests_1.testRun,windowToggle:core_coderoad_1.windowToggle
16+
taskActions:page_1.taskActions,taskPosition:tests_1.taskPosition,taskTests:page_1.taskTests,testRun:tests_1.testRun,window:core_coderoad_1.windowReducer
1717
});

‎package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
"atom-plugin-command-line":"1.0.2",
3333
"coderoad-cli":"0.6.0",
3434
"core-coderoad":"0.3.0",
35-
"highlights":"1.3.1",
36-
"marked":"0.3.5",
3735
"material-ui":"0.15.0",
3836
"node-file-exists":"1.1.0",
3937
"react":"15.1.0",

‎src/components/Alert/index.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎src/components/Routes/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ import * as React from 'react';
22
import{connect}from'react-redux';
33
import{Page,Progress,Tutorials,Start,FinalPage}from'../index';
44

5+
// const createRouter = (routes: Object) => {
6+
// return;
7+
// };
8+
//
9+
// const router = {
10+
// page: <Page />,
11+
// progress: <Progress />,
12+
// start: <Start />,
13+
// tutorials: <Tutorials />,
14+
// final: <FinalPage />,
15+
// };
16+
517
@connect(state=>({route:state.route}))
618
exportdefaultclassRoutesextendsReact.Component<{
719
route?:string

‎src/components/SidePanel/SidePanel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import Drawer from 'material-ui/Drawer';
66
importMenufrom'material-ui/svg-icons/navigation/menu';
77

88
@connect(state=>({
9-
windowToggle:state.windowToggle,
9+
isWindowOpen:state.window,
1010
}))
1111
exportdefaultclassSidePanelextendsReact.Component<{
12-
windowToggle?:boolean
12+
isWindowOpen?:boolean
1313
},{}>{
1414
render():React.ReactElement<{}>{
15-
const{windowToggle}=this.props;
15+
const{isWindowOpen}=this.props;
1616
return(
1717
<section>
1818
<Drawer
1919
width={400}
2020
openSecondary={true}
21-
open={windowToggle}
21+
open={isWindowOpen}
2222
>
2323
<divclassName='cr-bg'>
2424
<AppMenu/>

‎src/components/Start/Welcome/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ const styles = {
3232
},
3333
};
3434

35-
constWelcome:React.StatelessComponent<{}>=()=>(
35+
constWelcome:React.StatelessComponent<{
36+
title:string,tagline:string,firstRoute:string
37+
}>=({title, tagline, firstRoute})=>(
3638
<divstyle={styles.header}className='cr-bg'>
37-
<divstyle={styles.title}>CodeRoad</div>
38-
<divstyle={styles.tagline}>Tutorials in your Editor</div>
39+
<divstyle={styles.title}>{title}</div>
40+
<divstyle={styles.tagline}>{tagline}</div>
3941
<br/><br/>
4042
<RouteButton
4143
label='Start'
42-
route='tutorials'
44+
route={firstRoute}
4345
style={styles.button}
4446
/>
4547
</div>

‎src/components/Start/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export default class Start extends React.Component<{
2121
return(
2222
<sectionclassName='cr-start'>
2323
<divstyle={headerStyles}>
24-
{ready ?<Welcome/> :<Checks/>}
24+
{ready
25+
?<Welcome
26+
title='CodeRoad'
27+
tagline='Tutorials in your Editor'
28+
firstRoute='tutorials'
29+
/>
30+
:<Checks/>}
2531
</div>
2632
</section>
2733
);

‎src/components/common/Markdown.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎src/components/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export{defaultasAlert}from'./Alert';
1+
export{
2+
Alert,Markdown
3+
}from'core-coderoad';
4+
25
export{defaultasAppMenu}from'./AppMenu';
36
export{defaultasFinalPage}from'./FinalPage';
47
export{defaultasPage}from'./Page';
@@ -7,6 +10,5 @@ export {default as Routes} from './Routes';
710
export{defaultasStart}from'./Start';
811
export{defaultasTutorials}from'./Tutorials';
912

10-
export{defaultasMarkdown}from'./common/Markdown';
11-
export{defaultasContentCard}from'./common/ContentCard';
1213
export{defaultasRouteButton}from'./common/RouteButton';
14+
export{defaultasContentCard}from'./common/ContentCard';

‎src/components/render.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import*asReactfrom'react';
2-
importrenderfrom'./components/render';
32
importsidePanelElementfrom'./components/SidePanel/element';
4-
import{loadPolyfills}from'core-coderoad';
3+
importsidePanelRootfrom'./components/SidePanel/root';
4+
import{loadPolyfills,render}from'core-coderoad';
55
import{onActivate,onDeactivate,addToStatusBar}from'./subscriptions';
66
// activate Redux
77
importstorefrom'./store';
@@ -26,7 +26,7 @@ class Main {
2626
});
2727
onActivate();
2828
// render React component
29-
render(this.root);
29+
render(this.root,sidePanelRoot(store));
3030
}
3131
consumeStatusBar(statusBar){
3232
this.statusBarTile=addToStatusBar(statusBar);

‎src/reducers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import {
1414
editorReduceraseditor,
1515
dirReducerasdir,
1616
routeReducerasroute,
17-
windowToggle
17+
windowReduceraswindow
1818
}from'core-coderoad';
1919

2020
exportdefaultcombineReducers({
2121
alert, checks, editor, dir, hintPosition,
2222
packageJson, pagePosition, progress, route,
2323
tutorial, tutorials,
24-
taskActions, taskPosition, taskTests, testRun,windowToggle
24+
taskActions, taskPosition, taskTests, testRun,window
2525
});

‎tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"src/store.ts",
8181
"src/subscriptions.ts",
8282
"src/typings.d.ts",
83-
"src/components/Alert/index.tsx",
8483
"src/components/AppMenu/CloseWindow.tsx",
8584
"src/components/AppMenu/index.tsx",
8685
"src/components/AppMenu/issuesLink.tsx",
@@ -90,7 +89,6 @@
9089
"src/components/AppMenu/menuRightRouteOptions.tsx",
9190
"src/components/AppMenu/Quit/index.tsx",
9291
"src/components/common/ContentCard.tsx",
93-
"src/components/common/Markdown.tsx",
9492
"src/components/common/RouteButton.tsx",
9593
"src/components/FinalPage/index.tsx",
9694
"src/components/Page/EditPage/index.tsx",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp