feat: store product image URL in window object for improved accessibility in image handling
This commit is contained in:
@@ -48,6 +48,11 @@ const generateProductMetaTags = (product, baseUrl, config) => {
|
||||
<!-- Additional Meta Tags -->
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="canonical" href="${productUrl}">
|
||||
|
||||
<!-- Store image URL in window object -->
|
||||
<script>
|
||||
window.productImageUrl = "${imageUrl}";
|
||||
</script>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class Images extends Component {
|
||||
|
||||
for(const bildId of bildIds){
|
||||
if(bildId == mainPicId){
|
||||
if(window.productImageUrl) continue;
|
||||
|
||||
if(window.largePicCache[bildId]){
|
||||
pics.push(window.largePicCache[bildId]);
|
||||
|
||||
@@ -5,8 +5,6 @@ import Images from './Images.js';
|
||||
|
||||
const ProductImage = ({
|
||||
product,
|
||||
socket,
|
||||
socketB,
|
||||
fullscreenOpen,
|
||||
onOpenFullscreen,
|
||||
onCloseFullscreen
|
||||
@@ -44,8 +42,6 @@ const ProductImage = ({
|
||||
)}
|
||||
{product.pictureList && (
|
||||
<Images
|
||||
socket={socket}
|
||||
socketB={socketB}
|
||||
pictureList={product.pictureList}
|
||||
productName={product.name}
|
||||
fullscreenOpen={fullscreenOpen}
|
||||
|
||||
Reference in New Issue
Block a user