feat: Refactor Header and CategoryList components to improve category navigation handling and enhance active state management based on pathname
This commit is contained in:
@@ -91,7 +91,9 @@ class Header extends Component {
|
||||
</Box>
|
||||
</Container>
|
||||
</Toolbar>
|
||||
{(isHomePage || this.props.categoryId || isProfilePage || isAktionenPage || isFilialePage || this.props.isArtikel) && <CategoryList categoryId={209} activeCategoryId={this.props.categoryId}/>}
|
||||
{(isHomePage || this.props.categoryId || isProfilePage || isAktionenPage || isFilialePage || this.props.isArtikel) && (
|
||||
<CategoryList categoryId={209} activeCategoryId={this.props.categoryId} pathname={this.props.pathname} />
|
||||
)}
|
||||
</AppBar>
|
||||
);
|
||||
}
|
||||
@@ -107,9 +109,15 @@ const HeaderWithContext = (props) => {
|
||||
const isArtikel = location.pathname.startsWith('/Artikel/');
|
||||
|
||||
return (
|
||||
|
||||
<Header {...props} isHomePage={isHomePage} isArtikel={isArtikel} isProfilePage={isProfilePage} isAktionenPage={isAktionenPage} isFilialePage={isFilialePage} />
|
||||
|
||||
<Header
|
||||
{...props}
|
||||
isHomePage={isHomePage}
|
||||
isArtikel={isArtikel}
|
||||
isProfilePage={isProfilePage}
|
||||
isAktionenPage={isAktionenPage}
|
||||
isFilialePage={isFilialePage}
|
||||
pathname={location.pathname}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user