Giter Site home page Giter Site logo

StageButtons about react-native-stager HOT 7 CLOSED

pocesar avatar pocesar commented on May 24, 2024
StageButtons

from react-native-stager.

Comments (7)

pocesar avatar pocesar commented on May 24, 2024

you have a couple of options. I usually prefer to delegate the current control to an outside state, in the parent of Stager and check from there. you can use the functions in context like context.has('prev') or context.has('next') to determinate if you can show / hide the control buttons. the default implementation can show you how to do it (in https://github.com/pocesar/react-native-stager/blob/master/src/index.tsx#L445-L457) just change this.state to context.state
the docs are lackluster regarding the API, but I'll complement it soon. eventually I'll add public getters from the state, because context.state seems hacky

from react-native-stager.

appjitsu avatar appjitsu commented on May 24, 2024

from react-native-stager.

appjitsu avatar appjitsu commented on May 24, 2024

from react-native-stager.

appjitsu avatar appjitsu commented on May 24, 2024

How would you go about conditionally showing the next only on some stages?

There are some situations where the next button should be disabled until the user enters the correct information.

Example: next buttons should be disabled until the pin has 4 digits...

screen shot 2017-09-12 at 12 45 07 pm

from react-native-stager.

appjitsu avatar appjitsu commented on May 24, 2024

Nvm. I just saw this.

<Button title="can continue" onPress={() => {
          this.setState({
            canContinue: true
          }, instance.refresh)
        }} />

from react-native-stager.

appjitsu avatar appjitsu commented on May 24, 2024

Next question is, in the above example the step progress bar does not stretch across the view. How do that?

from react-native-stager.

pocesar avatar pocesar commented on May 24, 2024

the

<View style={styles.progressPad} />

in https://github.com/pocesar/react-native-stager/blob/master/src/index.tsx#L436 is to force using 30% of the available screen width with an empty element. you can remove that and set the flex of the styles.progressFlex with a flex: 1 to use all available space

from react-native-stager.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.