mohebifar / mohebifar/react-native-copilot
Change Arrow Color and backdrop color
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
Current Behavior
The top arrow color cannot be changed
backdrop color also don't work
I tried this for backdrop and it didn't work
Input Code
export default copilot({
animated: true, // Can be true or false
overlay: 'svg', // Can be either view or svg
backdropColor:"rgb(0, 0, 0, 0.9)",
stepNumberComponent: StepNumber1,
tooltipComponent:TooltipComponent1
})(Homepage);
Expected behavior/code
There should be some way to customise arrow color and backdrop color,
Arrow color is hard-coded here in CopilotModal.js :
if (verticalPosition === 'bottom') {
tooltip.top = obj.top + obj.height + MARGIN;
arrow.borderBottomColor = '#fff';
arrow.top = tooltip.top - (ARROW_SIZE * 2);
} else {
tooltip.bottom = layout.height - (obj.top - MARGIN);
arrow.borderTopColor = '#fff';
arrow.bottom = tooltip.bottom - (ARROW_SIZE * 2);
}
and backdrop color is here:
<Svg pointerEvents="none" width={this.state.canvasSize.x} height={this.state.canvasSize.y}>
<AnimatedSvgPath
ref={(ref) => { this.mask = ref; }}
fill="rgba(0, 0, 0, 0.4)"
fillRule="evenodd"
strokeWidth={1}
d={path(this.state.size, this.state.position, this.state.canvasSize)}
/>
</Svg>
Environment
- Device: iPhone 6s Simulator
- OS:iOS12
react-native-copilot: v2.4.1react-native: v0.57react-native-svg: v7.1.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in CopilotModal.js at the arrow positioning code and the SVG overlay shown in the issue. Trace how the copilot options are passed into the modal, then verify that arrow and backdrop colors can be configured while retaining their current defaults. Confirm the behavior on the stated React Native and react-native-svg versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- design, mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100