This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var ROOT_PATH = path.resolve(__dirname); | |
module.exports = { | |
entry: [ | |
path.resolve(ROOT_PATH, 'app/main'), | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import {RatpWidget} from './components/RatpWidget'; | |
var app = document.createElement('div'); | |
document.body.appendChild(app); | |
ReactDOM.render( | |
<RatpWidget type="metro" line="11" station="belleville" direction="chatelet" />, app | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
let ratpIcons = { | |
metro: { | |
type: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Metro-M.svg/2000px-Metro-M.svg.png", | |
line: function(lineNumber) { | |
return `http://www.ratp.fr/fr/upload/docs/image/gif/2010-11/pa_metro_ligne_${lineNumber}.gif` | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RatpHeader type="metro" line="11" station="Belleville" direction="Châtelet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RatpStatusBar message="Trafic normal sur l'ensemble de la ligne" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export let RatpStatusBar = React.createClass({ | |
getCurrentTime() { | |
let currentDate = new Date(); | |
return currentDate.toTimeString().replace(/.*(\d{2}:\d{2})(:\d{2}).*/, "$1"); | |
}, | |
render() { | |
return ( | |
<div className="status_bar"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export let HelloCard = React.createClass({ | |
render: function () { | |
return ( | |
<div className="simplecard"> | |
<div>{this.props.title}</div> | |
<p>Hello {this.props.message}!</p> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "react-widget-ratp", | |
"version": "0.0.1", | |
"main": "index.js", | |
"devDependencies": { | |
"babel-core": "^6.3.26", | |
"babel-loader": "^6.2.0", | |
"babel-preset-es2015": "^6.3.13", | |
"babel-preset-react": "^6.3.13", | |
"babel-runtime": "^6.3.19", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RatpWidget type="metro" line="11" station="belleville" direction="chatelet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cors = require("cors"), | |
jwt = require("jsonwebtoken"); | |
var corsOptions = { | |
"origin": "*", | |
"Access-Control-Allow-Origin": "*", | |
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE", | |
"preflightContinue": false | |
}; |