From a590409ae295cd7f1c0ce309ea37ae1c7cca5176 Mon Sep 17 00:00:00 2001 From: Bharat Kalluri Date: Thu, 25 Mar 2021 20:25:52 +0530 Subject: [PATCH] Use intl from prop instead of passing it as a argument --- webapp/src/components/viewHeader.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/viewHeader.tsx b/webapp/src/components/viewHeader.tsx index e3294e45e..b1a0e53be 100644 --- a/webapp/src/components/viewHeader.tsx +++ b/webapp/src/components/viewHeader.tsx @@ -69,16 +69,16 @@ class ViewHeader extends React.Component { } } - onExportCsvTrigger(boardTree: BoardTree, intl: IntlShape) { + onExportCsvTrigger(boardTree: BoardTree) { try { CsvExporter.exportTableCsv(boardTree) - const exportCompleteMessage = intl.formatMessage({ + const exportCompleteMessage = this.props.intl.formatMessage({ id: 'ViewHeader.export-complete', defaultMessage: 'Export complete!', }) sendFlashMessage({content: exportCompleteMessage, severity: 'normal'}) } catch (e) { - const exportFailedMessage = intl.formatMessage({ + const exportFailedMessage = this.props.intl.formatMessage({ id: 'ViewHeader.export-failed', defaultMessage: 'Export failed!', }) @@ -315,7 +315,7 @@ class ViewHeader extends React.Component { this.onExportCsvTrigger(boardTree, intl)} + onClick={() => this.onExportCsvTrigger(boardTree)} /> {/*