Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'skip' button with 'previous' button #95

Open
bodrius opened this issue Nov 10, 2020 · 5 comments
Open

Replace 'skip' button with 'previous' button #95

bodrius opened this issue Nov 10, 2020 · 5 comments

Comments

@bodrius
Copy link

bodrius commented Nov 10, 2020

Please answer me, ty

@jfilter
Copy link
Owner

jfilter commented Nov 10, 2020

Please translate your question from Russian into English: https://www.deepl.com/translator

@guadalupeperezb
Copy link

Is it possible to add a "prev" button?

@jfilter jfilter changed the title Have the button prev screen?? Replace 'skip' button with 'previous' button Jan 14, 2021
@jfilter
Copy link
Owner

jfilter commented Jan 14, 2021

Not 100% sure, but you may try to set onSkip prop to a function to go the previous page. Something like:

  goPev = () => {
    this.flatList.scrollToIndex({
      animated: true,
      index:
        I18nManager.isRTL && Platform.OS == 'ios'
          ? this.state.currentPage + 1
          : this.state.currentPage - 1,
    });
  };

Otherwise, fork the repo change the skip handling there.

@pantpradeep
Copy link

did anyone find the solution to replace skip into prev btn?

@jeremiahjoyjoseph
Copy link

jeremiahjoyjoseph commented Jan 7, 2022

You can use

SkipButtonComponent={Skip}

where Skip is your react component.

then define Skip as

const Skip = ({ isLight, skipLabel, ...props }) => ( <TextButton {...props} textSize='font16' textColor='primary' textWeight='regular' onPress={handleOnPrev} style={{ marginLeft: 16, paddingHorizontal: 16 }}> Prev </TextButton> );

my snippet is a custom component but you should get an idea!

and finally you have to attach a state to
showSkip={showSkipState}

this state is controlled via the "pageIndexCallback"! when pageIndexCallback return 1 set showSkipState to false! else true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants