Skip to content

Commit

Permalink
[DEV-1952][DEV-1782] Fix card shadow border and Add margin ecosystem (#…
Browse files Browse the repository at this point in the history
…1158)

* refactor card grid and ecosystem for card shadows

* add changeset

* add padding and margin for mobile version

* add changeset

* move padding for card grinds to parent container

* add mt and pt for shadows

* fix title spacing
  • Loading branch information
MarBert authored Sep 30, 2024
1 parent af68449 commit 86ffbd6
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-icons-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Add padding and margin to mobile version in ecosystem cards
5 changes: 5 additions & 0 deletions .changeset/three-walls-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix ecosystem and card grid for correct card box shadows
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const TabComponent: FC<TabsProps> = ({
<>
<Box
sx={{
borderBottom: 2,
borderColor: 'divider',
display: 'flex',
justifyContent: 'space-around',
marginBottom: 6,
position: 'relative',
top: '2px',
Expand All @@ -67,10 +67,23 @@ export const TabComponent: FC<TabsProps> = ({
onChange={(event, newValue: number) => {
setCurrentTab(newValue);
}}
sx={{ position: 'relative', top: '2px' }}
sx={{
flexGrow: '1',
position: 'relative',
top: '2px',
maxWidth: '1200px',
}}
>
{items.map((item, index) => (
<Tab key={index} label={item.title} />
<Tab
key={index}
label={item.title}
sx={{
maxWidth: '600px',
borderBottom: 2,
borderColor: 'divider',
}}
/>
))}
</Tabs>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use client';
import React from 'react';
import { Box, Typography, useTheme } from '@mui/material';
import { Box, useTheme } from '@mui/material';
import TabComponent from '@/components/atoms/TabComponent/TabComponent';
import CardsGrid from '@/components/molecules/CardsGrid/CardsGrid';
import { ButtonNaked } from '@pagopa/mui-italia';
import Link from 'next/link';
import { HomepageProps } from '@/app/page';
import SectionTitle from '@/components/molecules/SectionTitle/SectionTitle';

const Ecosystem = ({
title,
Expand All @@ -18,12 +19,14 @@ const Ecosystem = ({
const theme = useTheme();
return (
<Box pt={10} pb={0} sx={{ backgroundColor: theme.palette.grey[50] }}>
<Box sx={{ maxWidth: '1200px', margin: 'auto' }}>
{title && (
<Typography variant='h4' sx={{ mb: 4, width: '100%' }}>
{title}
</Typography>
)}
{title && <SectionTitle margin={'0 0 1.75rem 0'} title={title} />}
<Box
sx={{
maxWidth: '1264px',
margin: 'auto',
paddingX: 4,
}}
>
<TabComponent
items={[
{
Expand All @@ -32,7 +35,12 @@ const Ecosystem = ({
<CardsGrid
ctaButtonsVariant={'contained'}
cards={products}
containerSx={{ px: 0, pb: '22px' }}
containerSx={{
px: '22px',
py: '22px',
mt: '-22px',
mx: '-22px',
}}
/>
),
},
Expand All @@ -44,7 +52,12 @@ const Ecosystem = ({
<CardsGrid
ctaButtonsVariant={'contained'}
cards={solutions}
containerSx={{ px: 0, pb: '22px' }}
containerSx={{
px: '22px',
py: '22px',
mt: '-22px',
mx: '-22px',
}}
/>
)}
{solutionsCta && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const SolutionsShowcase = ({
tags: card.tags,
useSrc: true,
}))}
containerSx={{
pt: '22px',
mt: '-22px',
}}
/>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const StartInfo = ({
iconColor: card.iconColor,
useSrc: card.useSrc,
}))}
containerSx={{
pt: '22px',
mt: '-22px',
}}
/>
</Box>
{cta && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const ApiDataListTemplate = ({
ctaLabel: t('apiDataListPage.explore'),
}))}
cardSize={{ xs: 12, md: 4 }}
containerSx={{
pt: '22px',
mt: '-22px',
}}
/>
</Box>
<BannerLinks bannerLinks={bannerLinks} />
Expand Down

0 comments on commit 86ffbd6

Please sign in to comment.