mohebifar / mohebifar/react-native-copilot

Change Arrow Color and backdrop color

Open
#91 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needed: more information question
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.1
  • react-native: v0.57
  • react-native-svg: v7.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.