Skip to content

Commit

Permalink
add mocks pic for vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexeria committed Jan 26, 2023
1 parent 1658d47 commit 4a0b950
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
8 changes: 8 additions & 0 deletions components/Map/Stations/Sidebar/MapStationsSidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
.MapStationsSidebarWrapper {
border-radius: 16px;
background-color: var(--background-primary);

overflow-y: scroll;
-ms-overflow-style: none;
scrollbar-width: none;
}

.MapStationsSidebarWrapper::-webkit-scrollbar {
display: none;
}

.MapStationsSidebarRow {
Expand Down
21 changes: 9 additions & 12 deletions components/Map/Vehicles/Item/MapVehiclesItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export class MapVehiclesItemComponent extends Component<MapVehiclesItemProps> {
}

getIcon() {
const {
boardId, routeNumber, course, type, disability, warning,
} = this.props;
const { boardId, routeNumber, course, type, disability, warning } = this.props;
const isCourseEast = course > EAST_COURSE_RANGE.left || course < EAST_COURSE_RANGE.right;

return new L.DivIcon({
Expand Down Expand Up @@ -103,25 +101,24 @@ export class MapVehiclesItemComponent extends Component<MapVehiclesItemProps> {

onClickEventHandler = () => {
const { routeNumber, onClick } = this.props;
console.log('HERE');
if (!this.isActive) {
this.isActive = true;
sidebarService.open(<MapVehiclesSidebar {...this.props} />, () => {
this.isActive = false;
});
}

if (!routeNumber) {
return;
}

onClick(routeNumber);

if (!this.isActive) {
this.isActive = true;
sidebarService.open(<MapVehiclesSidebar {...this.props} />, () => {
this.isActive = false;
});
}
};

private updateTranslate = () => {
const {
boardId, routeNumber, velocity, course,
} = this.props;
const { boardId, routeNumber, velocity, course } = this.props;

const marker = document.querySelector(
`#vehicle-${boardId}-${routeNumber}`,
Expand Down
4 changes: 2 additions & 2 deletions components/Map/Vehicles/Marker/MapVehicleMarker.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

.MapVehicleMarkerIcon {
position: absolute;
top: 6px;
left: 6px;
top: 8px;
left: 7px;
}

.MapVehicleMarkerInfo {
Expand Down
4 changes: 2 additions & 2 deletions components/Map/Vehicles/Sidebar/MapVehiclesSidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@
position: absolute;
z-index: 1;
top: 50%;
left: -5px;
left: -6px;
height: 23px;
transform: translateY(-55%) scale(0.7);
transform: translateY(-70%) scale(0.6);
}

.MapVehiclesSidebarBullet {
Expand Down
11 changes: 5 additions & 6 deletions components/Map/Vehicles/Sidebar/MapVehiclesSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MapVehicleMarker } from '../Marker/MapVehicleMarker';

import modelPic from './mocks/model.png';
import operatorPic from './mocks/operator.png';
import vehiclePic from './mocks/vehicle.png';
import { stations } from './mocks/stations';
import { featuresTitle, fixture } from './mocks/main';

Expand Down Expand Up @@ -120,7 +119,7 @@ export function MapVehiclesSidebar({
<Close className={cn(styles.MapVehiclesSidebarCloseIcon)} />
</button>
<div className={cn(styles.MapVehiclesSidebarVehicleImage)}>
<Image src={vehiclePic} width="448" height="225" />
<Image src={`/${type}.png`} width="448" height="225" />
</div>
<div className={cn(styles.MapVehiclesSidebarVehicleInfoWrapper)}>
<div className={cn(styles.MapVehiclesSidebarVehicleInfo)}>
Expand Down Expand Up @@ -265,8 +264,8 @@ export function MapVehiclesSidebar({
})}
/>
</div>
{afterOpened
&& afterStart.map((station) => (
{afterOpened &&
afterStart.map((station) => (
<li className={cn(styles.MapVehiclesSidebarStation)}>
<div
className={cn(styles.MapVehiclesSidebarBullet)}
Expand Down Expand Up @@ -349,8 +348,8 @@ export function MapVehiclesSidebar({
})}
/>
</div>
{beforeOpened
&& beforeEnd.map((station) => (
{beforeOpened &&
beforeEnd.map((station) => (
<li className={cn(styles.MapVehiclesSidebarStation)}>
<div
className={cn(styles.MapVehiclesSidebarBullet)}
Expand Down
File renamed without changes
Binary file added public/tram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/troll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a0b950

Please sign in to comment.