Skip to content

Commit

Permalink
updated UI for the tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
ngvtuan committed Jan 4, 2023
1 parent d9b990c commit 6caa287
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/components/Summary/Summary.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import { Skeleton } from '@material-ui/lab';
import { makeStyles } from '@material-ui/styles';
import { withStyles, makeStyles } from '@material-ui/styles';
import { useDispatch } from 'react-redux';
import { useLocation } from 'react-router-dom';
import Tooltip from '@material-ui/core/Tooltip';
Expand Down Expand Up @@ -54,6 +54,15 @@ type TChartDataProps = {
offset: number;
};

const CustomTooltip = withStyles(theme => ({
tooltip: {
backgroundColor: theme.palette.common.white,
color: '#4A5568',
boxShadow: theme.shadows[2],
fontSize: 12,
},
}))(Tooltip);

const Summary: React.FC = () => {
const [summaryList, setSummaryList] = React.useState(initialSummaryList);
const [currentStatsData, setCurrentStatsData] = React.useState<ISummaryStats | null>(null);
Expand Down Expand Up @@ -241,7 +250,7 @@ const Summary: React.FC = () => {
const theNumberOfTotalSupernodes = getCurrencyName() === 'PSL' ? 5000000 : 1000000;
const totalLockedInSupernodes = totalSupernode * theNumberOfTotalSupernodes;
return (
<Tooltip
<CustomTooltip
title={
<Box>
{sumKey === 'coinSupply' ? (
Expand Down Expand Up @@ -274,7 +283,7 @@ const Summary: React.FC = () => {
}
>
<Box>{value}</Box>
</Tooltip>
</CustomTooltip>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/theme/shadows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function createShadow() {
const shadows: Shadows = [
'none',
createShadow(),
createShadow(),
'rgb(0 0 0 / 20%) 1px 2px 10px',
createShadow(),
createShadow(),
createShadow(),
Expand Down

0 comments on commit 6caa287

Please sign in to comment.