react-native-copilot icon indicating copy to clipboard operation
react-native-copilot copied to clipboard

Feature Request: Hide the Skip button

Open personjerry opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. My new user experience is very important and I don't want it to be skippable, so I'd like to hide the skip button in the default tooltip.

Describe the solution you'd like Add a parameter to copilot() to hide the skip button. Drawback is it's another parameter to think about.

Describe alternatives you've considered I've tried making the translation string to an empty string, but any falsy value is ignored.

Teachability, Documentation, Adoption, Migration Strategy copilot({ allowSkip: true})

personjerry avatar Jun 25 '20 00:06 personjerry

Hello. What's the status of this? I am currently using the library and would like to remove the skip button. Thank you.

BaderSerhan avatar May 23 '21 00:05 BaderSerhan

You can achieve that by setting your own tooltip component

ncoen97 avatar Jun 11 '21 13:06 ncoen97

A dirty, quick, lazy way is to set "skip" property to a space. The button is still there, but users will unlikely press it.

export default copilot({
  verticalOffset: 32,
  animated: true,
  overlay: 'view',

  labels: {
    // TODO !! Copilot | Translation depends on React components... See: https://github.com/mohebifar/react-native-copilot/issues/260
    previous: "Anterior",
    next: "Siguiente",
    skip: ` `,
    finish: "Terminar",
  },
  // allowSkip: false  // TODO !! Copilot | Pending pull request. See: https://github.com/mohebifar/react-native-copilot/pull/187
  stepNumberComponent: () => (<></>),
})(Main);

didac-wh avatar Nov 08 '22 12:11 didac-wh

As there is no props, so according to me just comment the lines from luibrary which is responsible for this skip button.

To do this follow the steps below:-

  1. node_modules/react-native-copilot/dist/index.d.ts in this file remove skip from Labels (Line Number:- 25) After modification:- type Labels = Partial<Record<"previous" | "next" | "finish", string>>;

  2. from index.js file we have to change:-

comment out this line:-

{!isLastStep ? <import_react_native3.TouchableOpacity onPress={handleStop}><Button>{labels.skip}</Button></import_react_native3.TouchableOpacity> : null}

  1. in this object comment out skip

labels = { finish: "Finish", next: "Next", previous: "Previous", // skip: "Skip" },

  1. Then make a patch, problem solved.

Sandipnag avatar Aug 21 '23 08:08 Sandipnag