Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fix Header missing prop in AppHeader.jsx ( catalogue)
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Dec 8, 2021
1 parent 791c6b0 commit 15d8896
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/components/theme/CatalogueViews/AppHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,49 @@ class App extends Component {
render() {
const path = getBaseUrl(this.props.pathname);
const action = getView(this.props.pathname);
const leadImageCaption =
this.props.content?.lead_image_caption &&
this.props.content.lead_image_caption !== null
? this.props.content.lead_image_caption
: '';

const bigLeading =
this.props.content?.big_leading_image &&
this.props.content.big_leading_image !== null
? this.props.content.big_leading_image
: false;

const inheritLeadingData =
this.props.content?.inherit_leading_data &&
this.props.content.inherit_leading_data !== null
? this.props.content.inherit_leading_data
: false;

const leadNavigation =
this.props.content?.lead_navigation &&
this.props.content.lead_navigation !== null
? this.props.content.lead_navigation
: false;

const headerImage =
this.props.content?.image?.download || this.props.defaultHeaderImage;

const extraHeaderData = {
bigLeading,
inheritLeadingData,
parentData: this.props.content?.parent,
leadNavigation,
leadImageCaption,
};

return (
<Fragment>
<BodyClass className={`view-${action}view`} />
<Header
folderHeader={this.props.folderHeader}
actualPathName={this.props.pathname}
pathname={path}
extraData={extraHeaderData}
defaultHeaderImage={headerImage}
navigationItems={this.props.navigation}
frontpage_slides={this.props.frontpage_slides}
Expand Down Expand Up @@ -192,7 +226,7 @@ export default compose(
folderHeader: state.folder_header.items,
defaultHeaderImage: state.default_header_image.items?.[0],
// content: state.content.data,
content: state.prefetch?.[props.location.pathname] || state.content.data,
content: state.content.data,
frontpage_slides: state.frontpage_slides.items,
navigation: state.navigation.items,
pathname: state.router.location.pathname, //props.location.pathname,
Expand Down

0 comments on commit 15d8896

Please sign in to comment.