feat: adjust Trips page
This commit is contained in:
parent
cd71cda6e6
commit
304838d839
|
@ -19,5 +19,5 @@ export default function OverviewNextTableEntry ({ agencyName, routeCount, tripCo
|
|||
OverviewNextTableEntry.propTypes = {
|
||||
agencyName: PropTypes.string,
|
||||
routeCount: PropTypes.string,
|
||||
tripCount: PropTypes.strin
|
||||
tripCount: PropTypes.string
|
||||
};
|
||||
|
|
|
@ -9,7 +9,8 @@ import Head from './overview-next-table-head';
|
|||
/*destructure props object*/
|
||||
export default function OverviewNextTable ({ overview }) {
|
||||
const handleOverview = () => {
|
||||
if (overview) {
|
||||
|
||||
if ( overview !== null && overview !== undefined && overview.length !== 0 ) {
|
||||
//iterate over array
|
||||
return overview.map((item, index) => {
|
||||
return (
|
||||
|
@ -17,8 +18,7 @@ export default function OverviewNextTable ({ overview }) {
|
|||
agencyName={item.agency_name}
|
||||
routeCount={item.route_count}
|
||||
tripCount={item.trip_count}
|
||||
day={item.day}
|
||||
key={item.agency_id}
|
||||
key={item.agency_id}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ const Contact = () => {
|
|||
<p>
|
||||
Please feel <b>free</b> to <b>use</b>, <b>study</b>, <b>share</b> or <b>improve</b> the{' '}
|
||||
<a
|
||||
href="https://git.wtf-eg.de/dancesWithCycles/gtfs-display"
|
||||
href="https://git.wtf-eg.de/dancingCycle/gtfs-display"
|
||||
target="_blank"
|
||||
>
|
||||
sources
|
||||
|
|
|
@ -15,9 +15,6 @@ export default function OverviewNext() {
|
|||
const res = await axios.get(`${config.API}number-of-trips`);
|
||||
|
||||
if ( res !== null && res !== undefined ) {
|
||||
//TODO remove debugging
|
||||
console.log('OverviewNext res: length: ' + res.data.length );
|
||||
|
||||
setTrips(res.data);
|
||||
}
|
||||
|
||||
|
@ -27,13 +24,11 @@ export default function OverviewNext() {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
getTrips();
|
||||
|
||||
}, []);
|
||||
|
||||
|
||||
if ( trips !== null && trips !== undefined && trips.length === 0 ) {
|
||||
if ( trips === null || trips === undefined || trips.length === 0 ) {
|
||||
return <p>loading...</p>;
|
||||
} else {
|
||||
return <OverviewTable overview={trips} />;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,7 @@
|
|||
"private": true,
|
||||
"name": "gtfs-display",
|
||||
"description": "display data from GTFS files",
|
||||
"version": "0.6.0",
|
||||
"version": "0.7.0",
|
||||
"main": "index.js",
|
||||
"keywords": [
|
||||
"public",
|
||||
|
@ -12,9 +12,6 @@
|
|||
"display"
|
||||
],
|
||||
"author": "Software Ingenieur Begerad <dialog@SwIngBe.de>",
|
||||
"homepage": "https://github.com/Software-Ingenieur-Begerad/gtfs-display/tree/main",
|
||||
"repository": "https://github.com/Software-Ingenieur-Begerad/gtfs-display",
|
||||
"bugs": "https://github.com/Software-Ingenieur-Begerad/gtfs-display/issues",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server --mode development",
|
||||
|
@ -24,7 +21,6 @@
|
|||
"dependencies": {
|
||||
"axios": "0.27.2",
|
||||
"bootstrap": "5.2.2",
|
||||
"chart.js": "3.9.1",
|
||||
"react": "18.2.0",
|
||||
"react-bootstrap": "2.6.0",
|
||||
"react-chartjs-2": "4.3.1",
|
||||
|
|
Loading…
Reference in New Issue