Skip to content

Commit

Permalink
[GSW-411] fix: Fix liqutidy hover chart
Browse files Browse the repository at this point in the history
  • Loading branch information
khiemldk committed Nov 22, 2023
1 parent 2433438 commit a56f71f
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const BarAreaGraphWrapper = styled.div<{
width: 100%;
height: 100%;
pointer-events: none;
> g, > polygon {
pointer-events: initial;
}
.area {
background: linear-gradient(
270deg,
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/components/common/bar-graph/BarGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ const BarGraph: React.FC<BarGraphProps> = ({

let currentPointIndex = -1;
for (const point of getGraphPoints()) {
const distance = Math.abs(point.x - xPosition);
const distance = xPosition - point.x;
currentPointIndex += 1;
if (minDistance < 0) {
if (minDistance < 0 && distance >= 0) {
minDistance = distance;
}
if (distance < minDistance + 1) {
if (distance >= 0 && distance < minDistance + 1) {
currentPoint = point;
minDistance = distance;
setCurrentPointIndex(currentPointIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const PoolGraph: React.FC<PoolGraphProps> = ({

function onMouseoverChartBin(event: MouseEvent, bin: PoolBinModel) {
if (mouseover && tooltipRef.current) {
if (tooltipRef.current.getAttribute("bin-id") !== bin.binId) {
if (bin.binId) {
const content = renderToStaticMarkup(
<PoolGraphBinTooptip
tokenA={tokenA}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export const position: PoolPosition = {
currentPriceAmount: "1184.24 GNOS per ETH",
minPriceAmount: "1.75 GNOT Per GNOS",
maxPriceAmount: "2.25 GNOT Per GNOS",
currentTick: 4,
currentTick: 20,
minTick: 40,
maxTick: 200,
minLabel: "-30%",
maxLabel: "50%",
ticks: ["1", "1", "2", "2", "3", "3", "2", "2", "1", "1"]
ticks: ["1", "1", "3", "0", "2", "0", "4", "0", "0", "1", "2", "4","1", "5", "1", "6", "2", "7", "0", "1", "0", "2", "5", "0", "1", "0", "5", "4", "1", "3", "0", "5", "2", "1", "1", "0", "0", "0", "0", "0"]
};

export const UnConnected = Template.bind({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const LoadingWrapper = styled.div`
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
padding: 16px 0px 12px;
& > div:first-of-type {
padding: 0 24px 13px 24px;
}
${media.mobile} {
padding: 16px 0px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const LoadingWrapper = styled.div`
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
padding: 16px 0px 12px;
& > div:first-of-type {
padding: 0 24px 13px 24px;
}
${media.mobile} {
padding: 16px 0px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const TableWrapper = styled.div`
color: ${({ theme }) => theme.color.text04};
${fonts.body11};
overflow-x: auto;
&.hidden-scroll {
overflow-x: hidden;
}
.scroll-wrapper {
${mixins.flexbox("column", "flex-start", "flex-start")};
height: auto;
Expand Down Expand Up @@ -159,6 +162,7 @@ export const noDataText = (theme: Theme) => css`
color: ${theme.color.text04};
${fonts.body12};
width: calc(100vw - 82px);
max-width: 1358px;
height: 300px;
${media.mobile} {
width: calc(100vw - 34px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const TokenListTable: React.FC<TokenListTableProps> = ({
};

return breakpoint !== DEVICE_TYPE.MOBILE ? (
<TableWrapper>
<TableWrapper className={tokens.length === 0 ? "hidden-scroll" : ""}>
<div className="scroll-wrapper">
<div className="token-list-head">
{Object.values(TABLE_HEAD).map((head, idx) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const LoadingWrapper = styled.div`
box-shadow: 8px 8px 20px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
padding: 16px 0px 12px;
& > div:first-of-type {
padding: 0 24px 13px 24px;
}
${media.mobile} {
padding: 16px 0px;
}
Expand Down
10 changes: 7 additions & 3 deletions packages/web/src/constants/skeleton.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const skeletonTrendingStyle =
width: ${typeof skeletonWidth === "number"
? `${skeletonWidth}px`
: skeletonWidth};
height: 25px;
height: 24px;
background: ${theme.color.background23};
overflow: hidden;
border-radius: ${type === SHAPE_TYPES.CIRCLE ? "50%" : "2px"};
Expand All @@ -55,10 +55,14 @@ export const skeletonTrendingStyle =
position: absolute;
left: 0%;
top: 0;
transform: translateX(-50%);
transform: translateX(-100%);
width: 100%;
height: 100%;
background: ${theme.color.backgroundGradient5};
background: linear-gradient(
0,
${theme.color.backgroundGradient} 0%,
${theme.color.backgroundGradient} 100%
);
animation: ${skeletonAni} 2s ease infinite;
}
`;
Expand Down

0 comments on commit a56f71f

Please sign in to comment.