+ {progressDots.map((i, index) => (
+
+ ))}
+
+ )
+}
+export default ProgressDots
diff --git a/packages/griffith/src/components/ProgressDot/index.js b/packages/griffith/src/components/ProgressDot/index.js
new file mode 100644
index 00000000..7d7a2f8b
--- /dev/null
+++ b/packages/griffith/src/components/ProgressDot/index.js
@@ -0,0 +1 @@
+export {default} from './ProgressDot'
diff --git a/packages/griffith/src/components/ProgressDot/styles.js b/packages/griffith/src/components/ProgressDot/styles.js
new file mode 100644
index 00000000..da32c80d
--- /dev/null
+++ b/packages/griffith/src/components/ProgressDot/styles.js
@@ -0,0 +1,17 @@
+import {StyleSheet} from 'aphrodite/no-important'
+
+export default StyleSheet.create({
+ root: {
+ position: 'absolute',
+ display: 'flex',
+ top: 0,
+ bottom: 0,
+ width: '100%',
+ },
+ item: {
+ position: 'absolute',
+ backgroundColor: '#ff9607',
+ width: '6px',
+ height: '100%',
+ },
+})
diff --git a/packages/griffith/src/components/Slider/Slider.js b/packages/griffith/src/components/Slider/Slider.js
index af680c57..acf1a064 100644
--- a/packages/griffith/src/components/Slider/Slider.js
+++ b/packages/griffith/src/components/Slider/Slider.js
@@ -2,6 +2,7 @@ import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {css} from 'aphrodite/no-important'
import clamp from 'lodash/clamp'
+import ProgressDot from '../ProgressDot'
import formatPercent from '../../utils/formatPercent'
import KeyCode from '../../constants/KeyCode'
@@ -25,8 +26,12 @@ class Slider extends Component {
onDragEnd: PropTypes.func,
onChange: PropTypes.func,
noInteraction: PropTypes.bool, // 不可交互
+ progressDots: PropTypes.arrayOf(
+ PropTypes.shape({
+ startTime: PropTypes.number.isRequired,
+ })
+ ),
}
-
static defaultProps = {
orientation: 'horizontal',
reverse: false,
@@ -34,6 +39,7 @@ class Slider extends Component {
buffered: 0,
total: 0,
step: 1,
+ progressDots: [],
}
state = {
@@ -205,7 +211,14 @@ class Slider extends Component {
}
render() {
- const {buffered, onFocus, onBlur, noInteraction} = this.props
+ const {
+ buffered,
+ onFocus,
+ onBlur,
+ noInteraction,
+ progressDots,
+ total,
+ } = this.props
const {isSlideActive} = this.state
const interactionProps = noInteraction
? {}
@@ -236,6 +249,9 @@ class Slider extends Component {
[this.getSizeKey()]: this.getPercentage(),
}}
/>
+ {!!progressDots.length && (
+