-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Media section, add ui updated on Homepage (#1473)
Co-authored-by: ani-kalpachka <[email protected]>
- Loading branch information
1 parent
7b511f9
commit e7b615a
Showing
12 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/components/client/index/sections/MediaSection/MediaCarouselSettings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Settings } from 'react-slick' | ||
|
||
export const settings: Settings = { | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 5, | ||
slidesToScroll: 1, | ||
arrows: false, | ||
dots: true, | ||
lazyLoad: 'ondemand', | ||
autoplay: true, | ||
autoplaySpeed: 2000, | ||
|
||
responsive: [ | ||
{ | ||
breakpoint: 1000, | ||
settings: { | ||
slidesToShow: 4, | ||
}, | ||
}, | ||
{ | ||
breakpoint: 900, | ||
settings: { | ||
slidesToShow: 3, | ||
}, | ||
}, | ||
{ | ||
breakpoint: 700, | ||
settings: { | ||
slidesToShow: 2, | ||
}, | ||
}, | ||
{ | ||
breakpoint: 400, | ||
settings: { | ||
slidesToShow: 1, | ||
}, | ||
}, | ||
], | ||
} |
43 changes: 43 additions & 0 deletions
43
src/components/client/index/sections/MediaSection/MediaSection.styled.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import theme from 'common/theme' | ||
import Link from 'components/common/Link' | ||
import Slider from 'react-slick' | ||
|
||
import { styled } from '@mui/material/styles' | ||
|
||
export const Root = styled('section')(() => ({ | ||
backgroundColor: '#EAF4FC', | ||
padding: theme.spacing(10, 0, 15), | ||
})) | ||
|
||
export const CarouselWrapper = styled(Slider)(() => ({ | ||
display: 'contents', | ||
|
||
'.slick-list': { | ||
paddingBottom: theme.spacing(3), | ||
}, | ||
|
||
'.slick-dots li button::before': { | ||
fontSize: theme.typography.pxToRem(10), | ||
color: '#D9D9D9', | ||
opacity: 1, | ||
}, | ||
|
||
'.slick-dots li.slick-active button::before': { | ||
fontSize: theme.typography.pxToRem(10), | ||
color: '#B0E5FF', | ||
opacity: 1, | ||
}, | ||
|
||
[theme.breakpoints.up(2000)]: { | ||
maxWidth: theme.spacing(165), | ||
margin: `0 auto ${theme.spacing(4)} auto`, | ||
}, | ||
})) | ||
|
||
export const ArticleLink = styled(Link)(() => ({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
background: theme.palette.background.default, | ||
boxShadow: | ||
'0px 1px 8px 0px rgba(0, 0, 0, 0.12), 0px 3px 4px 0px rgba(0, 0, 0, 0.14), 0px 3px 3px -2px rgba(0, 0, 0, 0.20)', | ||
})) |
35 changes: 35 additions & 0 deletions
35
src/components/client/index/sections/MediaSection/MediaSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useTranslation } from 'next-i18next' | ||
|
||
import { CardMedia } from '@mui/material' | ||
|
||
import { articles } from 'components/admin/partners/helpers/mediaAboutUsData' | ||
import theme from 'common/theme' | ||
import { settings } from './MediaCarouselSettings' | ||
|
||
import { Heading } from '../../IndexPage.styled' | ||
import { ArticleLink, CarouselWrapper, Root } from './MediaSection.styled' | ||
|
||
export default function MediaSection() { | ||
const { t } = useTranslation('index') | ||
|
||
return ( | ||
<Root> | ||
<Heading variant="h4" px={3}> | ||
{t('media-heading')} | ||
</Heading> | ||
<CarouselWrapper {...settings}> | ||
{articles.map((article, index) => ( | ||
<ArticleLink href={article.url} key={index}> | ||
<CardMedia | ||
component="img" | ||
height="100%" | ||
image={article.img} | ||
alt={article.title} | ||
sx={{ height: theme.spacing(12.5), width: theme.spacing(12.5), margin: '0 auto' }} | ||
/> | ||
</ArticleLink> | ||
))} | ||
</CarouselWrapper> | ||
</Root> | ||
) | ||
} |