From 02debae7e26c3004e333adf949b8b77a0eff00df Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 20 Nov 2018 14:24:55 -0500 Subject: [PATCH] increase button click area (#584) --- components/ExportButton.js | 43 -------------------------------------- components/ExportMenu.js | 39 +++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 57 deletions(-) delete mode 100644 components/ExportButton.js diff --git a/components/ExportButton.js b/components/ExportButton.js deleted file mode 100644 index d9e6354..0000000 --- a/components/ExportButton.js +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react' -import { withRouter } from 'next/router' - -import CopyButton from './CopyButton' - -const toIFrame = url => - ` -` - -function ExportButton({ router, color }) { - return ( - - - {({ copied }) => } - - - - ) -} - -export default withRouter(ExportButton) diff --git a/components/ExportMenu.js b/components/ExportMenu.js index 06dfb65..a18b64b 100644 --- a/components/ExportMenu.js +++ b/components/ExportMenu.js @@ -1,12 +1,21 @@ import React from 'react' import enhanceWithClickOutside from 'react-click-outside' import shallowCompare from 'react-addons-shallow-compare' +import { withRouter } from 'next/router' import { COLORS, EXPORT_SIZES } from '../lib/constants' -import ExportButton from './ExportButton' import Button from './Button' +import CopyButton from './CopyButton' import WindowPointer from './WindowPointer' +const toIFrame = url => + ` +` + class ExportMenu extends React.Component { state = { isVisible: false @@ -40,7 +49,7 @@ class ExportMenu extends React.Component { } render() { - const { exportSize, filename } = this.props + const { exportSize, filename, router } = this.props const { isVisible } = this.state return ( @@ -80,12 +89,14 @@ class ExportMenu extends React.Component {
-
- -
-
- Copy Embed -
+ + + {({ copied }) => ( + + )} +
Save as
@@ -177,8 +188,8 @@ class ExportMenu extends React.Component { opacity: 1; } - .copy-container, - .open-container, + .copy-button, + .open-button, .save-container { display: flex; flex: 1; @@ -187,12 +198,12 @@ class ExportMenu extends React.Component { padding: 12px 16px; } - .copy-container { + .copy-button { flex-basis: 72px; } - .copy-container, - .open-container { + .copy-button, + .open-button { border-right: 1px solid ${COLORS.PURPLE}; } @@ -219,4 +230,4 @@ class ExportMenu extends React.Component { } } -export default enhanceWithClickOutside(ExportMenu) +export default withRouter(enhanceWithClickOutside(ExportMenu))