use icon constants
This commit is contained in:
parent
f026ed6db6
commit
213b5280b7
2 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import * as icons from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
play: () => void,
|
||||
|
@ -14,7 +15,7 @@ class VideoPlayButton extends React.PureComponent<Props> {
|
|||
const { fileInfo, mediaType, isLoading, play } = this.props;
|
||||
const disabled = isLoading || fileInfo === undefined;
|
||||
const doesPlayback = ['audio', 'video'].indexOf(mediaType) !== -1;
|
||||
const icon = doesPlayback ? 'Play' : 'Eye';
|
||||
const icon = doesPlayback ? icons.PLAY : icons.EYE;
|
||||
const label = doesPlayback ? 'Play' : 'Preview';
|
||||
|
||||
return <Button button="primary" disabled={disabled} label={label} icon={icon} onClick={play} />;
|
||||
|
|
|
@ -29,3 +29,4 @@ export const GLOBE = 'Globe';
|
|||
export const EXTERNAL_LINK = 'ExternalLink';
|
||||
export const GIFT = 'Gift';
|
||||
export const EYE = 'Eye';
|
||||
export const PLAY = 'Play';
|
||||
|
|
Loading…
Add table
Reference in a new issue