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
[MobileStepper] Add nextButton and backButton property #8001
Conversation
src/MobileStepper/MobileStepper.js
Outdated
@@ -121,6 +133,10 @@ MobileStepper.propTypes = { | |||
/** | |||
* Set the text that appears for the back button. | |||
*/ | |||
backButtonProps: PropTypes.instanceOf(Object), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using PropTypes.object
?
src/MobileStepper/MobileStepper.js
Outdated
@@ -139,11 +155,15 @@ MobileStepper.propTypes = { | |||
*/ | |||
disableNext: PropTypes.bool, | |||
/** | |||
* Passed into the onClick prop of the Back button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong wording
@oliviertassinari thanks for the feedback |
Looking at this change and at the MobileSteppper Api itself, maybe instead of passing props (backButtonText, backButtonProps, disableBack, onBack ....) of button. Maybe it would be better if the MobileSteppper would accept 2 components (i.e. backButton and nextButton) as props: thinking about somehting like this ; <MobileStepper
type="text"
steps={6}
position="static"
activeStep={this.state.activeStep}
className={classes.mobileStepper}
backComponent={<Button .../>}
nextComponent={<Button .../>}
/> |
@stunaz not a bad idea especially that now its not possible to remove the buttons at the first or last step |
@stunaz I like this proposition. Following it we could make the |
The following properties list
Could become:
|
@oliviertassinari @stunaz Shall default buttons be implemented or like |
I think |
Should be good now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/MobileStepper/MobileStepper.d.ts
Outdated
|
||
export interface MobileStepperProps extends PaperProps { | ||
activeStep?: number; | ||
backButtonProps: ButtonProps; | ||
backButtonText?: React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to remove the old props.
src/MobileStepper/MobileStepper.js
Outdated
@@ -119,9 +106,9 @@ MobileStepper.propTypes = { | |||
*/ | |||
activeStep: PropTypes.number, | |||
/** | |||
* Set the text that appears for the back button. | |||
* A button element. For instance, it can be be a `Button` or a `IconButton`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a back related comment.
src/MobileStepper/MobileStepper.js
Outdated
@@ -131,25 +118,9 @@ MobileStepper.propTypes = { | |||
*/ | |||
className: PropTypes.string, | |||
/** | |||
* Set to true to disable the back button. | |||
* A button element. For instance, it can be be a `Button` or a `IconButton`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a next related comment.
Thanks |
This reverts commit f042359.
I needed this to pass props to the
MobileStepper
componentBreaking change