From a99b4e55ba9952c2c77d9f1e64821d7255238f84 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 1 Jul 2021 15:58:45 +0300 Subject: [PATCH] changed from csv download button to csv link --- src/components/UserData/UserData.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/UserData/UserData.jsx b/src/components/UserData/UserData.jsx index b8b934d..cbe648d 100644 --- a/src/components/UserData/UserData.jsx +++ b/src/components/UserData/UserData.jsx @@ -1,8 +1,8 @@ -/* eslint-disable camelcase,sort-keys */ +/* eslint-disable */ import React, { useState } from 'react'; import { Button, Grid, Icon, Container } from 'semantic-ui-react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { CSVDownload } from 'react-csv'; +import { CSVDownload, CSVLink } from 'react-csv'; import PropTypes from 'prop-types'; import moment from 'moment'; import pdfMake from 'pdfmake/build/pdfmake'; @@ -23,7 +23,7 @@ const UserData = ({ domains, isTech }) => { const hasDomains = !!Object.keys(domains).length; const [isLoadingCSV, setIsLoadingCSV] = useState(false); const [isLoadingPDF, setIsLoadingPDF] = useState(false); - const [userCSV, setUserCSV] = useState(null); + const [userCSV, setUserCSV] = useState(''); const { formatMessage } = useIntl(); const savePDF = () => { @@ -459,8 +459,8 @@ const UserData = ({ domains, isTech }) => { }; }); - setIsLoadingCSV(false); setUserCSV(csv); + setIsLoadingCSV(false); }; return ( @@ -483,8 +483,10 @@ const UserData = ({ domains, isTech }) => { CSV - - {userCSV && }