Skip to content

Commit

Permalink
Improve commodity import/export listing
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Sep 8, 2024
1 parent 8fb7c3d commit a61c762
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/commodity-export-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function ExpandedRow ({ r }) {
className='data-table--mini data-table--striped scrollable'
columns={[
{
title: 'Location',
title: 'Exporters in system',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
Expand Down
2 changes: 1 addition & 1 deletion components/commodity-import-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function ExpandedRow ({ r }) {
className='data-table--mini data-table--striped scrollable'
columns={[
{
title: 'Location',
title: 'Importers in system',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
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 @@ -12,7 +12,7 @@ export default ({ commodityOrders }) => {
className='data-table--mini data-table--striped scrollable'
columns={[
{
title: 'Location',
title: 'Exporters in system',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
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 @@ -12,7 +12,7 @@ export default ({ commodityOrders }) => {
className='data-table--mini data-table--striped scrollable'
columns={[
{
title: 'Location',
title: 'Importers in system',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
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 @@ -64,7 +64,7 @@ export default ({ commodity }) => {
className='data-table--mini data-table--striped data-table--border-left scrollable'
columns={[
{
title: 'Location',
title: 'Exporters nearby',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
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 @@ -64,7 +64,7 @@ export default ({ commodity }) => {
className='data-table--mini data-table--striped data-table--border-left scrollable'
columns={[
{
title: 'Location',
title: 'Importers nearby',
dataIndex: 'stationName',
key: 'stationName',
align: 'left',
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.44.1",
"version": "0.44.2",
"description": "Ardent Industry",
"main": "index.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions pages/commodity/[commodity-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export default () => {
const commodityName = router.query?.['commodity-name'] ?? window.location?.pathname?.replace(/\/(importers|exporters)$/, '').replace(/.*\//, '')
if (!commodityName) return
setUpdating(true)

setImports(undefined)
setExports(undefined)

const imports = await getImports(commodityName)
imports.forEach(c => {
c.key = c.commodityId
Expand All @@ -50,6 +52,7 @@ export default () => {
delete c.commodityId
delete c.commodityName
})

setImports(imports)

const exports = await getExports(commodityName)
Expand All @@ -73,8 +76,6 @@ export default () => {
useEffect(() => {
(async () => {
setCommodity(undefined)
setExports(undefined)
setImports(undefined)

const commodityName = router.query?.['commodity-name']
if (!commodityName) return
Expand Down

0 comments on commit a61c762

Please sign in to comment.