import React from 'react' import { withRouter } from 'next/router' import { useCopyTextHandler } from '@dawnlabs/tacklebox' import { COLORS, EXPORT_SIZES } from '../lib/constants' import Button from './Button' import Input from './Input' import Popout, { managePopout } from './Popout' const toIFrame = url => ` ` const CopyEmbed = withRouter( React.memo( ({ router: { asPath } }) => { const { onClick, copied } = useCopyTextHandler(toIFrame(asPath)) return ( ) }, (prevProps, nextProps) => prevProps.router.asPath === nextProps.router.asPath ) ) const popoutStyle = { width: '280px', right: 0 } class ExportMenu extends React.PureComponent { handleInputChange = ({ target: { name, value } }) => this.props.onChange(name, value) handleExportSizeChange = selectedSize => () => this.props.onChange('exportSize', selectedSize) handleExport = format => () => this.props.export(format) render() { const { exportSize, filename, isVisible, toggleVisibility, disablePNG } = this.props return (
) } } export default managePopout(ExportMenu)