Bootstrap pages

old
Javi Velasco 2015-10-26 01:31:52 +01:00
parent b7ba8c1ed0
commit e897de53d2
9 changed files with 94 additions and 10 deletions

18
docs/app/app-routes.jsx Normal file
View File

@ -0,0 +1,18 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
import Layout from './pages/layout';
import Home from './pages/home';
import Playground from './pages/playground';
import Components from './pages/components';
import { Route, IndexRoute } from 'react-router';
const Routes = (
<Route path="/" component={Layout}>
<Route path="home" component={Home} />
<Route path="components" component={Components} />
<Route path="playground" component={Playground} />
<IndexRoute component={Home}/>
</Route>
);
export default Routes;

View File

@ -1,16 +1,16 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
import ReactDOM from 'react-dom';
import style from 'react-toolbox/commons';
import code from './examples/example.txt';
import Playground from './components/playground';
import Router from 'react-router';
import AppRoutes from './app-routes';
import createHashHistory from 'history/lib/createHashHistory';
const App = () => {
const Docs = () => {
return (
<app className={style.app}>
<Playground codeText={code} />
</app>
<Router history={createHashHistory({queryKey: false})}>
{AppRoutes}
</Router>
);
};
ReactDOM.render(<App/>, document.getElementById('app'));
ReactDOM.render(<Docs/>, document.getElementById('app'));

View File

@ -0,0 +1,8 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
const Components = () => {
return <p>List of components here</p>;
};
export default Components;

14
docs/app/pages/home.jsx Normal file
View File

@ -0,0 +1,14 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
import style from './style';
const Home = () => {
return (
<div>
<p>This will be the home page</p>
<div className={style.test}></div>
</div>
);
};
export default Home;

20
docs/app/pages/layout.jsx Normal file
View File

@ -0,0 +1,20 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
import style from 'react-toolbox/commons';
import { Link } from 'react-router';
const Layout = (props) => {
return (
<app className={style.app}>
<h5>React Toolbox</h5>
<ul>
<li><Link to="/home">Home</Link></li>
<li><Link to="/playground">Playground</Link></li>
<li><Link to="/components">Components</Link></li>
</ul>
{props.children}
</app>
);
};
export default Layout;

View File

@ -0,0 +1,15 @@
/*eslint-disable no-unused-vars*/
import React from 'react';
import code from '../examples/example.txt';
import Playground from '../components/playground';
const Components = () => {
return (
<section>
<p>Here should be the playground</p>
<Playground codeText={code} />
</section>
);
};
export default Components;

View File

@ -0,0 +1,7 @@
.test {
width: 100%;
height: 400px;
background: linear-gradient(45deg, #a177ff 0%, #02ceff 100%);
background-position: top right;
background-size: 120%;
}

View File

@ -8,8 +8,10 @@
},
"dependencies": {
"codemirror": "^5.8.0",
"history": "^1.12.6",
"react": "^0.14.0",
"react-dom": "^0.14.0"
"react-dom": "^0.14.0",
"react-router": "^1.0.0-rc3"
},
"devDependencies": {
"autoprefixer": "^6.0.3",

View File

@ -17,7 +17,7 @@
],
"main": "./lib",
"scripts": {
"start": "node ./server",
"start": "UV_THREADPOOL_SIZE=100 node ./server",
"babel": "babel ./components --out-dir ./lib",
"build": "npm run lint && npm run babel && npm run sass",
"clean": "rimraf ./lib",