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

feat(Transition): make duration prop more advanced #1967

Merged
merged 2 commits into from
Aug 20, 2017

Conversation

layershifter
Copy link
Member

This PR makes possible to define diffent durations for hide and show actions.

@@ -5,7 +5,7 @@ const transitions = ['jiggle', 'flash', 'shake', 'pulse', 'tada', 'bounce']

const options = transitions.map(name => ({ key: name, text: name, value: name }))

export default class TransitionExampleStaticExplorer extends Component {
export default class TransitionExampleTransitionExplorer extends Component {
Copy link
Member Author

Choose a reason for hiding this comment

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

Name example's class as file

@@ -1,11 +1,10 @@
import React from 'react'
import { Message } from 'semantic-ui-react'
Copy link
Member Author

Choose a reason for hiding this comment

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

Sort imports.

import { Message } from 'semantic-ui-react'

const TransitionTypesExamples = () => (
const TransitionExplorersExamples = () => (
Copy link
Member Author

Choose a reason for hiding this comment

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

Typo.

@codecov-io
Copy link

codecov-io commented Aug 15, 2017

Codecov Report

Merging #1967 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1967      +/-   ##
=========================================
+ Coverage    99.8%   99.8%   +<.01%     
=========================================
  Files         148     148              
  Lines        2580    2584       +4     
=========================================
+ Hits         2575    2579       +4     
  Misses          5       5
Impacted Files Coverage Δ
src/modules/Transition/TransitionGroup.js 100% <ø> (ø) ⬆️
src/modules/Transition/Transition.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2fe58c...6e0bb47. Read the comment docs.

@@ -25,7 +31,13 @@ export default class Transition extends Component {
children: PropTypes.element.isRequired,

/** Duration of the CSS transition animation in milliseconds. */
duration: PropTypes.number,
duration: PropTypes.oneOfType([
PropTypes.number,
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we technically also support a string here.

@@ -15,7 +15,7 @@ export interface TransitionProps {
children?: React.ReactNode;

/** Duration of the CSS transition animation in milliseconds. */
duration?: number;
duration?: number | TransitionPropDuration;
Copy link
Member

Choose a reason for hiding this comment

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

String is also supported, correct?

@@ -14,7 +16,7 @@ export interface TransitionGroupProps {
children?: React.ReactNode;

/** Duration of the CSS transition animation in milliseconds. */
duration?: number;
duration?: number | TransitionPropDuration;
Copy link
Member

Choose a reason for hiding this comment

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

Also string I believe.

@@ -31,7 +31,13 @@ export default class TransitionGroup extends React.Component {
children: PropTypes.node,

/** Duration of the CSS transition animation in milliseconds. */
duration: PropTypes.number,
duration: PropTypes.oneOfType([
PropTypes.number,
Copy link
Member

Choose a reason for hiding this comment

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

Finally, let's add string as a supported type here too.

@levithomason levithomason force-pushed the feat/transition-duration branch from 5f9cbc0 to f511e0e Compare August 20, 2017 17:31
@levithomason
Copy link
Member

I've rebased to the latest master and added string duration propType / typings support. Will merge on pass.

@levithomason levithomason merged commit 6b66da1 into master Aug 20, 2017
@levithomason levithomason deleted the feat/transition-duration branch August 20, 2017 17:43
@levithomason
Copy link
Member

Released in [email protected]

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

Successfully merging this pull request may close these issues.

3 participants