Skip to content

Commit

Permalink
fix: added condition for show the modified date
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagner3UB committed Sep 3, 2024
1 parent 3676de7 commit 9986ef2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const BandoApprofondimenti = ({ content }) => {
description={item.description}
download_url={item.url}
item={item}
showModified={true}
/>
// item={item} viene utilizzato nelle customizzazioni per ottenere altre proprietà
);
Expand Down
17 changes: 16 additions & 1 deletion src/components/ItaliaTheme/View/Commons/Attachment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ const messages = defineMessages({
},
});

const Attachment = ({ title, description, download_url, item }) => {
const Attachment = ({
title,
description,
download_url,
item,
showModified = false,
}) => {
const intl = useIntl();
return (
<Card
Expand All @@ -40,10 +46,19 @@ const Attachment = ({ title, description, download_url, item }) => {
</CardTitle>
{description && <p>{description}</p>}

<<<<<<< Updated upstream
{item?.modified && <p>
{intl.formatMessage(messages.last_update)}{' '}
{viewDate(intl.locale, item?.modified, 'DD-MM-Y HH:MM')}
</p>}
=======
{showModified && (
<p>
{intl.formatMessage(messages.last_update)}{' '}
{viewDate(intl.locale, item?.modified, 'DD-MM-Y HH:MM')}
</p>
)}
>>>>>>> Stashed changes
</CardBody>
</Card>
);
Expand Down

0 comments on commit 9986ef2

Please sign in to comment.