feat(navigation): enhance article category handling and product navigation
- Introduce state management for article categories in App component to track active categories. - Implement logic to clear article category state when navigating away from article pages. - Update Product component to navigate to article pages with associated category information in the state. - Modify Header and CategoryList components to accommodate new category handling logic. - Ensure ProductCarousel and ProductDetailPage components receive and utilize category IDs for improved product organization.
This commit is contained in:
@@ -91,7 +91,7 @@ class Header extends Component {
|
||||
</Box>
|
||||
</Container>
|
||||
</Toolbar>
|
||||
{(isHomePage || this.props.categoryId || isProfilePage || isAktionenPage || isFilialePage) && <CategoryList categoryId={209} activeCategoryId={this.props.categoryId}/>}
|
||||
{(isHomePage || this.props.categoryId || isProfilePage || isAktionenPage || isFilialePage || this.props.isArtikel) && <CategoryList categoryId={209} activeCategoryId={this.props.categoryId}/>}
|
||||
</AppBar>
|
||||
);
|
||||
}
|
||||
@@ -104,10 +104,11 @@ const HeaderWithContext = (props) => {
|
||||
const isProfilePage = location.pathname === '/profile';
|
||||
const isAktionenPage = location.pathname === '/aktionen';
|
||||
const isFilialePage = location.pathname === '/filiale';
|
||||
|
||||
const isArtikel = location.pathname.startsWith('/Artikel/');
|
||||
|
||||
return (
|
||||
|
||||
<Header {...props} isHomePage={isHomePage} isProfilePage={isProfilePage} isAktionenPage={isAktionenPage} isFilialePage={isFilialePage} />
|
||||
<Header {...props} isHomePage={isHomePage} isArtikel={isArtikel} isProfilePage={isProfilePage} isAktionenPage={isAktionenPage} isFilialePage={isFilialePage} />
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user