Skip to content

Commit

Permalink
Merge pull request #2 from eco-stake/update-chain-registry-attributes
Browse files Browse the repository at this point in the history
Update chain registry attributes
  • Loading branch information
tombeynon authored Sep 28, 2022
2 parents 9c49860 + 59a2611 commit e44fedf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function App() {
}

function chainsByPath() {
if (!chains) return {}
if (!chains?.chains) return {}

return chains.chains.reduce((a, v) => ({ ...a, [v.path]: v }), {})
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const AppHeader = (props) => {
command() { navigate('/') }
}
]
if(!chains) return data
if(!chains?.chains) return data

return chains.chains.reduce((sum, chain) => {
data.push({
Expand Down
23 changes: 16 additions & 7 deletions src/components/ConfigurationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,30 @@ function ConfigurationPanel(props) {
value: chain.codebase.compatible_versions.join(', ')
})

if(chain.daemon_name) data.push({
const daemon_name = chain.codebase?.daemon_name || chain.daemon_name
if(daemon_name) data.push({
key: 'Daemon Name',
value: chain.daemon_name
value: daemon_name
})

if(chain.node_home) data.push({
const node_home = chain.codebase?.node_home || chain.node_home
if(node_home) data.push({
key: 'Node Home',
value: chain.node_home
value: node_home
})

if(chain.genesis?.genesis_url){
const url = chain.genesis?.genesis_url
const genesis_url = chain.codebase?.genesis?.genesis_url || chain.genesis?.genesis_url
if(genesis_url){
data.push({
key: 'Genesis URL',
value: <a href={url} target="_blank">{url}</a>
value: <a href={genesis_url} target="_blank">{genesis_url}</a>
})
}

if (chain.website) {
data.push({
key: 'Website',
value: <a href={chain.website} target="_blank">{chain.website}</a>
})
}

Expand Down
6 changes: 6 additions & 0 deletions src/components/OverviewPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ function OverviewPanel(props) {
value: status.available ? <span className="text-success p-0">Available</span> : <span className="text-danger p-0">Unavailable</span>
},
])
if(chain.website){
data.push({
key: 'Website',
value: <a href={chain.website} target="_blank">{chain.website}</a>
})
}
if(chain.explorers){
data.push({
key: 'Explorers',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ValidatorBadges.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function ValidatorBadges(props) {
}

function commissionPercent() {
return validator.commission && validator.commission.commission_rates.rate
return validator.commission?.commission_rates?.rate
}

function renderBadge(icon, tooltip, check, link) {
Expand Down

0 comments on commit e44fedf

Please sign in to comment.