Skip to content

Commit

Permalink
👌 missing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arunachalam-monk committed Jul 25, 2024
1 parent 90b23ac commit ef1798d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PartSelectionOrientation, VehiclePart, VehicleType } from '@monkvision/types';
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { useMonkTheme } from '@monkvision/common';
import { Icon } from '../../icons';
import { VehicleDynamicWireframe, VehicleDynamicWireframeProps } from '../VehicleDynamicWireframe';
Expand All @@ -15,6 +15,8 @@ export interface VehiclePartSelectionProps {
vehicleType: VehicleType;
/**
* The initial orientation of the wireframe when the component is mounted.
*
* @default PartSelectionOrientation.FRONT_LEFT
*/
orientation?: PartSelectionOrientation;
/**
Expand Down Expand Up @@ -57,20 +59,18 @@ export function VehiclePartSelection({
? selectedParts.filter((p) => p !== part)
: [...selectedParts, part];
setSelectedParts(newSelectedParts);
onPartsSelected(selectedParts);
};
const getPartAttributes: VehicleDynamicWireframeProps['getPartAttributes'] = (
part: VehiclePart,
) => ({
style: {
// TODO: need to finalize the color for the selected parts.
fill: selectedParts.includes(part) ? '#2196f3' : undefined,
fill: selectedParts.includes(part) ? palette.primary.xlight : undefined,
stroke: palette.primary.light,
display: 'block',
},
});
useEffect(() => {
onPartsSelected(selectedParts);
}, [selectedParts]);

return (
<div style={styles['wrapper']}>
Expand Down

0 comments on commit ef1798d

Please sign in to comment.