use icon constants

This commit is contained in:
btzr-io 2018-06-18 16:16:22 -06:00 committed by Sean Yesmunt
parent f026ed6db6
commit 213b5280b7
2 changed files with 3 additions and 1 deletions

View file

@ -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} />;

View file

@ -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';