Skip to content

Commit

Permalink
feat: Proposal voting timeline (#1255)
Browse files Browse the repository at this point in the history
* feat: voting timeline

* fix: build error

* Requested changes

* minor style fixes

* custom tooltip started

* zoom in chart removed

* useProfiles hook

* tooltip styled

* type removed

* fix: tooltip x position

* final touchups

* requested changes
  • Loading branch information
ncomerci authored Sep 20, 2023
1 parent 809762c commit 89495ce
Show file tree
Hide file tree
Showing 13 changed files with 584 additions and 28 deletions.
96 changes: 75 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@
"@tanstack/react-query": "^4.29.7",
"autoprefixer": "^10.4.4",
"chalk": "^4.1.2",
"chart.js": "^3.8.2",
"chart.js": "^4.4.0",
"chartjs-adapter-dayjs-4": "^1.0.4",
"chartjs-plugin-annotation": "^3.0.1",
"classnames": "^2.3.2",
"clipboard-copy": "^4.0.1",
"core-js": "^3.21.1",
"cssnano": "^6.0.1",
"dayjs": "^1.11.9",
"dayjs-precise-range": "^1.0.1",
"dcl-catalyst-client": "^21.5.0",
"decentraland-gatsby": "^5.86.3",
Expand Down Expand Up @@ -97,7 +100,7 @@
"pg-tsquery": "^8.3.0",
"postcss": "^8.4.12",
"react": "^17.0.2",
"react-chartjs-2": "^4.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "^17.0.2",
"react-flickity-component": "^3.6.2",
"react-hook-form": "^7.43.5",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'
import { Chart } from 'react-chartjs-2'
import { useIntl } from 'react-intl'

import { ChartArea, ChartData, Chart as ChartJS } from 'chart.js'
import type { ChartArea, ChartData, Chart as ChartJS } from 'chart.js'
import 'chart.js/auto'

import useAbbreviatedFormatter from '../../hooks/useAbbreviatedFormatter'
Expand Down
49 changes: 49 additions & 0 deletions src/components/Charts/ProposalVPChart.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#ProposalVPChartTooltip {
--padding-size: 9px;
display: flex;
flex-direction: row;
align-items: center;
background: rgba(22, 20, 26, 0.9);
border-radius: 5px;
color: var(--white-900);
opacity: 1;
pointer-events: none;
position: absolute;
transform: translate(-50%, 0);
transition: all 0.1s ease;
width: max-content;
padding: var(--padding-size);
z-index: 100;
}

#ProposalVPChartTooltip .avatar {
--size: 40px;
min-width: var(--size) !important;
max-width: var(--size) !important;
min-height: var(--size) !important;
max-height: var(--size) !important;
border-radius: 100%;
background-color: var(--black-600);
vertical-align: middle;
margin: 0;
}

#ProposalVPChartTooltip .container {
margin: 0;
margin-left: var(--padding-size);
}

#ProposalVPChartTooltip .title {
font-size: 13px;
font-style: normal;
line-height: 18px;
max-width: 160px;
}

#ProposalVPChartTooltip .details {
font-size: 10px;
font-style: normal;
font-weight: var(--weight-normal);
line-height: 18px;
opacity: 0.6;
}
Loading

0 comments on commit 89495ce

Please sign in to comment.