From f15237b1a51dc279455c792a855db2bb6eeb982c Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Sun, 24 Nov 2019 01:24:22 -0330 Subject: [PATCH] Convert ExportTextContainer component to use JSX (#7538) --- .../export-text-container.component.js | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/ui/app/components/ui/export-text-container/export-text-container.component.js b/ui/app/components/ui/export-text-container/export-text-container.component.js index 21fd5ecec..23ae0b047 100644 --- a/ui/app/components/ui/export-text-container/export-text-container.component.js +++ b/ui/app/components/ui/export-text-container/export-text-container.component.js @@ -1,6 +1,5 @@ -const { Component } = require('react') +import React, { Component } from 'react' const PropTypes = require('prop-types') -const h = require('react-hyperscript') const copyToClipboard = require('copy-to-clipboard') const { exportAsFile } = require('../../../helpers/utils/util') @@ -10,25 +9,33 @@ class ExportTextContainer extends Component { const { t } = this.context return ( - h('.export-text-container', [ - h('.export-text-container__text-container', [ - h('.export-text-container__text.notranslate', text), - ]), - h('.export-text-container__buttons-container', [ - h('.export-text-container__button.export-text-container__button--copy', { - onClick: () => copyToClipboard(text), - }, [ - h('img', { src: 'images/copy-to-clipboard.svg' }), - h('.export-text-container__button-text', t('copyToClipboard')), - ]), - h('.export-text-container__button', { - onClick: () => exportAsFile(filename, text), - }, [ - h('img', { src: 'images/download.svg' }), - h('.export-text-container__button-text', t('saveAsCsvFile')), - ]), - ]), - ]) +
+
+
+ {text} +
+
+
+
copyToClipboard(text)} + > + +
+ {t('copyToClipboard')} +
+
+
exportAsFile(filename, text)} + > + +
+ {t('saveAsCsvFile')} +
+
+
+
) } }