Skip to content

Commit

Permalink
Merge pull request #1421 from edenia/feat/display-fio-address
Browse files Browse the repository at this point in the history
feat(webapp): display fio address instead of owner value
  • Loading branch information
xavier506 committed Jul 9, 2024
2 parents aa09f87 + 862cd5d commit bd11f70
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/GeoMap/CountryMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const ClusterMap = ({ data, map, mapCode }) => {
const producer = this?.point?.producer

return producer?.owner
? `<a href=/${eosConfig.producersRoute}/${producer?.owner}>${producer?.owner}</a>`
? `<a href=/${eosConfig.producersRoute}/${producer?.owner}>${producer?.fio_address || producer?.owner}</a>`
: ''
},
},
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/ProducersChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const CustomBarLabel = memo(
fontFamily="Roboto, Helvetica, Arial, sans-serif;"
fontWeight={isProducing ? 'bold' : 'normal'}
>
{payload.owner}
{payload.name ? payload.name?.replace('@fiotestnet','')?.substring(0, 12) + '...' : payload.owner}
</text>
)

Expand Down
7 changes: 6 additions & 1 deletion webapp/src/gql/producer.gql.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const PRODUCERS_QUERY = gql`
) {
id
owner
fio_address
url
total_votes
bp_json
Expand All @@ -35,7 +36,6 @@ export const PRODUCERS_QUERY = gql`
type
value
}
fio_address
}
}
`
Expand All @@ -51,6 +51,7 @@ export const PRODUCER_INFO_QUERY = gql`
) {
id
owner
fio_address
url
bp_json
total_votes_eos
Expand Down Expand Up @@ -91,6 +92,7 @@ export const SMALL_PRODUCERS_QUERY = gql`
) {
id
owner
fio_address
url
bp_json
total_votes_eos
Expand Down Expand Up @@ -146,6 +148,7 @@ const NODES_OPERATION = type => gql`
) {
id
owner
fio_address
rank
producer_key
bp_json
Expand Down Expand Up @@ -190,6 +193,7 @@ const ENDPOINTS_OPERATION = type => gql`
) {
id
owner
fio_address
updated_at
endpoints: endpoints_list(where: $endpointFilter, order_by: { value: asc }) {
type
Expand Down Expand Up @@ -308,6 +312,7 @@ export const ALL_NODES_QUERY = gql`
) {
id
owner
fio_address
bp_json
updated_at
}
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/hooks/customHooks/useEndpointsState.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const useEndpointsState = () => {
const inserted = []

const bpName =
producer.bp_json?.org?.candidate_name ||
producer?.fio_address ||
producer?.bp_json?.org?.candidate_name ||
producer?.bp_json?.org?.organization_name ||
producer?.owner

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/ProducerProfile/ProfileCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const ProfileCard = ({ producer }) => {
<div className={classes.profile}>
<ProducerName
name={producer?.media?.name || producer?.owner}
account={producer?.media?.name ? producer?.owner : ''}
account={producer?.media?.name ? (producer?.fio_address || producer?.owner) : ''}
text={t('BPonNetwork', {
networkName: eosConfig.networkLabel,
position: producer?.media?.account,
Expand Down

0 comments on commit bd11f70

Please sign in to comment.