Skip to content

Commit

Permalink
Exercicios 34 e 35: Componentes Gestor e Footer
Browse files Browse the repository at this point in the history
samoel-silva committed Sep 18, 2024
1 parent f3143c9 commit 80a6a8c
Showing 7 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { Container } from '@plone/components';
import Info from './Info';

/**
* Component to display the footer.
* @function Footer
* @returns {string} Markup of the component
*/
const Footer = () => {
return (
<footer id="footer">
<Container className="footer">
<Info />
<Container className="dados">Olá, pessoal!!</Container>
</Container>
</footer>
);
};

export default Footer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { Container } from '@plone/components';
import Contato from '../Contato/Contato';
import Endereco from '../Endereco/Endereco';

const Info = (props) => {
const navRoot = useSelector((state) => state.navroot?.data?.navroot);
return (
<Container className={'footer-info'}>
{navRoot && (
<>
<Endereco content={navRoot} />
<Contato content={navRoot} />
</>
)}
</Container>
);
};

export default Info;
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import PropTypes from 'prop-types';

Check warning on line 2 in frontend/packages/volto-portal-governo/src/components/Gestor/Gestor.jsx

GitHub Actions / code-analysis

'PropTypes' is defined but never used
import { Container } from '@plone/components';

const Gestor = (props) => {
const gestor = props.content.gestor;
return (
<Container narrow className={'gestor-wrapper'}>
<h2>GESTOR</h2>
{gestor && (
<>
{gestor.image_scales?.image && (
<Container className={'image'}>
<img

Check failure on line 14 in frontend/packages/volto-portal-governo/src/components/Gestor/Gestor.jsx

GitHub Actions / code-analysis

img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
src={`${gestor['@id']}/${gestor.image_scales.image[0].download}`}
/>
</Container>
)}

<Container className="gestor-cargo">
<h3 className={`gestor-nome}`}>{gestor.title}</h3>
</Container>

{gestor.description && (
<Container className="gestor-biografia">
<span>{gestor.description}</span>
</Container>
)}

{gestor.cargo && (
<Container className="gestor-cargo">
<span>Cargo</span>: <span>{gestor.cargo.title}</span>
</Container>
)}
</>
)}
</Container>
);
};

export default Gestor;
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import { getBaseUrl } from '@plone/volto/helpers';
import { Container } from '@plone/components';
import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
import Endereco from '../Endereco/Endereco';
import Gestor from '../Gestor/Gestor';

const SecretariaView = (props) => {
const { content, location } = props;
@@ -14,6 +15,10 @@ const SecretariaView = (props) => {
return (
<Container id="page-document" className="view-wrapper secretaria-view">
<RenderBlocks {...props} path={path} />

<Gestor content={content} />

<h2>Endereço/Contato</h2>
<Container className="contato">
<Container className="telefone">
<span>Telefone</span>: <span>{telefone}</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Footer component.
* @module components/theme/Footer/Footer
*/
import { injectIntl } from 'react-intl';
import LocalFooter from '../../../../../components/Footer/Footer';

const Footer = () => {
return <LocalFooter />;
};

export default injectIntl(Footer);
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@
// it is injected
@import 'root';
@import 'secretaria';
@import 'components/footer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#footer {
.footer {
.footer-wrapper {
display: flex;
justify-content: space-between;
margin: 0 150px;
gap: 25px;
> div {
min-width: 33%;
}
.footer-info {
text-align: left;
}
}
}
}

0 comments on commit 80a6a8c

Please sign in to comment.