-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathComponents_App_App.jsx.html
161 lines (131 loc) · 6.21 KB
/
Components_App_App.jsx.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Components/App/App.jsx</title>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="./build/entry.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="https://fonts.googleapis.com/css?family=Muli:100,400,700|Oswald:300|Inconsolata,700" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
</head>
<body>
<div id="stickyNavbarOverlay"></div>
<div class="top-navbar">
<div class="container">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<h1 class="navbar-item">Documentation</h1>
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
</nav>
</div>
</div>
<div class="container">
<div class="columns">
<div class="column is-3" id="sidebarNav">
<div class="sidebar">
<nav>
<h2><a href="index.html">Home</a></h2><div class="category"><h3>Global</h3><ul><li><a href="global.html#App">App</a></li><li><a href="global.html#TrackSelect">TrackSelect</a></li></ul></div><div class="category"><h2>Constants</h2><h3>Global</h3><ul><li><a href="global.html#DEFAULT_MOTS">DEFAULT_MOTS</a></li></ul></div><div class="category"><h2>Map</h2><h3>Classes</h3><ul><li><a href="MapComponent.html">MapComponent</a></li></ul></div><div class="category"><h2>NotificationHandler</h2><h3>Classes</h3><ul><li><a href="NotificationHandler.html">NotificationHandler</a></li></ul></div><div class="category"><h2>Props</h2><h3><a href="global.html">Global</a></h3></div><div class="category"><h2>RoutingMenu</h2><h3>Global</h3><ul><li><a href="global.html#RoutingMenu">RoutingMenu</a></li><li><a href="global.html#SearchField">SearchField</a></li><li><a href="global.html#SearchResults">SearchResults</a></li></ul></div><div class="category"><h2>Utils</h2><h3>Global</h3><ul><li><a href="global.html#findMotIcon">findMotIcon</a></li></ul></div>
</nav>
</div>
</div>
<div class="column is-9-desktop">
<div class="content" id="main-content-wrapper">
<header class="page-title">
<p>Source</p>
<h1>Components/App/App.jsx</h1>
</header>
<section>
<article>
<pre class="prettyprint source linenums"><code>import React from 'react';
import PropTypes from 'prop-types';
import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles';
import MapComponent from '../MapComponent';
import Permalink from '../Permalink';
import NotificationHandler from '../NotificationHandler';
import { VALID_MOTS } from '../../constants';
const propTypes = {
routingUrl: PropTypes.string,
stationSearchUrl: PropTypes.string,
mots: PropTypes.arrayOf(PropTypes.string),
};
const defaultProps = {
mots: VALID_MOTS,
routingUrl: 'https://api.geops.io/routing/v1/',
stationSearchUrl: 'https://api.geops.io/stops/v1/',
};
const fontSize = '1rem';
const color = '#515151';
const theme = createMuiTheme({
typography: {
body: { fontSize },
button: { fontSize },
h1: { fontSize: '1.2rem', color },
h2: { fontSize, color },
h3: { fontSize, color },
h4: { fontSize, color },
h5: { fontSize, color },
h6: { fontSize, color },
},
});
/**
* Root component of the application that holds all other sub-components.
* @param {string[]} mots List of mots to be available (ex: ['bus', 'train'])
* @param {string} routingUrl The API routing url to be used for navigation.
* @param {string} stationSearchUrl The API station search URL to be used for searching for stations.
*/
function App(props) {
const { mots, routingUrl, stationSearchUrl } = props;
const apiKey = process.env.REACT_APP_API_KEY;
return (
<ThemeProvider theme={theme}>
<Permalink
mots={mots}
APIKey={apiKey}
stationSearchUrl={stationSearchUrl}
/>
<MapComponent
mots={mots}
routingUrl={routingUrl}
APIKey={apiKey}
stationSearchUrl={stationSearchUrl}
/>
<NotificationHandler />
</ThemeProvider>
);
}
App.propTypes = propTypes;
App.defaultProps = defaultProps;
export default App;
</code></pre>
</article>
</section>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="content has-text-centered">
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri May 21 2021 15:30:36 GMT+0200 (Central European Summer Time)</p>
<p class="sidebar-created-by">
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
</p>
</div>
</footer>
<script src="scripts/app.min.js"></script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>