Skip to content

Instantly share code, notes, and snippets.

@wongni
Created January 12, 2018 06:24
Show Gist options
  • Save wongni/2090d4bba56af8fc6c2731f498ad16c8 to your computer and use it in GitHub Desktop.
Save wongni/2090d4bba56af8fc6c2731f498ad16c8 to your computer and use it in GitHub Desktop.
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