Skip to content

Commit

Permalink
refactor(Banner.jsx): use flattenToAppURL helper function to get imag…
Browse files Browse the repository at this point in the history
…e source URL
  • Loading branch information
razvanMiu committed Mar 29, 2023
1 parent 34154d2 commit 24b13d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/Banner/Banner.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Container, Icon, Button, Grid } from 'semantic-ui-react';
import PropTypes from 'prop-types';
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
import { formatDate } from '@plone/volto/helpers/Utils/Date';
import config from '@plone/volto/registry';

Expand All @@ -25,7 +26,7 @@ const socialPlatforms = {
};

export const getImageSource = (image) => {
if (image?.scales?.huge) return image.scales.huge.download;
if (image?.scales?.huge) return flattenToAppURL(image.scales.huge.download);
return null;
};

Expand Down

0 comments on commit 24b13d7

Please sign in to comment.