Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/components/timeline/Point.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import React, {useMemo} from 'react';
import {StyleSheet, LayoutChangeEvent} from 'react-native';
import {Colors, Spacings} from '../../style';
Expand Down Expand Up @@ -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 <Icon tintColor={tintColor} {...iconProps} size={iconSize} source={icon}/>;
} else if (label) {
return <Text recorderTag={'unmask'} $textDefaultLight subtextBold>{label}</Text>;
return (
<Text recorderTag={'unmask'} $textDefaultLight subtextBold color={labelColor}>
{label}
</Text>
);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/components/timeline/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<undefined>;
}
Expand Down