generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change(columns): implement narrow, container and wide width classes
- we can apply any of the defined widths this way starting from the layout view until we have extra classes
- Loading branch information
1 parent
9846159
commit 9696b54
Showing
4 changed files
with
75 additions
and
3 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
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/WideView | ||
*/ | ||
|
||
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 WideView | ||
* @param {Object} content Content object. | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const WideView = ({ content }) => { | ||
return hasBlocksData(content) ? ( | ||
<> | ||
<BodyClass className="wide-view" /> | ||
<DefaultView content={content} /> | ||
</> | ||
) : null; | ||
}; | ||
|
||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
WideView.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 WideView; |
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