diff --git a/CHANGELOG.md b/CHANGELOG.md index e493db34..14d57b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Semantic Versioning Changelog +## [2.3.3](https://github.com/pagopa/pagopa-editorial-components/compare/v2.3.2...v2.3.3) (2024-03-05) + + +### Bug Fixes + +* accordion layout fix ([7487d7c](https://github.com/pagopa/pagopa-editorial-components/commit/7487d7c4e9910a6053a56b7203384c02d8e31cb6)) +* bannerlink body html rendering bug fix ([4259686](https://github.com/pagopa/pagopa-editorial-components/commit/42596861e91a225701652e399c861604d649540b)) +* editorial mobile column fix ([733103d](https://github.com/pagopa/pagopa-editorial-components/commit/733103df0dbd442557294fd2ec3e8d8d3cedbbdd)) +* header padding fix ([6970d29](https://github.com/pagopa/pagopa-editorial-components/commit/6970d292e9855f9ad9fa70c1a427f326320254fa)) +* menudropdown border bottom fix ([0edd5b9](https://github.com/pagopa/pagopa-editorial-components/commit/0edd5b99b608492e4349024fcd282c2e470f78bf)) +* stripelink html rendering bug fix ([578be2a](https://github.com/pagopa/pagopa-editorial-components/commit/578be2ac591fbd8bb554059ab2a2a0318524ba58)) + ## [2.3.2](https://github.com/pagopa/pagopa-editorial-components/compare/v2.3.1...v2.3.2) (2024-02-23) diff --git a/package.json b/package.json index 680cd6f4..09fe3b7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pagopa/pagopa-editorial-components", - "version": "2.3.2", + "version": "2.3.3", "author": { "name": "PagoPA" }, diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index 8058c675..5c9f9ef5 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -74,19 +74,20 @@ export const Accordion = (props: AccordionProps) => { )} - - {/** Accordions */} - - {accordionItems.map((accordionItem, i) => ( - - ))} - - + + + {/** Accordions */} + + {accordionItems.map((accordionItem, i) => ( + + ))} + diff --git a/src/components/BannerLink/Content.tsx b/src/components/BannerLink/Content.tsx index 2ada8e9d..cd2e653c 100644 --- a/src/components/BannerLink/Content.tsx +++ b/src/components/BannerLink/Content.tsx @@ -18,7 +18,7 @@ export const Content = ({ title, body, theme }: BannerLinkContentProps) => { {title} - + {body} diff --git a/src/components/Editorial/Editorial.tsx b/src/components/Editorial/Editorial.tsx index 572f8a19..87957bba 100644 --- a/src/components/Editorial/Editorial.tsx +++ b/src/components/Editorial/Editorial.tsx @@ -9,6 +9,7 @@ import { import { Ctas as EditorialCtas, type EditorialCtaProps } from './Ctas'; import { Image as EditorialImage, type EditorialImageProps } from './Image'; import EContainer from '../EContainer'; +import { useEffect, useState } from 'react'; export interface EditorialProps extends CommonProps, @@ -27,12 +28,24 @@ export const Editorial = (props: EditorialProps) => { body, theme, ctaButtons, - reversed, pattern = 'none', width = 'standard', + reversed = false, } = props; const { palette } = useTheme(); + const [isMobile, setIsMobile] = useState(window.innerWidth <= 1024); + + useEffect(() => { + const handleResize = () => { + setIsMobile(window.innerWidth <= 1024); + }; + window.addEventListener('resize', handleResize); + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); + const backgroundColor = theme === 'dark' ? palette.primary.dark : palette.background.paper; @@ -42,24 +55,32 @@ export const Editorial = (props: EditorialProps) => { center: 4, }; + const containerDirection = isMobile + ? reversed + ? 'column-reverse' + : 'column' + : reversed + ? 'row-reverse' + : 'row'; + + const gridItemStyles = + width === 'standard' ? { ...styles.half, ...styles.offset } : styles.half; + return ( - + - + @@ -71,4 +92,8 @@ const styles = { display: 'grid', justifyContent: 'center', }, + offset: { + marginLeft: '8.33%', + paddingRight: '4.15%', + }, }; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 91889f88..830845fe 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -51,7 +51,7 @@ export const Header = (props: HeaderProps) => { > diff --git a/src/components/Header/components/MenuDropdown.tsx b/src/components/Header/components/MenuDropdown.tsx index 72f222e0..c7fc9df2 100644 --- a/src/components/Header/components/MenuDropdown.tsx +++ b/src/components/Header/components/MenuDropdown.tsx @@ -147,7 +147,7 @@ const useStyles = (props: MenuDropdownProp, mui: Theme) => { paddingY: { md: 2 }, borderColor: textColor, borderBottomStyle: 'solid', - borderBottomWidth: { md: props.active ? 2 : 0, xs: 0 }, + borderBottomWidth: { md: props.active ? 3 : 0, xs: 0 }, }, item: { cursor: { diff --git a/src/components/StripeLink.tsx b/src/components/StripeLink.tsx index c5bb33cd..643c2eff 100644 --- a/src/components/StripeLink.tsx +++ b/src/components/StripeLink.tsx @@ -32,7 +32,11 @@ const StripeLink = (props: StripeLinkProps) => { visibility: { md: 'visible', xs: 'hidden' }, }} /> - + {subtitle}