Skip to content

Commit

Permalink
fix(gif): Use ES6 with isImageGif utility - refs #158188
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Dec 12, 2022
1 parent 5c8d78c commit ad32432
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Blocks/Hero/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import cx from 'classnames';
import PropTypes from 'prop-types';
import { isInternalURL } from '@plone/volto/helpers/Url/Url';
import { isImageGif } from '../../../helpers';
import { isImageGif } from '@eeacms/volto-hero-block/helpers';

Hero.propTypes = {
image: PropTypes.string,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const serializeText = (text) => {
};

export const isImageGif = (image) => {
return image.substr(image.length - 4) === '.gif';
return image?.endsWith?.('.gif');
};

0 comments on commit ad32432

Please sign in to comment.