feat: Add prop-types dependency, implement currency context, and enhance pricing display in components
- Added `prop-types` for better prop validation in components. - Introduced `CurrencyProvider` to manage currency context and preload exchange rates. - Updated pricing logic in various components to support new price structure and display currency. - Refactored BOMSummary, MotorStep, and PowerSupplyStep to utilize new pricing methods and improve user experience. - Enhanced export utilities to format prices correctly in markdown and Excel outputs. - Updated hardware and component data structures to include detailed pricing information.
This commit is contained in:
@@ -8,7 +8,10 @@
|
||||
"description": "Pivot plate for the stand",
|
||||
"image": "/images/options/pivot-plate.webp",
|
||||
"hardwareCost": 10,
|
||||
"price": 0,
|
||||
"price": {
|
||||
"amount": 0,
|
||||
"currency": "USD"
|
||||
},
|
||||
"printedParts": [
|
||||
{
|
||||
"id": "pivot-plate",
|
||||
@@ -99,7 +102,10 @@
|
||||
"description": "Reinforced 3030 hinges for PitClamp",
|
||||
"image": "/images/options/pitclamp-reinforced-3030-hinges.jpg",
|
||||
"hardwareCost": 15,
|
||||
"price": 0,
|
||||
"price": {
|
||||
"amount": 0,
|
||||
"currency": "USD"
|
||||
},
|
||||
"printedParts": [
|
||||
{
|
||||
"id": "pitclamp-reinforced-3030",
|
||||
@@ -131,7 +137,10 @@
|
||||
"filamentEstimate": 50,
|
||||
"image": "/images/options/standard-feet.jpg",
|
||||
"hardwareCost": 0,
|
||||
"price": 0,
|
||||
"price": {
|
||||
"amount": 0,
|
||||
"currency": "USD"
|
||||
},
|
||||
"colour": "secondary",
|
||||
"required": true
|
||||
},
|
||||
@@ -142,7 +151,10 @@
|
||||
"filamentEstimate": 60,
|
||||
"image": "/images/options/suction-feet.jpg",
|
||||
"hardwareCost": 5,
|
||||
"price": 0,
|
||||
"price": {
|
||||
"amount": 0,
|
||||
"currency": "USD"
|
||||
},
|
||||
"colour": "secondary",
|
||||
"required": true
|
||||
}
|
||||
@@ -204,7 +216,13 @@
|
||||
"filamentEstimate": 0,
|
||||
"image": "/images/options/standard-90-degree-support.jpg",
|
||||
"hardwareCost": 10,
|
||||
"price": "$10.00-$20.00",
|
||||
"price": {
|
||||
"amount": {
|
||||
"min": 10.00,
|
||||
"max": 20.00
|
||||
},
|
||||
"currency": "USD"
|
||||
},
|
||||
"colour": "primary",
|
||||
"required": true,
|
||||
"isHardwareOnly": true
|
||||
@@ -216,7 +234,13 @@
|
||||
"filamentEstimate": 100,
|
||||
"image": "/images/options/3d-printed-90-degree-support.jpg",
|
||||
"hardwareCost": 2,
|
||||
"price": "$2.00-$4.00",
|
||||
"price": {
|
||||
"amount": {
|
||||
"min": 2.00,
|
||||
"max": 4.00
|
||||
},
|
||||
"currency": "USD"
|
||||
},
|
||||
"colour": "secondary",
|
||||
"required": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user