diff --git a/frontend/packages/volto-portal-governo/src/components/Views/SecretariaView.jsx b/frontend/packages/volto-portal-governo/src/components/Views/SecretariaView.jsx new file mode 100644 index 0000000..956c23a --- /dev/null +++ b/frontend/packages/volto-portal-governo/src/components/Views/SecretariaView.jsx @@ -0,0 +1,41 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { getBaseUrl } from '@plone/volto/helpers'; +import { Container } from '@plone/components'; +import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; + +const SecretariaView = (props) => { + const { content, location } = props; + const { telefone, email } = content; + const path = getBaseUrl(location?.pathname || ''); + + return ( + + + + + Telefone: {telefone} + + + E-mail: {email} + + + + ); +}; + +/** + * Property types. + * @property {Object} propTypes Property types. + * @static + */ +SecretariaView.propTypes = { + content: PropTypes.shape({ + title: PropTypes.string, + description: PropTypes.string, + email: PropTypes.string, + telefone: PropTypes.string, + }).isRequired, +}; + +export default SecretariaView; diff --git a/frontend/packages/volto-portal-governo/src/index.js b/frontend/packages/volto-portal-governo/src/index.js index bbfab8b..8300582 100644 --- a/frontend/packages/volto-portal-governo/src/index.js +++ b/frontend/packages/volto-portal-governo/src/index.js @@ -1,3 +1,6 @@ +// Views +import SecretariaView from './components/Views/SecretariaView'; + const applyConfig = (config) => { config.settings = { ...config.settings, @@ -5,6 +8,11 @@ const applyConfig = (config) => { supportedLanguages: ['pt-br'], defaultLanguage: 'pt-br', }; + // Views + config.views.contentTypesViews = { + ...config.views.contentTypesViews, + Secretaria: SecretariaView, + }; return config; };