diff --git a/src/components/base/Progress/index.js b/src/components/base/Progress/index.js index ee1d9f75..69f8c36a 100644 --- a/src/components/base/Progress/index.js +++ b/src/components/base/Progress/index.js @@ -6,10 +6,17 @@ import Box from 'components/base/Box' const inifiteAnimation = keyframes` 0% { - left: 0 + left: -18%; + width: 20%; } + + 50% { + left: 98%; + } + 100% { - left: 102% + left: -18%; + width: 20%; } ` @@ -45,7 +52,7 @@ const Progression = styled(Bar).attrs({ ${p => p.infinite ? ` - animation: 1000ms ${inifiteAnimation} ease-out infinite; + animation: ${p.timing}ms ${inifiteAnimation} infinite; ` : ` animation: ${p.timing}ms ${fillInAnimation} ease-out; @@ -70,7 +77,7 @@ class Progress extends Component { render() { const { infinite, color, timing } = this.props - const styles = infinite ? { width: '20%' } : { width: '100%' } + const styles = infinite ? { width: '0%' } : { width: '100%' } return ( diff --git a/src/components/base/Progress/stories.js b/src/components/base/Progress/stories.js new file mode 100644 index 00000000..67c60b74 --- /dev/null +++ b/src/components/base/Progress/stories.js @@ -0,0 +1,25 @@ +// @flow + +import React from 'react' + +import { storiesOf } from '@storybook/react' +import { text, number, boolean } from '@storybook/addon-knobs' + +import Progress from 'components/base/Progress' + +const stories = storiesOf('Components/base', module) + +stories.add('Progress (infinite)', () => ( + +)) +stories.add('Progress', () => ( + +))