forked from opentripplanner/otp-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trimet-mode-icon.js
62 lines (59 loc) · 1.55 KB
/
trimet-mode-icon.js
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
import React from "react";
import {
AerialTram,
Bicycle,
Bus,
Car,
Ferry,
Max,
Micromobility,
Streetcar,
TriMet,
Walk,
Wes
} from "./trimet";
/**
* Icons for all TriMet modes.
* Any hail and rental modes managed by one or multiple companies
* are optional (by default, the company logo will be displayed)
* but can be overriden here using the pattern
* <otp_mode>_<company_id> (e.g. 'car_hail_uber').
* Furthermore, any hail or rental modes managed by a single company
* are optional (by default, the company logo will be displayed)
* but can be overriden here using the pattern
* <otp_mode> (e.g. 'bicycle_rent').
*/
function TriMetModeIcon({ mode, ...props }) {
if (!mode) return null;
switch (mode.toLowerCase()) {
case "bicycle":
// case "bicycle_rent": // Commented means using the company logo instead.
return <Bicycle {...props} />;
case "bus":
return <Bus {...props} />;
case "car":
case "car_park":
return <Car {...props} />;
case "ferry":
return <Ferry {...props} />;
case "gondola":
return <AerialTram {...props} />;
case "micromobility":
case "micromobility_rent":
return <Micromobility {...props} />;
case "rail":
return <Wes {...props} />;
case "streetcar":
return <Streetcar {...props} />;
case "subway":
case "tram":
return <Max {...props} />;
case "transit":
return <TriMet {...props} />;
case "walk":
return <Walk {...props} />;
default:
return null;
}
}
export default TriMetModeIcon;