Skip to content

Commit

Permalink
fix: using isResourcePage to determine page header
Browse files Browse the repository at this point in the history
  • Loading branch information
gweiying committed Apr 23, 2021
1 parent 994ea16 commit 2aa238b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/layouts/EditPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ const EditPage = ({ match, isResourcePage, isCollectionPage, history, type }) =>
chunk={chunk}
title={title}
date={date}
isResourcePage={isResourcePage}
resourceRoomName={deslugifyDirectory(resourceRoomName)}
collection={resourceName}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/templates/SimplePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import PageHeader from './pageComponents/PageHeader';

// This following template was taken from the 'Simple Page'
const SimplePage = ({ chunk, title, date, collection, resourceRoomName }) => (
const SimplePage = ({ chunk, title, date, collection, isResourcePage, resourceRoomName }) => (
<div>
<PageHeader title={title} date={date} collection={collection} resourceRoomName={resourceRoomName}/>
<PageHeader title={title} date={date} collection={collection} resourceRoomName={resourceRoomName} isResourcePage={isResourcePage}/>
<section className="bp-section">
<div className="bp-container content padding--top--lg padding--bottom--xl">
<div className="row">
Expand Down
4 changes: 2 additions & 2 deletions src/templates/pageComponents/PageHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Breadcrumb from './Breadcrumb';

const PageHeader = ({ title, date, collection, resourceRoomName }) => (
<section className={`bp-section ${resourceRoomName ? 'bg-secondary' : 'is-small bp-section-pagetitle'}`}>
const PageHeader = ({ title, date, collection, resourceRoomName, isResourcePage }) => (
<section className={`bp-section ${isResourcePage ? 'bg-secondary' : 'is-small bp-section-pagetitle'}`}>
<div className="bp-container page-header-container">
<div className="row">
<div className="col">
Expand Down

0 comments on commit 2aa238b

Please sign in to comment.