From 364b7b3d636d2072bed0e4f99b608623a6d560a0 Mon Sep 17 00:00:00 2001 From: adids1221 Date: Tue, 22 Apr 2025 17:31:26 +0300 Subject: [PATCH] Point new labelColor prop --- src/components/timeline/Point.tsx | 11 +++++++---- src/components/timeline/types.ts | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/timeline/Point.tsx b/src/components/timeline/Point.tsx index a1be5fab96..a8f56c2358 100644 --- a/src/components/timeline/Point.tsx +++ b/src/components/timeline/Point.tsx @@ -1,4 +1,3 @@ - import React, {useMemo} from 'react'; import {StyleSheet, LayoutChangeEvent} from 'react-native'; import {Colors, Spacings} from '../../style'; @@ -37,18 +36,22 @@ const Point = (props: PointPropsInternal) => { {borderWidth: OUTLINE_WIDTH, borderColor: color && Colors.getColorTint(color, OUTLINE_TINT)}; const circleStyle = !hasContent && isCircle && {backgroundColor: 'transparent', borderWidth: CIRCLE_WIDTH, borderColor: color}; - + return [styles.point, pointSizeStyle, !removeIconBackground && pointColorStyle, outlineStyle, circleStyle]; }, [type, color, label, removeIconBackground, icon]); const renderPointContent = () => { - const {removeIconBackground} = props; + const {removeIconBackground, labelColor} = props; const tintColor = removeIconBackground ? Colors.$iconDefault : Colors.$iconDefaultLight; const iconSize = removeIconBackground ? undefined : ICON_SIZE; if (icon) { return ; } else if (label) { - return {label}; + return ( + + {label} + + ); } }; diff --git a/src/components/timeline/types.ts b/src/components/timeline/types.ts index 785bfebcc9..1fdd078953 100644 --- a/src/components/timeline/types.ts +++ b/src/components/timeline/types.ts @@ -37,6 +37,7 @@ export type PointProps = { iconProps?: IconProps; removeIconBackground?: boolean; label?: number; + labelColor?: string; /** to align point to this view's center */ anchorRef?: React.MutableRefObject; }