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

[Stepper] Refactor Stepper #3903

Merged
merged 1 commit into from
Apr 11, 2016
Merged

Conversation

nathanmarks
Copy link
Member

As per #3887 I have been hard at work refactoring Stepper.

I have a few things to finish wrapping up:

  • Clean up props / API surface
  • Add props documentation
  • Add a couple more examples and explanation of the props waterfall + overriding props
  • Add a few integration tests
  • Fix a couple of outstanding styling issues (last connector when final step is active in a vertical stepper)
  • Add hover state background to buttons
  • Alternate label
  • Perf optimization

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

@nathanmarks nathanmarks added this to the 0.15.0-beta.1 Release milestone Apr 8, 2016
@nathanmarks nathanmarks added Refactoring PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Apr 8, 2016
@nathanmarks nathanmarks removed the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Apr 8, 2016
@newoga
Copy link
Contributor

newoga commented Apr 8, 2016

Looks good so far @nathanmarks!

@nathanmarks nathanmarks changed the title [WIP][Stepper] Refactor Stepper [Stepper] Refactor Stepper Apr 9, 2016
@nathanmarks
Copy link
Member Author

@callemall/material-ui I have 1 or 2 small things to tie up as you can see in the OP, but this is ready for review 👍

@@ -40,9 +41,16 @@ class CodeExample extends React.Component {
},
};

const docs = parse(code);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that feel much better like this.
I think that we should follow this pattern everywhere (having the description above the component).
cc @mbrookes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, @nathanmarks and I talked about this before he pushed. I like it, and it solves some other problems (string concat vs. backtick escaping) with the current approach. We can fix up the others when this merged. 👍

@nathanmarks
Copy link
Member Author

@oliviertassinari I've tended to the items you highlighted 👍

const icon = index + 1;

return React.cloneElement(child, Object.assign(
{active, completed, disabled, icon, last},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I'm a fan of this short-hand syntax for creating objects 😄. Though I think we may have discussed in another issue we may consider setting up an eslint rule to disallow this.

@oliviertassinari Is this fine?

@newoga
Copy link
Contributor

newoga commented Apr 11, 2016

@nathanmarks As I'm sure you've noticed, I had mostly nitpick comments. I think this is good for beta release minus that one extra comma in the test. 👍

@nathanmarks
Copy link
Member Author

@newoga fixed all your points 👍

Refactor Stepper to fix issues in the existing implementation
that are detailed in mui#3725. Documentation is also reworked for
the component and a new transition group added to the internal folder.
@nathanmarks
Copy link
Member Author

Squashed it 👍

@newoga
Copy link
Contributor

newoga commented Apr 11, 2016

Alright, everything looks good to me and I just tested this locally. We can review/wrap up the rest of it later. This is what fine looking set of components @nathanmarks! Great work!

@namKolo Thanks again for starting this effort 😄

export Step from './Step';
export StepButton from './StepButton';
export StepContent from './StepContent';
export StepLabel from './StepLabel';
export Stepper from './Stepper';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be export default from './Stepper' and the imports in he examples be changed to use the default import? I think that's the pattern we're using elsewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@newoga We are now using https://github.com/leebyron/ecmascript-more-export-from pattern elsewhere. E.g. you can have a look at the index.js.

@oliviertassinari oliviertassinari merged commit 16056fc into mui:master Apr 11, 2016
@oliviertassinari
Copy link
Member

@nathanmarks That PR is awesome. I wish all our components were that quality 👍.

@nathanmarks
Copy link
Member Author

@oliviertassinari thanks! More to come hopefully 😄

und3fined pushed a commit to und3fined/material-ui that referenced this pull request Apr 20, 2016
Refactor Stepper to fix issues in the existing implementation
that are detailed in mui#3725. Documentation is also reworked for
the component and a new transition group added to the internal folder.
@zannager zannager added the component: stepper This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: stepper This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants