generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change(header): added homepage and homepage_inverse views
- to be set on the homepage in order to get header menu to turn white when using the inverse option
- Loading branch information
1 parent
9deae59
commit 6df68d7
Showing
4 changed files
with
132 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Document view component. | ||
* @module components/theme/View/HomePageInverseView | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { DefaultView } from '@plone/volto/components/'; | ||
|
||
import { BodyClass } from '@plone/volto/helpers'; | ||
|
||
import { hasBlocksData } from '@plone/volto/helpers'; | ||
|
||
/** | ||
* Component to display the default view. | ||
* @function HomePageInverseView | ||
* @param {Object} content Content object. | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const HomePageInverseView = ({ content }) => { | ||
return hasBlocksData(content) ? ( | ||
<> | ||
<BodyClass className="homepage homepage-inverse" /> | ||
<DefaultView content={content} /> | ||
</> | ||
) : null; | ||
}; | ||
|
||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
HomePageInverseView.propTypes = { | ||
/** | ||
* Content of the object | ||
*/ | ||
content: PropTypes.shape({ | ||
/** | ||
* Title of the object | ||
*/ | ||
title: PropTypes.string, | ||
/** | ||
* Description of the object | ||
*/ | ||
description: PropTypes.string, | ||
/** | ||
* Text of the object | ||
*/ | ||
text: PropTypes.shape({ | ||
/** | ||
* Data of the text of the object | ||
*/ | ||
data: PropTypes.string, | ||
}), | ||
}).isRequired, | ||
}; | ||
|
||
export default HomePageInverseView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Document view component. | ||
* @module components/theme/View/HomePageView | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { DefaultView } from '@plone/volto/components/'; | ||
|
||
import { BodyClass } from '@plone/volto/helpers'; | ||
|
||
import { hasBlocksData } from '@plone/volto/helpers'; | ||
|
||
/** | ||
* Component to display the default view. | ||
* @function HomePageView | ||
* @param {Object} content Content object. | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const HomePageView = ({ content }) => { | ||
return hasBlocksData(content) ? ( | ||
<> | ||
<BodyClass className="homepage" /> | ||
<DefaultView content={content} /> | ||
</> | ||
) : null; | ||
}; | ||
|
||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
HomePageView.propTypes = { | ||
/** | ||
* Content of the object | ||
*/ | ||
content: PropTypes.shape({ | ||
/** | ||
* Title of the object | ||
*/ | ||
title: PropTypes.string, | ||
/** | ||
* Description of the object | ||
*/ | ||
description: PropTypes.string, | ||
/** | ||
* Text of the object | ||
*/ | ||
text: PropTypes.shape({ | ||
/** | ||
* Data of the text of the object | ||
*/ | ||
data: PropTypes.string, | ||
}), | ||
}).isRequired, | ||
}; | ||
|
||
export default HomePageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters