Skip to content

Commit

Permalink
Merge pull request #20 from appbaseio/fix-placeholder-img
Browse files Browse the repository at this point in the history
fix: placeholder image
  • Loading branch information
siddharthlatest authored Feb 21, 2023
2 parents 06954f9 + 2a157a8 commit 848394a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/components/ResultsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import createDOMPurify from 'dompurify';
import { mediaMax } from '../utils/media';
import LayoutSwitch from './LayoutSwitch';
import { defaultPreferences } from '../utils';
import placeholderImg from '../images/placeholder.png';

const DOMPurify = createDOMPurify(window);

Expand Down Expand Up @@ -329,17 +330,14 @@ function ResultsLayout({
<div className="card-image-container">
<img
className="product-image"
src={
image ||
'https://www.houseoftara.com/shop/wp-content/uploads/2019/05/placeholder.jpg'
}
src={image || placeholderImg}
height="100%"
width="100%"
alt={title}
onError={(event) => {
// eslint-disable-next-line
event.target.src =
'https://www.houseoftara.com/shop/wp-content/uploads/2019/05/placeholder.jpg'; // eslint-disable-line
placeholderImg; // eslint-disable-line
}}
/>
</div>
Expand Down Expand Up @@ -552,16 +550,15 @@ function ResultsLayout({
<img
className="product-image"
src={
image ||
'https://www.houseoftara.com/shop/wp-content/uploads/2019/05/placeholder.jpg'
image || placeholderImg
}
height="100%"
width="100%"
alt={title}
onError={(event) => {
// eslint-disable-next-line
event.target.src =
'https://www.houseoftara.com/shop/wp-content/uploads/2019/05/placeholder.jpg'; // eslint-disable-line
placeholderImg; // eslint-disable-line
}}
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Suggestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import get from 'lodash.get';
import Highlight from 'react-highlight-words';
import createDOMPurify from 'dompurify';
import { shopifyDefaultFields } from '../utils';
import placeholderImg from '../images/placeholder.png'

const DOMPurify = createDOMPurify(window);

Expand Down Expand Up @@ -70,7 +71,7 @@ const Suggestion = ({
<img
src={
image ||
'https://www.houseoftara.com/shop/wp-content/uploads/2019/05/placeholder.jpg'
placeholderImg
}
alt="suggestion"
width="40px"
Expand Down
Binary file added src/images/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 848394a

@vercel
Copy link

@vercel vercel bot commented on 848394a Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.