Skip to content

Commit f9b6d46

Browse files
committed
Make the arrow rounded and bigger
1 parent 33d125c commit f9b6d46

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ts/features/tour/components/TourTooltip.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import { TourItemMeasurement } from "../types";
2323
import { useTourStepNavigation } from "../hooks/useTourStepNavigation";
2424

2525
const TOOLTIP_MARGIN = 16;
26-
const ARROW_SIZE = 10;
26+
const ARROW_SIZE = 20;
27+
const ARROW_VISIBLE = ARROW_SIZE / 3;
2728
const BORDER_RADIUS = 8;
2829

2930
type Props = {
@@ -60,10 +61,10 @@ export const TourTooltip = ({
6061
const showAbove = spaceAbove > spaceBelow;
6162

6263
const tooltipTop = showAbove
63-
? itemMeasurement.y - tooltipHeight - ARROW_SIZE / 2 - TOOLTIP_MARGIN
64+
? itemMeasurement.y - tooltipHeight - ARROW_VISIBLE - TOOLTIP_MARGIN
6465
: itemMeasurement.y +
6566
itemMeasurement.height +
66-
ARROW_SIZE / 2 +
67+
ARROW_VISIBLE +
6768
TOOLTIP_MARGIN;
6869

6970
const itemCenterX = itemMeasurement.x + itemMeasurement.width / 2;
@@ -118,8 +119,8 @@ export const TourTooltip = ({
118119
backgroundColor: tooltipBgColor,
119120
left: arrowLeft,
120121
...(showAbove
121-
? { bottom: -ARROW_SIZE / 2 }
122-
: { top: -ARROW_SIZE / 2 })
122+
? { bottom: -ARROW_VISIBLE }
123+
: { top: -ARROW_VISIBLE })
123124
}
124125
]}
125126
/>
@@ -189,6 +190,8 @@ const styles = StyleSheet.create({
189190
position: "absolute",
190191
width: ARROW_SIZE,
191192
height: ARROW_SIZE,
193+
borderRadius: 4,
194+
borderCurve: "continuous",
192195
transform: [{ rotate: "45deg" }],
193196
zIndex: 2
194197
}

0 commit comments

Comments
 (0)