Skip to content

Commit 131f736

Browse files
authored
70103 debug (#2025)
* debugging * debugging * formatting * error icon and more debug logs
1 parent 3e2a720 commit 131f736

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

src/components/shared/TransitIcon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import FerryIcon from '~/icons/icon-ferry';
55
import SubwayIcon from '~/icons/icon-subway';
66
import TrainIcon from '~/icons/icon-train';
77
import TramIcon from '~/icons/icon-tram';
8+
import ErrorIcon from '~/icons/icon-error';
89

910
interface ITransitIconProps {
1011
transitType: TransitType;
@@ -26,7 +27,7 @@ export default class TransitIcon extends React.Component<ITransitIconProps> {
2627
case TransitType.FERRY:
2728
return <FerryIcon height='24' isWithoutBox={isWithoutBox} />;
2829
default:
29-
throw `Missing icon for transitType: ${transitType}`;
30+
return <ErrorIcon height='24' isWithoutBox={isWithoutBox} />;
3031
}
3132
}
3233
}

src/components/sidebar/linkView/LinkView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class LinkView extends React.Component<ILinkViewProps, ILinkViewState> {
6464

6565
private _setState = (newState: object) => {
6666
if (this._isMounted) {
67+
console.log(newState)
6768
this.setState(newState);
6869
}
6970
};
@@ -138,6 +139,7 @@ class LinkView extends React.Component<ILinkViewProps, ILinkViewState> {
138139
link.endNode.id,
139140
link.transitType!
140141
);
142+
console.log(routePaths)
141143
this._setState({ routePathsUsingLink: routePaths });
142144
}
143145
this._setState({ isLoading: false });

src/icons/icon-error.tsx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* tslint:disable */
2+
3+
import React from 'react';
4+
5+
interface IErrorIconProps {
6+
height: string;
7+
isWithoutBox: boolean;
8+
}
9+
10+
const errorIcon: React.SFC<IErrorIconProps> = props => {
11+
const icon = (
12+
<svg
13+
className='line-icon'
14+
version='1.1'
15+
id='Layer_1'
16+
x='0px'
17+
y='0px'
18+
viewBox='0 0 512 512'
19+
enable-background='new 0 0 512 512'
20+
fill='#000000'
21+
height={props.height}
22+
>
23+
<g id='SVGRepo_bgCarrier' stroke-width='0'></g>
24+
<g id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round'></g>
25+
<g id='SVGRepo_iconCarrier'>
26+
<path d='M499.5,385.4L308.9,57.2c-31.8-52.9-74.1-52.9-105.9,0L12.5,385.4c-31.8,52.9,0,95.3,63.5,95.3h360 C499.5,480.7,531.3,438.3,499.5,385.4z M298.4,438.3h-84.7v-84.7h84.7V438.3z M298.4,311.3h-84.7V120.7h84.7V311.3z'></path>
27+
</g>
28+
</svg>
29+
);
30+
31+
const iconWithoutBox = (
32+
<svg
33+
className='line-icon'
34+
version='1.1'
35+
id='Layer_1'
36+
x='0px'
37+
y='0px'
38+
viewBox='0 0 1024 1024'
39+
enableBackground='new 0 0 16 16'
40+
height={props.height}
41+
>
42+
<g>
43+
<path
44+
fill='#FFFFFF'
45+
d='M954.633 86.277v761.906c0 26.050-16.282 40.702-34.189 45.586l-48.841 8.139v102.563c0 11.397-9.765 19.536-22.791 19.536h-78.142c-9.768 0-21.162-8.139-21.162-19.536v-91.169c-61.868 8.139-151.407 11.397-239.321 11.397-86.285 0-172.566-3.255-236.059-11.397v91.169c0 11.397-9.768 19.536-19.536 19.536h-78.146c-13.023 0-22.791-8.139-22.791-19.536v-102.563l-48.841-8.139c-16.282-4.884-34.189-21.166-34.189-45.586v-761.906c0-34.189 22.791-56.98 61.868-61.864 128.609-17.911 245.827-24.421 380.953-24.421 130.242 0 249.086 8.139 379.327 24.421 39.069 4.884 61.86 27.675 61.86 61.864zM884.63 138.373c0-21.166-8.139-35.818-34.189-35.818l-672.366-3.255c-26.050 0-35.818 14.652-35.818 35.814v475.38c0 21.162 9.768 30.93 35.818 35.814 94.424 21.166 213.268 35.814 338.625 35.814 118.844 0 240.947-16.282 333.741-32.559 26.050-3.255 34.189-14.652 34.189-35.814v-475.376zM254.588 779.806c0-21.162-19.533-40.698-42.324-40.698-22.795 0-42.328 19.536-43.957 40.698 0 22.795 19.536 42.328 43.957 43.957 22.791 0 42.324-19.536 42.324-43.957zM848.812 779.806c0-21.162-19.533-40.698-42.328-40.698-21.162 0-40.695 19.536-42.324 40.698 0 22.795 19.533 42.328 42.324 43.957 22.795 0 42.328-19.536 42.328-43.957z'
46+
/>
47+
</g>
48+
</svg>
49+
);
50+
51+
return props.isWithoutBox ? iconWithoutBox : icon;
52+
};
53+
54+
export default errorIcon;

0 commit comments

Comments
 (0)