Skip to content

Commit

Permalink
Merge pull request #426 from edenia/fix/ui-ux-improvements-on-treasur…
Browse files Browse the repository at this point in the history
…y-chart-425

fix(webapp): ui ux improvements on treasury chart
  • Loading branch information
xavier506 authored Jan 24, 2023
2 parents 8c9c204 + dc5f786 commit 6213ee2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/BarChartReport/custom-barChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const CustomBarChart = ({ typeData, selectedUSD, data, barRef }) => {
return (
<ResponsiveContainer width="100%" height={300} marginTop="16px">
<ComposedChart
margin={{ left: -16, top: 8 }}
margin={{ top: 8, right: 16 }}
height={300}
data={data}
ref={barRef}
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/LineChartReport/custom-lineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const CustomLineChart = ({ coinType, data, lineRef }) => {
marginTop="16px"
>
<LineChart
margin={{ left: -16, top: 8, bottom: 8 }}
margin={{ top: 8, bottom: 24, right: 16 }}
height={300}
data={data}
ref={lineRef}
Expand Down Expand Up @@ -121,6 +121,7 @@ const CustomLineChart = ({ coinType, data, lineRef }) => {
width={width * 0.7}
height={30}
x={width / 6.2}
y={260}
traveller={renderTraveller}
travellerWidth={1}
onChange={handleBrushChange}
Expand All @@ -139,7 +140,6 @@ const CustomLineChart = ({ coinType, data, lineRef }) => {
stroke="#87cefa"
strokeWidth={2}
dot={false}
strokeDasharray={5}
/>
</LineChart>
</Brush>
Expand Down
10 changes: 5 additions & 5 deletions webapp/src/components/LineChartReport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const LineChartReport = ({
}) => {
const classes = useStyles()
const [getBarPng, { ref: lineRef }] = useCurrentPng()
const { t } = useTranslation()
const { t } = useTranslation('generalForm')
const [selectedUSD, setSelected] = useState(false)
const [coinType, setCoinType] = useState('EOS')
const [viewSelected, setViewSelect] = useState('')
Expand Down Expand Up @@ -107,7 +107,7 @@ const LineChartReport = ({
<FormGroup>
<FormControlLabel
control={<Switch checked={selectedUSD} onChange={handleChange} />}
label={t('switchInput', { ns: 'generalForm' })}
label={t('switchInput')}
labelPlacement="start"
/>
</FormGroup>
Expand All @@ -121,7 +121,7 @@ const LineChartReport = ({
onClick={handleSelectElection}
value="all"
>
all
{t('AllSelectYear')}
</Button>

<Button
Expand All @@ -130,12 +130,12 @@ const LineChartReport = ({
onClick={handleSelectElection}
value="last"
>
Estimated treasury
{t('estimated', { ns: 'incomeRoute' }).toUpperCase()}
</Button>
</div>
<Select
onChangeFunction={setElectionRoundSelect}
labelSelect={t('textElectionSelect', { ns: 'generalForm' })}
labelSelect={t('textElectionSelect')}
values={historicElections.map(data => `${data.election}`)}
actualValue={electionRoundSelect}
width={110}
Expand Down
15 changes: 14 additions & 1 deletion webapp/src/components/LineChartReport/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export default theme => ({
overflowY: 'hidden',
[theme.breakpoints.down('sm')]: {
overflowX: 'hidden'
},
'& .recharts-brush-texts': {
fontSize: 10,
fontWeight: 600
}
},
title: {
Expand All @@ -15,6 +19,9 @@ export default theme => ({
fontWeight: 500,
lineHeight: 1.56,
letterSpacing: '-0.4px'
},
[theme.breakpoints.down('sm')]: {
width: '100%'
}
},
filter: {
Expand All @@ -23,12 +30,18 @@ export default theme => ({
fontWeight: 300,
lineHeight: 1.33,
letterSpacing: '-0.26px'
},
[theme.breakpoints.down('sm')]: {
width: '100%'
}
},
titleContainer: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
alignItems: 'center',
[theme.breakpoints.down('sm')]: {
flexDirection: 'column'
}
},
chartLegent: {
display: 'flex',
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"trasury": "Projected Treasury Balance",
"delegate": "Delegate",
"balance": "Treasury Balance",
"estimated": "Estimated Treasury Balance"
"estimated": "Estimated Balance"
},
"expenseRoute": {
"titleBarChart": "Expense per Election",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"trasury": "Balance de tesorería proyectado",
"delegate": "Delegate",
"balance": "Saldo de Tesorería",
"estimated": "Balance de Tesorería Estimado"
"estimated": "Balance Estimado"
},
"expenseRoute": {
"titleBarChart": "Gasto por Elección",
Expand Down

0 comments on commit 6213ee2

Please sign in to comment.