Skip to content

Commit 3e2e12f

Browse files
author
Anupriy R
committed
Feat: Support custom extra component in tooltip along with imageSource
1 parent 96f6bae commit 3e2e12f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/components/ConnectedCopilotStep.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type Props = {
88
text: string,
99
order: number,
1010
imageSource: string,
11+
extraComponent: React$Element,
1112
_copilot: CopilotContext,
1213
children: React$Element
1314
};
@@ -19,6 +20,7 @@ class ConnectedCopilotStep extends Component<Props> {
1920
text: this.props.text,
2021
order: this.props.order,
2122
imageSource: this.props.imageSource,
23+
extraComponent: this.props.extraComponent,
2224
target: this,
2325
wrapper: this.wrapper,
2426
});

src/components/Tooltip.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const Tooltip = ({
2727
}: Props) => {
2828
return (
2929
<View>
30+
<View style={styles.extraComponentContainer}>
31+
{currentStep.extraComponent}
32+
</View>
3033
<View style={styles.imageContainer}>
3134
<Image style={{ flex: 1 }} source={currentStep.imageSource} />
3235
</View>

src/components/style.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export default StyleSheet.create({
3232
},
3333
tooltipText: {
3434

35+
},
36+
extraComponentContainer: {
37+
flex: 1,
38+
justifyContent: 'center',
39+
alignItems: 'center',
3540
},
3641
imageContainer: {
3742
flex: 1,

0 commit comments

Comments
 (0)