react-native-copilot
react-native-copilot copied to clipboard
Feature Request: Hide the Skip button
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})
Hello. What's the status of this? I am currently using the library and would like to remove the skip button. Thank you.
You can achieve that by setting your own tooltip component
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);
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:-
-
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>>;
-
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}
- in this object comment out skip
labels = { finish: "Finish", next: "Next", previous: "Previous", // skip: "Skip" },
- Then make a patch, problem solved.