-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Show success message when observations export finishes (#622)
- Loading branch information
Showing
8 changed files
with
274 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/renderer/components/MapFilter/DataExportDialog/Content.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react' | ||
|
||
import { ExportDetailsForm } from './ExportDetailsForm' | ||
import { ExportSuccessful } from './ExportSuccessful' | ||
import { NoData } from './NoData' | ||
|
||
export const Content = ({ | ||
allObservations, | ||
filteredObservations, | ||
getMediaUrl, | ||
onClose | ||
}) => { | ||
const [showExportSuccess, setShowExportSuccess] = React.useState(false) | ||
|
||
const noData = allObservations.length === 0 | ||
|
||
return noData ? ( | ||
<NoData onClose={onClose} /> | ||
) : showExportSuccess ? ( | ||
<ExportSuccessful onClose={onClose} /> | ||
) : ( | ||
<ExportDetailsForm | ||
allObservations={allObservations} | ||
filteredObservations={filteredObservations} | ||
getMediaUrl={getMediaUrl} | ||
onClose={onClose} | ||
onSuccess={() => setShowExportSuccess(true)} | ||
/> | ||
) | ||
} |
Oops, something went wrong.