Skip to content

Commit

Permalink
Fix table row key names
Browse files Browse the repository at this point in the history
Clashing was causing some rendering bugs
  • Loading branch information
iaincollins committed Oct 8, 2024
1 parent 00b7ccb commit 29e50ad
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion components/commodity-export-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default ({ commodities }) => {
}
]}
data={commodities}
rowKey={(r) => `commodity_export_orders_${r.commodityId}`}
expandable={{
expandRowByClick: true,
expandedRowRender: (r) => <ExpandedRow r={r} />
Expand Down Expand Up @@ -206,7 +207,7 @@ function ExpandedRow ({ r }) {
}
]}
data={exports}
rowKey='commodityId'
rowKey={(r) => `commodity_export_orders_expanded_${r.commodityId}`}
/>
<Collapsible
trigger={<CollapsibleTrigger>Stock of <strong>{r.name}</strong> near <strong>{r.systemName}</strong></CollapsibleTrigger>}
Expand Down
3 changes: 2 additions & 1 deletion components/commodity-import-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default ({ commodities }) => {
}
]}
data={commodities}
rowKey={(r) => `commodity_import_orders_${r.commodityId}`}
expandable={{
expandRowByClick: true,
expandedRowRender: (r) => <ExpandedRow r={r} />
Expand Down Expand Up @@ -206,7 +207,7 @@ function ExpandedRow ({ r }) {
}
]}
data={imports}
rowKey='commodityId'
rowKey={(r) => `commodity_import_orders_expanded_${r.commodityId}`}
/>
<Collapsible
trigger={<CollapsibleTrigger>Stock of <strong>{r.name}</strong> near <strong>{r.systemName}</strong></CollapsibleTrigger>}
Expand Down
2 changes: 0 additions & 2 deletions components/commodity-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default ({ commodityName, reportName = 'core-systems-1000' }) => {
c.symbol = c.commodityName.toLowerCase()
c.category = (commoditiesInfo.find(el => el.symbol.toLowerCase() === c.symbol))?.category ?? ''
c.name = (commoditiesInfo.find(el => el.symbol.toLowerCase() === c.symbol))?.name ?? c.commodityName
delete c.commodityId
delete c.commodityName
})
setExports((commodityReport?.bestExporters ?? []))
Expand All @@ -39,7 +38,6 @@ export default ({ commodityName, reportName = 'core-systems-1000' }) => {
c.symbol = c.commodityName.toLowerCase()
c.category = (commoditiesInfo.find(el => el.symbol.toLowerCase() === c.symbol))?.category ?? ''
c.name = (commoditiesInfo.find(el => el.symbol.toLowerCase() === c.symbol))?.name ?? c.commodityName
delete c.commodityId
delete c.commodityName
})
setImports((commodityReport?.bestImporters ?? []))
Expand Down
2 changes: 1 addition & 1 deletion components/local-commodity-exporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default ({ commodityOrders }) => {
}
]}
data={commodityOrders}
rowKey='commodityId'
rowKey={(r) => `local_commodity_exporters_${r.commodityId}`}
/>}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion components/local-commodity-importers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default ({ commodityOrders }) => {
}
]}
data={commodityOrders}
rowKey='commodityId'
rowKey={(r) => `local_commodity_importers_${r.commodityId}`}
/>}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion components/nearby-commodity-exporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default ({ commodity }) => {
}
]}
data={nearbyExporters}
rowKey='commodityId'
rowKey={(r) => `nearby_commodity_exporters_${r.commodityId}`}
/>}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion components/nearby-commodity-importers.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default ({ commodity }) => {
}
]}
data={nearbyImporters}
rowKey='commodityId'
rowKey={(r) => `nearby_commodity_importers_${r.commodityId}`}
/>}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ardent-www",
"version": "0.63.2",
"version": "0.64.0",
"description": "Ardent Industry",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 0 additions & 2 deletions pages/commodity/[commodity-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default () => {
c.symbol = c.commodityName.toLowerCase()
c.category = listOfCommodities[c.symbol]?.category ?? ''
c.name = listOfCommodities[c.symbol]?.name ?? c.commodityName
delete c.commodityId
delete c.commodityName
})
setImports(imports)
Expand All @@ -75,7 +74,6 @@ export default () => {
c.symbol = c.commodityName.toLowerCase()
c.category = listOfCommodities[c.symbol]?.category ?? ''
c.name = listOfCommodities[c.symbol]?.name ?? c.commodityName
delete c.commodityId
delete c.commodityName
})
setExports(exports)
Expand Down
2 changes: 2 additions & 0 deletions pages/system/[system-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export default () => {
}
]}
data={importOrders}
rowKey={(r) => `system_imports_${r.systemAddress}_${r.symbol}`}
expandable={{
expandRowByClick: true,
expandedRowRender: r =>
Expand Down Expand Up @@ -573,6 +574,7 @@ export default () => {
}
]}
data={exportOrders}
rowKey={(r) => `system_exports_${r.systemAddress}_${r.symbol}`}
expandable={{
expandRowByClick: true,
expandedRowRender: r =>
Expand Down

0 comments on commit 29e50ad

Please sign in to comment.