Skip to content

Commit 41f9d6b

Browse files
authored
fix: barrier title (#1474)
1 parent 5e82a72 commit 41f9d6b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/components/PriceLine.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type TPriceLineProps = {
1515
foregroundColor: string;
1616
color?: string;
1717
opacityOnOverlap: number;
18+
title?: string;
1819
};
1920

2021
const PriceLine = ({
@@ -26,6 +27,7 @@ const PriceLine = ({
2627
hideOffscreenLine,
2728
hideBarrierLine,
2829
store,
30+
title,
2931
}: TPriceLineProps) => {
3032
const {
3133
className,
@@ -41,7 +43,6 @@ const PriceLine = ({
4143
priceDisplay,
4244
priceLineWidth,
4345
setDragLine,
44-
title,
4546
visible,
4647
} = store;
4748

@@ -59,6 +60,7 @@ const PriceLine = ({
5960
if (!showBarrier) return null;
6061

6162
const width = priceLineWidth + 12;
63+
const price_right_offset = (isOverlappingWithPriceLine ? width - overlappedBarrierWidth : 0) + (isMobile ? 20 : 4);
6264

6365
return (
6466
<div
@@ -88,13 +90,12 @@ const PriceLine = ({
8890
<div className='draggable-area' />
8991
<div className='draggable-area-wrapper'>
9092
<div
91-
className={'drag-price'}
93+
className='drag-price'
9294
style={{
9395
backgroundColor: color,
9496
width: isOverlappingWithPriceLine ? overlappedBarrierWidth : width,
9597
opacity,
96-
right:
97-
(isOverlappingWithPriceLine ? width - overlappedBarrierWidth : 0) + (isMobile ? 20 : 4),
98+
right: price_right_offset,
9899
}}
99100
>
100101
<HamburgerDragIcon />
@@ -122,7 +123,12 @@ const PriceLine = ({
122123
)}
123124
</div>
124125
{title && (
125-
<PriceLineTitle color={color} title={title} yAxiswidth={overlappedBarrierWidth} opacity={opacity} />
126+
<PriceLineTitle
127+
color={color}
128+
title={title}
129+
yAxiswidth={width + price_right_offset}
130+
opacity={opacity}
131+
/>
126132
)}
127133
</div>
128134
</div>

0 commit comments

Comments
 (0)