feat: add prerendering support and improve component imports
- Introduced a new PrerenderHome component for development testing. - Updated App.js to conditionally render the PrerenderHome based on the route. - Refactored several components to use ES6 import/export syntax for consistency. - Enhanced AppContent to manage dynamic theming and added a development-only FAB for prerender testing. - Minor adjustments to props in PrerenderCategory for clarity.
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
const React = require('react');
|
||||
const {
|
||||
Container,
|
||||
Typography,
|
||||
Card,
|
||||
CardMedia,
|
||||
Grid,
|
||||
import React from 'react';
|
||||
import {
|
||||
Container,
|
||||
Typography,
|
||||
Box,
|
||||
Chip,
|
||||
Stack,
|
||||
AppBar,
|
||||
Toolbar,
|
||||
Button
|
||||
} = require('@mui/material');
|
||||
const Footer = require('./components/Footer.js').default;
|
||||
const { Logo } = require('./components/header/index.js');
|
||||
const ProductImage = require('./components/ProductImage.js').default;
|
||||
} from '@mui/material';
|
||||
import Footer from './components/Footer.js';
|
||||
import { Logo } from './components/header/index.js';
|
||||
import ProductImage from './components/ProductImage.js';
|
||||
|
||||
// Utility function to clean product names by removing trailing number in parentheses
|
||||
const cleanProductName = (name) => {
|
||||
@@ -46,9 +43,6 @@ class PrerenderProduct extends React.Component {
|
||||
|
||||
const product = productData.product;
|
||||
const attributes = productData.attributes || [];
|
||||
const mainImage = product.pictureList && product.pictureList.trim()
|
||||
? `/assets/images/prod${product.pictureList.split(',')[0].trim()}.jpg`
|
||||
: '/assets/images/nopicture.jpg';
|
||||
|
||||
// Format price with tax
|
||||
const priceWithTax = new Intl.NumberFormat("de-DE", {
|
||||
@@ -563,4 +557,4 @@ class PrerenderProduct extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { default: PrerenderProduct };
|
||||
export default PrerenderProduct;
|
||||
Reference in New Issue
Block a user