Skip to content

Commit fe1c10c

Browse files
authored
Point new labelColor prop (#3692)
1 parent 45c639f commit fe1c10c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/timeline/Point.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React, {useMemo} from 'react';
32
import {StyleSheet, LayoutChangeEvent} from 'react-native';
43
import {Colors, Spacings} from '../../style';
@@ -37,18 +36,22 @@ const Point = (props: PointPropsInternal) => {
3736
{borderWidth: OUTLINE_WIDTH, borderColor: color && Colors.getColorTint(color, OUTLINE_TINT)};
3837
const circleStyle = !hasContent && isCircle &&
3938
{backgroundColor: 'transparent', borderWidth: CIRCLE_WIDTH, borderColor: color};
40-
39+
4140
return [styles.point, pointSizeStyle, !removeIconBackground && pointColorStyle, outlineStyle, circleStyle];
4241
}, [type, color, label, removeIconBackground, icon]);
4342

4443
const renderPointContent = () => {
45-
const {removeIconBackground} = props;
44+
const {removeIconBackground, labelColor} = props;
4645
const tintColor = removeIconBackground ? Colors.$iconDefault : Colors.$iconDefaultLight;
4746
const iconSize = removeIconBackground ? undefined : ICON_SIZE;
4847
if (icon) {
4948
return <Icon tintColor={tintColor} {...iconProps} size={iconSize} source={icon}/>;
5049
} else if (label) {
51-
return <Text recorderTag={'unmask'} $textDefaultLight subtextBold>{label}</Text>;
50+
return (
51+
<Text recorderTag={'unmask'} $textDefaultLight subtextBold color={labelColor}>
52+
{label}
53+
</Text>
54+
);
5255
}
5356
};
5457

src/components/timeline/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export type PointProps = {
3737
iconProps?: IconProps;
3838
removeIconBackground?: boolean;
3939
label?: number;
40+
labelColor?: string;
4041
/** to align point to this view's center */
4142
anchorRef?: React.MutableRefObject<undefined>;
4243
}

0 commit comments

Comments
 (0)