Skip to content

Commit

Permalink
feat: added download link to filename in file widget
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni committed Mar 14, 2024
1 parent 0deb876 commit 648f03a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/volto/src/components/manage/Widgets/FileWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Button, Image, Dimmer } from 'semantic-ui-react';
import { readAsDataURL } from 'promise-file-reader';
import { injectIntl } from 'react-intl';
import deleteSVG from '@plone/volto/icons/delete.svg';
import { Icon, FormFieldWrapper } from '@plone/volto/components';
import { Icon, FormFieldWrapper, UniversalLink } from '@plone/volto/components';
import loadable from '@loadable/component';
import { flattenToAppURL, validateFileUploadSize } from '@plone/volto/helpers';
import { defineMessages, useIntl } from 'react-intl';
Expand Down Expand Up @@ -170,7 +170,11 @@ const FileWidget = (props) => {
)}
</Dropzone>
<div className="field-file-name">
{value && value.filename}
{value && (
<UniversalLink href={value.download} download={true}>
{value.filename}
</UniversalLink>
)}
{value && (
<Button
icon
Expand Down

0 comments on commit 648f03a

Please sign in to comment.