Created
January 12, 2018 06:24
-
-
Save wongni/2090d4bba56af8fc6c2731f498ad16c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import styles from './Viewer.scss' | |
import classNames from 'classnames/bind' | |
const cx = classNames.bind(styles) | |
const Viewer = ({ mediaType, url, loading }) => { | |
return ( | |
<div className={cx('viewer')}> | |
{( | |
mediaType === 'image' ? ( | |
<img onClick={() => window.open(url)} src={url} alt="space" /> | |
) : ( | |
<div /> | |
) | |
)} | |
</div> | |
) | |
} | |
export default Viewer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment