diff --git a/components/ExportMenu.js b/components/ExportMenu.js
index 9626c30..396c364 100644
--- a/components/ExportMenu.js
+++ b/components/ExportMenu.js
@@ -1,11 +1,11 @@
import React from 'react'
-import enhanceWithClickOutside from 'react-click-outside'
import { withRouter } from 'next/router'
import { COLORS, EXPORT_SIZES } from '../lib/constants'
import Button from './Button'
+import Input from './Input'
import CopyButton from './CopyButton'
-import WindowPointer from './WindowPointer'
+import Popout from './Popout'
import { toggle } from '../lib/util'
@@ -20,53 +20,35 @@ const toIFrame = url =>
const CopyEmbed = withRouter(
React.memo(
({ router: { asPath } }) => (
-
-
- {({ copied }) => (
-
- )}
-
-
-
+
+ {({ copied }) => (
+
+ )}
+
),
(prevProps, nextProps) => prevProps.router.asPath === nextProps.router.asPath
)
)
+const popoutStyle = { width: '280px', right: 0 }
+
class ExportMenu extends React.PureComponent {
state = {
isVisible: false
}
- toggle = () => this.setState(toggle('isVisible'))
-
- handleClickOutside = () => this.setState({ isVisible: false })
+ toggle = e => {
+ e.stopPropagation()
+ this.setState(toggle('isVisible'))
+ }
- handleInputChange = e => this.props.onChange(e.target.name, e.target.value)
+ handleInputChange = ({ target: { name, value } }) => this.props.onChange(name, value)
handleExportSizeChange = selectedSize => () => this.props.onChange('exportSize', selectedSize)
@@ -77,180 +59,120 @@ class ExportMenu extends React.PureComponent {
const { isVisible } = this.state
return (
-