Skip to content

Commit 1b9b5e4

Browse files
committed
upgrade iconify to v4
1 parent 02f6cf1 commit 1b9b5e4

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
},
6262
"dependencies": {
6363
"@babel/runtime": "^7.10.2",
64-
"@iconify/icons-mdi": "~1.1.0",
65-
"@iconify/react": "^3.1.3"
64+
"@iconify/react": "^4.1.1"
6665
},
6766
"devDependencies": {
6867
"@babel/cli": "^7.10.1",

src/index.tsx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ import React, {
99
Key,
1010
} from 'react'
1111
import { Icon } from '@iconify/react'
12-
import playCircle from '@iconify/icons-mdi/play-circle'
13-
import pauseCircle from '@iconify/icons-mdi/pause-circle'
14-
import skipPrevious from '@iconify/icons-mdi/skip-previous'
15-
import skipNext from '@iconify/icons-mdi/skip-next'
16-
import fastForward from '@iconify/icons-mdi/fast-forward'
17-
import rewind from '@iconify/icons-mdi/rewind'
18-
import volumeHigh from '@iconify/icons-mdi/volume-high'
19-
import volumeMute from '@iconify/icons-mdi/volume-mute'
20-
import repeat from '@iconify/icons-mdi/repeat'
21-
import repeatOff from '@iconify/icons-mdi/repeat-off'
2212
import ProgressBar from './ProgressBar'
2313
import CurrentTime from './CurrentTime'
2414
import Duration from './Duration'
@@ -449,9 +439,9 @@ class H5AudioPlayer extends Component<PlayerProps> {
449439
const isPlaying = this.isPlaying()
450440
let actionIcon: ReactNode
451441
if (isPlaying) {
452-
actionIcon = customIcons.pause ? customIcons.pause : <Icon icon={pauseCircle} />
442+
actionIcon = customIcons.pause ? customIcons.pause : <Icon icon="mdi:pause-circle" />
453443
} else {
454-
actionIcon = customIcons.play ? customIcons.play : <Icon icon={playCircle} />
444+
actionIcon = customIcons.play ? customIcons.play : <Icon icon="mdi:play-circle" />
455445
}
456446
return (
457447
<div key={key} className="rhap_main-controls">
@@ -462,7 +452,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
462452
type="button"
463453
onClick={onClickPrevious}
464454
>
465-
{customIcons.previous ? customIcons.previous : <Icon icon={skipPrevious} />}
455+
{customIcons.previous ? customIcons.previous : <Icon icon="mdi:skip-previous" />}
466456
</button>
467457
)}
468458
{showJumpControls && (
@@ -472,7 +462,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
472462
type="button"
473463
onClick={this.handleClickRewind}
474464
>
475-
{customIcons.rewind ? customIcons.rewind : <Icon icon={rewind} />}
465+
{customIcons.rewind ? customIcons.rewind : <Icon icon="mdi:rewind" />}
476466
</button>
477467
)}
478468
<button
@@ -490,7 +480,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
490480
type="button"
491481
onClick={this.handleClickForward}
492482
>
493-
{customIcons.forward ? customIcons.forward : <Icon icon={fastForward} />}
483+
{customIcons.forward ? customIcons.forward : <Icon icon="mdi:fast-forward" />}
494484
</button>
495485
)}
496486
{showSkipControls && (
@@ -500,7 +490,7 @@ class H5AudioPlayer extends Component<PlayerProps> {
500490
type="button"
501491
onClick={onClickNext}
502492
>
503-
{customIcons.next ? customIcons.next : <Icon icon={skipNext} />}
493+
{customIcons.next ? customIcons.next : <Icon icon="mdi:skip-next" />}
504494
</button>
505495
)}
506496
</div>
@@ -517,9 +507,9 @@ class H5AudioPlayer extends Component<PlayerProps> {
517507

518508
let loopIcon: ReactNode
519509
if (loop) {
520-
loopIcon = customIcons.loop ? customIcons.loop : <Icon icon={repeat} />
510+
loopIcon = customIcons.loop ? customIcons.loop : <Icon icon="mdi:repeat" />
521511
} else {
522-
loopIcon = customIcons.loopOff ? customIcons.loopOff : <Icon icon={repeatOff} />
512+
loopIcon = customIcons.loopOff ? customIcons.loopOff : <Icon icon="mdi:repeat-off" />
523513
}
524514
return (
525515
<button
@@ -538,9 +528,9 @@ class H5AudioPlayer extends Component<PlayerProps> {
538528

539529
let volumeIcon: ReactNode
540530
if (volume) {
541-
volumeIcon = customIcons.volume ? customIcons.volume : <Icon icon={volumeHigh} />
531+
volumeIcon = customIcons.volume ? customIcons.volume : <Icon icon="mdi:volume-high" />
542532
} else {
543-
volumeIcon = customIcons.volume ? customIcons.volumeMute : <Icon icon={volumeMute} />
533+
volumeIcon = customIcons.volume ? customIcons.volumeMute : <Icon icon="mdi:volume-mute" />
544534
}
545535
return (
546536
<div key={key} className="rhap_volume-container">

0 commit comments

Comments
 (0)