Skip to content

Commit

Permalink
Download button inside documents editor (#287)
Browse files Browse the repository at this point in the history
* download button

* download button
  • Loading branch information
luorlandini authored Jul 1, 2021
1 parent 8c84684 commit d541a4b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions geonode_mapstore_client/client/js/components/home/DetailsPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ function DetailsPanel({
} = resource && (types[resource.doc_type] || types[resource.resource_type]) || {};
const embedUrl = resource?.embed_url && formatEmbedUrl(resource);
const detailUrl = resource?.pk && formatDetailUrl(resource);
const documentDownloadUrl = (resource?.href && resource?.href.includes('download')) ? resource?.href : undefined;

return (
<div
ref={detailsContainerNode}
Expand Down Expand Up @@ -250,7 +252,11 @@ function DetailsPanel({
<FaIcon stylePrefix={favorite ? `fa` : `far`} name="star" />
</Button>
}

{documentDownloadUrl &&
<Button variant="default"
href={documentDownloadUrl} >
<FaIcon name="download" />
</Button>}

{detailUrl && <CopyToClipboard
tooltipPosition="top"
Expand All @@ -266,7 +272,8 @@ function DetailsPanel({
onClick={handleCopyPermalink}>
<FaIcon name="share-alt" />
</Button>
</CopyToClipboard>}
</CopyToClipboard>
}
{detailUrl && !editThumbnail && <Button
variant="default"
href={detailUrl}
Expand Down Expand Up @@ -316,6 +323,7 @@ function DetailsPanel({
})}>{resource.category.identifier}</a>
</div>}
</p>

</div>
</section>
</div>
Expand Down

0 comments on commit d541a4b

Please sign in to comment.