Skip to content

Commit

Permalink
Changes in transaction chart for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham-y committed Nov 5, 2021
1 parent 6224ca0 commit 1225995
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/transaction-chart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getDataset(transactionData) {
};
}

const TransactionChart = ({ transactionChartData }) => {
const TransactionChart = ({ transactionChartData, theme }) => {
const [chartData, setChartData] = useState({});
useEffect(() => {
const chart = () => {
Expand All @@ -62,6 +62,7 @@ const TransactionChart = ({ transactionChartData }) => {
{
ticks: {
autoSkip: true,
fontColor: theme === 'light' ? '#666' : '#fff',
},
gridLines: {
display: true,
Expand All @@ -70,6 +71,9 @@ const TransactionChart = ({ transactionChartData }) => {
],
xAxes: [
{
ticks: {
fontColor: theme === 'light' ? '#666' : '#fff',
},
gridLines: {
display: true,
},
Expand Down
1 change: 1 addition & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default function Home() {
<div className={`${styles.card} ${styles.content}`}>
<TransactionChart
transactionChartData={transactionChartData}
theme={theme}
/>
</div>
</div>
Expand Down

0 comments on commit 1225995

Please sign in to comment.