Skip to content

Commit

Permalink
fix(webapp): increase the space between the name of the producers
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed May 9, 2023
1 parent f9fd549 commit a9ec56d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
21 changes: 19 additions & 2 deletions webapp/src/components/ProducersChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,39 @@ const CustomBarLabel = memo(
outerRadius - gap,
midAngle,
)
const cartesianText = polarToCartesian(cx, cy, outerRadius + 8, midAngle)
const spacing = sm ? 16 : 12
const cartesianText = polarToCartesian(
cx,
cy,
outerRadius + spacing,
midAngle,
)
const link = generalConfig.eosRateLink
? `${generalConfig.eosRateLink}/block-producers/${payload.owner}`
: payload.url

const getNameTextAnchor = (x, cx) => {
if (x + 30 >= cx && x < cx) {
return 'middle'
} else if (x > cx) {
return 'start'
} else {
return 'end'
}
}

const ProducerName = () => {
const Content = () => (
<text
transform={`translate(${cartesianText.x}, ${cartesianText.y})`}
textAnchor={x > cx ? 'start' : 'end'}
textAnchor={getNameTextAnchor(x, cx)}
dominantBaseline="central"
fill={
fill === theme.palette.primary.dark
? theme.palette.primary.dark
: theme.palette.primary.light
}
fontSize={sm ? 14 : 12}
fontFamily="Roboto, Helvetica, Arial, sans-serif;"
fontWeight={fill === theme.palette.primary.dark ? 'bold' : 'normal'}
>
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/components/ProducersChart/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export default (theme) => ({
padding: theme.spacing(2),
borderRadius: theme.spacing(1),
boxShadow:
'0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)'
'0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)',
},
description: {
fontWeight: 'normal'
}
fontWeight: 'normal',
},
})
6 changes: 6 additions & 0 deletions webapp/src/routes/Home/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export default (theme) => ({
[theme.breakpoints.down('md')]: {
marginBottom: '10px',
},
'& .MuiPaper-root': {
height: '100%',
},
},
cardGrow: {
flexGrow: '1',
Expand All @@ -110,6 +113,9 @@ export default (theme) => ({
flexBasis: 'calc(100%/3)',
marginBottom: '10px',
},
'& .MuiPaper-root': {
height: '100%',
},
},
uniquelocations: {
flexGrow: '1 !important',
Expand Down

0 comments on commit a9ec56d

Please sign in to comment.