Skip to content

Commit

Permalink
fix: Improve tablet layout for footer - refs #265857
Browse files Browse the repository at this point in the history
  • Loading branch information
dobri1408 authored Aug 28, 2024
1 parent 2a61ed3 commit 4422ca4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
14 changes: 10 additions & 4 deletions src/ui/Footer/Contact.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';

import cx from 'classnames';
import { isInternalURL } from '@plone/volto/helpers/Url/Url';

const Contact = ({ children, contacts }) =>
children?.length ? (
const Contact = ({ children, contacts }) => {
return children?.length ? (
children
) : (
<div className="contact-wrapper">
<div
className={cx(
'contact-wrapper',
contacts?.length > 5 ? 'many-contacts' : '',
)}
>
{contacts?.map((contact, index) => (
<div className="contact" key={index}>
{isInternalURL(contact.url) ? (
Expand Down Expand Up @@ -50,6 +55,7 @@ const Contact = ({ children, contacts }) =>
))}
</div>
);
};

Contact.propTypes = {
contacts: PropTypes.array,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/Footer/Footer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Template = (args) => (

export const Default = Template.bind({});
Default.args = {
buttonName: 'Explore our Environmental information systems',
buttonName: 'Explore our environmental information systems',
hrefButton: 'https://www.eea.europa.eu/en/information-systems',
description: '',
actions: [
Expand Down
13 changes: 7 additions & 6 deletions src/ui/Footer/SubFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ const SubFooter = (props) => {
</div>
</Grid.Column>
))}

<Grid.Column mobile={12} tablet={12} computer={4}>
<div className="item">
<Footer.Contact contacts={props.contacts} />
</div>
</Grid.Column>
{props.contacts?.length > 0 && (
<Grid.Column mobile={12} tablet={12} computer={4}>
<div className="item">
<Footer.Contact contacts={props.contacts} />
</div>
</Grid.Column>
)}
</Grid>
</div>
);
Expand Down
22 changes: 22 additions & 0 deletions theme/themes/eea/extras/footer.less
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,22 @@ footer .footer-wrapper .menu {
footer .footer-header {
font-size: @tabletFooterTitleFontSize;
}
.contact-wrapper {
display: flex;
padding-top: @tabletContactWrapperPaddingTop;
gap: @tabletContactGap;
}

.contact-wrapper .subcontact {
display: block;
}
.many-contacts {
display: block;
padding-top: 0px;
}
.many-contacts .subcontact {
display: flex;
}
.subfooter .item {
.logo img {
max-height: 100px;
Expand Down Expand Up @@ -256,6 +271,13 @@ footer .footer-wrapper .menu {
}

@media only screen and (min-width: @computerBreakpoint) {
.contact-wrapper {
display: block;
padding-top: 0px;
}
.contact-wrapper .subcontact {
display: flex;
}
footer {
.footer-wrapper {
padding: @computerWrapperPadding;
Expand Down
1 change: 1 addition & 0 deletions theme/themes/eea/extras/footer.variables
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
@tabletContactBlockMarginBottom : @space-4;
@mobileContactMargin : @space-4 0;
@tabletContactMargin : @rem-space-050 0;
@tabletContactWrapperPaddingTop : @rem-space-8;
@contactFontSize : @font-size-2;
@tabletContactFontSize : @font-size-3;
@tabletContactGap : @rem-space-4;
Expand Down

0 comments on commit 4422ca4

Please sign in to comment.