-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spacing fixes for sections and views (#65)
- Loading branch information
1 parent
0cc2777
commit 859b1e7
Showing
9 changed files
with
631 additions
and
34 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 |
---|---|---|
@@ -1,5 +1,14 @@ | ||
export const updateSettingsConfig = (config) => { | ||
config.settings.navDepth = 2; | ||
|
||
config.settings.fullWidthBlockTypes = [ | ||
'hero', | ||
'nsw_section', | ||
'nsw_inPageAlert', | ||
'nsw_announcementBar', | ||
'form', | ||
...(config.settings.fullWidthBlockTypes || []), | ||
]; | ||
}; | ||
|
||
export default updateSettingsConfig; |
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
121 changes: 121 additions & 0 deletions
121
src/customizations/volto/components/theme/View/EventView.jsx
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,121 @@ | ||
/** | ||
* EventView view component. | ||
* @module components/theme/View/EventView | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { hasBlocksData, flattenHTMLToAppURL } from '@plone/volto/helpers'; | ||
import { Image, Grid } from 'semantic-ui-react'; | ||
import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; | ||
import { EventDetails } from '@plone/volto/components'; | ||
|
||
const EventTextfieldView = ({ content }) => ( | ||
<React.Fragment> | ||
{content.title && <h1 className="documentFirstHeading">{content.title}</h1>} | ||
{content.description && ( | ||
<p className="documentDescription">{content.description}</p> | ||
)} | ||
{content.image && ( | ||
<Image | ||
className="document-image" | ||
src={content.image.scales.thumb.download} | ||
floated="right" | ||
/> | ||
)} | ||
{content.text && ( | ||
<div | ||
dangerouslySetInnerHTML={{ | ||
__html: flattenHTMLToAppURL(content.text.data), | ||
}} | ||
/> | ||
)} | ||
</React.Fragment> | ||
); | ||
|
||
/** | ||
* EventView view component class. | ||
* @function EventView | ||
* @params {object} content Content object. | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const EventView = (props) => { | ||
const { content } = props; | ||
|
||
return ( | ||
<div id="page-document" className="view-wrapper event-view nsw-container"> | ||
<div className="nsw-layout"> | ||
<div className="nsw-layout__main"> | ||
<Grid> | ||
<Grid.Column width={7} className="mobile hidden"> | ||
{hasBlocksData(content) ? ( | ||
<RenderBlocks {...props} /> | ||
) : ( | ||
<EventTextfieldView {...props} /> | ||
)} | ||
</Grid.Column> | ||
<Grid.Column width={5} className="mobile hidden"> | ||
<EventDetails content={content} /> | ||
</Grid.Column> | ||
<Grid.Column width={12} only="mobile"> | ||
{hasBlocksData(content) ? ( | ||
<> | ||
<RenderBlocks | ||
{...props} | ||
content={{ | ||
...content, | ||
blocks_layout: { | ||
items: props.content.blocks_layout.items.slice(0, 1), | ||
}, | ||
}} | ||
/> | ||
<EventDetails content={content} display_as="div" /> | ||
<RenderBlocks | ||
{...props} | ||
content={{ | ||
...content, | ||
blocks_layout: { | ||
items: props.content.blocks_layout.items.slice(1), | ||
}, | ||
}} | ||
/> | ||
</> | ||
) : ( | ||
<EventTextfieldView {...props} /> | ||
)} | ||
</Grid.Column> | ||
</Grid> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
EventView.propTypes = { | ||
content: PropTypes.shape({ | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
text: PropTypes.shape({ | ||
data: PropTypes.string, | ||
}), | ||
attendees: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
contact_email: PropTypes.string, | ||
contact_name: PropTypes.string, | ||
contact_phone: PropTypes.string, | ||
end: PropTypes.string.isRequired, | ||
event_url: PropTypes.string, | ||
location: PropTypes.string, | ||
open_end: PropTypes.bool, | ||
recurrence: PropTypes.any, | ||
start: PropTypes.string.isRequired, | ||
subjects: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
whole_day: PropTypes.bool, | ||
}).isRequired, | ||
}; | ||
|
||
export default EventView; |
Oops, something went wrong.