Skip to content

Commit

Permalink
Improve data loading behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Sep 12, 2024
1 parent b50d922 commit a62727a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function Loader ({ visible, text}) {
<div className='loader__arrow loader__arrow--down loader__arrow--outer-9' />
</div>
</div>
{text && <div className='loader__text' style={{ opacity: visible ? 1 : 0 }}>{text}</div>}
{text && <div className='loader__text' style={{ opacity: visible ? 1 : 0 }}>{text}</div>}
</>
)
}
Expand Down
5 changes: 1 addition & 4 deletions css/components/loading-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@

.loading-bar--tab {
position: relative;
margin-left: .2rem;
height: 1.8rem;
top: -.3rem;
width: calc(100% - .4rem);
margin: 0;
}

@keyframes loadingBarAnimation {
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.45.6",
"version": "0.45.7",
"description": "Ardent Industry",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion pages/commodities.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default () => {
}, [])

return (
<Layout loading={commodities === undefined} loadingText='Loading commodities'>
<Layout loading={commodities === undefined} loadingText='Loading commodities'>
<Head>
<link rel='canonical' href='https://ardent-industry.com/commodities' />
</Head>
Expand Down
5 changes: 2 additions & 3 deletions pages/commodity/[commodity-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export default () => {
c.rare = ((getAllCommodities().find(el => el.symbol.toLowerCase() === c.symbol))?.market_id)
delete c.commodityId
delete c.commodityName
})

})
setImports(imports)

const exports = await getExports(commodityName)
Expand Down Expand Up @@ -109,7 +108,7 @@ export default () => {
}, [])

return (
<Layout loading={!commodity} loadingText={'Loading trade data'}>
<Layout loading={!commodity} loadingText={'Loading trade data'}>
<Head>
<link rel='canonical' href={`https://ardent-industry.com/system/${commodity?.symbol}/${tabs[tabIndex]}`} />
</Head>
Expand Down
2 changes: 1 addition & 1 deletion pages/system/[system-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default () => {
}, [router.query['system-name']])

return (
<Layout loading={system === undefined} loadingText='Loading system data'>
<Layout loading={system === undefined} loadingText='Loading system data'>
<Head>
<link rel='canonical' href={`https://ardent-industry.com/system/${system?.systemName}/${tabs[tabIndex]}`} />
</Head>
Expand Down

0 comments on commit a62727a

Please sign in to comment.