Skip to content

Commit

Permalink
fix: cannot custom progress bar background color
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed May 28, 2020
1 parent 0839a45 commit 9205b92
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 173 deletions.
35 changes: 35 additions & 0 deletions __tests__/tests/__snapshots__/locale.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ exports[`Locale test should render default locale with en_US 1`] = `
</span>
</div>
</div>
<div
class="play-mode-title"
>
Play in order
</div>
<audio
class="music-player-audio"
src=""
Expand Down Expand Up @@ -528,6 +533,16 @@ exports[`Locale test should render default locale with en_US 1`] = `
</div>
</div>
</AudioListsPanel>
<PlayModel
value="Play in order"
visible={false}
>
<div
className="play-mode-title"
>
Play in order
</div>
</PlayModel>
<audio
className="music-player-audio"
src=""
Expand Down Expand Up @@ -734,6 +749,11 @@ exports[`Locale test should render locale with zh_CN 1`] = `
</span>
</div>
</div>
<div
class="play-mode-title"
>
Play in order
</div>
<audio
class="music-player-audio"
src=""
Expand Down Expand Up @@ -887,6 +907,11 @@ exports[`Locale test should render locale with zh_CN 1`] = `
</span>
</div>
</div>
<div
class="play-mode-title"
>
顺序播放
</div>
<audio
class="music-player-audio"
src=""
Expand Down Expand Up @@ -1219,6 +1244,16 @@ exports[`Locale test should render locale with zh_CN 1`] = `
</div>
</div>
</AudioListsPanel>
<PlayModel
value="顺序播放"
visible={false}
>
<div
className="play-mode-title"
>
顺序播放
</div>
</PlayModel>
<audio
className="music-player-audio"
src=""
Expand Down
15 changes: 15 additions & 0 deletions __tests__/tests/__snapshots__/player.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ exports[`<ReactJkMusicPlayer/> should render a <ReactJkMusicPlayer/> components
</span>
</div>
</div>
<div
class="play-mode-title"
>
Play in order
</div>
<audio
class="music-player-audio"
src=""
Expand Down Expand Up @@ -479,6 +484,16 @@ exports[`<ReactJkMusicPlayer/> should render a <ReactJkMusicPlayer/> components
</div>
</div>
</AudioListsPanel>
<PlayModel
value="Play in order"
visible={false}
>
<div
className="play-mode-title"
>
Play in order
</div>
</PlayModel>
<audio
className="music-player-audio"
src=""
Expand Down
17 changes: 14 additions & 3 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ module.exports = () => {
const isDev = process.env.NODE_ENV === 'development'
const options = {
mode: process.env.NODE_ENV,
entry: ['react-hot-loader/patch', path.join(__dirname, '../example')],
entry: isDev
? [
'react-hot-loader/patch',
`webpack-dev-server/client?http://${HOST}:${PORT}`,
'webpack/hot/only-dev-server',
path.join(__dirname, '../example'),
]
: path.join(__dirname, '../example'),
output: {
path: path.join(__dirname, '../example/dist'),
filename: '[name].[hash:8].js',
Expand Down Expand Up @@ -48,6 +55,10 @@ module.exports = () => {
loader: 'less-loader',
options: {
sourceMap: isDev,
// modifyVars: {
// 'primary-color': 'red',
// },
// javascriptEnabled: true,
},
},
],
Expand Down Expand Up @@ -75,7 +86,7 @@ module.exports = () => {
},
],
},
devtool: isDev ? 'source-map' : false,
devtool: isDev ? 'nosources-source-map' : false,
//自动补全后缀
resolve: {
enforceExtension: false,
Expand All @@ -92,7 +103,7 @@ module.exports = () => {
inline: true,
port: PORT,
historyApiFallback: true,
hotOnly: true,
hot: true,
stats: {
color: true,
errors: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-jinke-music-player",
"version": "4.13.1",
"version": "4.14.0",
"description": "Maybe the best beautiful HTML5 responsive player component for react",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
2 changes: 0 additions & 2 deletions src/config/slider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const sliderBaseOptions = {
min: 0,
step: 0.01,
trackStyle: { backgroundColor: "#31c27c" },
handleStyle: { backgroundColor: "#31c27c", border: "2px solid #fff" },
};
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @version 4.13.1
* @version 4.14.0
* @name react-jinke-music-player
* @description Maybe the best beautiful HTML5 responsive player component for react :)
* @author Jinke.Li <1359518268@qq.com>
Expand Down Expand Up @@ -1481,7 +1481,8 @@ export default class ReactJkMusicPlayer extends PureComponent {
0,
Math.min(audioLists.length, this.props.defaultPlayIndex)
);
const playId = this.state.playId || audioLists[playIndex].id;
const playId =
this.state.playId || (audioLists[playIndex] && audioLists[playIndex].id);
return playId;
};

Expand Down
2 changes: 2 additions & 0 deletions src/styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
overflow: hidden;
.center();

.overwrite-progress-bar();

.img-content {
width: 50px;
height: 50px;
Expand Down
Loading

0 comments on commit 9205b92

Please sign in to comment.