-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ed Carousel, page with JSON-LD for empty URL, refinements, and general bug fixes
- Loading branch information
1 parent
73419db
commit 4492479
Showing
30 changed files
with
1,155 additions
and
485 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import React, { useState } from "react"; | ||
import SwipeableViews from "react-swipeable-views"; | ||
import { autoPlay } from "react-swipeable-views-utils"; | ||
import Card from "@mui/material/Card"; | ||
import CardMedia from "@mui/material/CardMedia"; | ||
import Typography from "@mui/material/Typography"; | ||
import Grid from "@mui/material/Grid"; | ||
import Box from "@mui/material/Box"; | ||
import { CardActionArea } from "@mui/material"; | ||
import Container from "@mui/material/Container"; | ||
import IconButton from "@mui/material/IconButton"; | ||
import ArrowBackIcon from "@mui/icons-material/ArrowBack"; | ||
import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; | ||
import { Link } from "react-router-dom"; | ||
import { PARTNERS } from "portability/configuration"; | ||
|
||
const AutoPlaySwipeableViews = autoPlay(SwipeableViews); | ||
const CarouselPortals = () => { | ||
const [index, setIndex] = useState(0); | ||
|
||
const handleSlideChange = (index) => { | ||
setIndex(index); | ||
}; | ||
|
||
const handleNextSlide = () => { | ||
setIndex((prevIndex) => (prevIndex + 1) % PARTNERS.length); | ||
}; | ||
|
||
const handlePrevSlide = () => { | ||
setIndex((prevIndex) => (prevIndex - 1 + 3) % PARTNERS.length); | ||
}; | ||
|
||
const palette = "custom.homepage.carouselPortals."; | ||
return ( | ||
<Container | ||
maxWidth="xl" | ||
sx={{ | ||
my: 6, | ||
}} | ||
> | ||
<Grid container> | ||
<Grid item xs={12} lg={12}> | ||
<Typography | ||
fontWeight={{ xs: 800, lg: 700 }} | ||
sx={{ fontSize: "36px", color: palette + "colorTypography" }} | ||
gutterBottom | ||
> | ||
Partners | ||
</Typography> | ||
</Grid> | ||
<Grid item xs={5} lg={12} sx={{ position: "relative", mt: 4 }}> | ||
<AutoPlaySwipeableViews | ||
index={index} | ||
onChangeIndex={handleSlideChange} | ||
> | ||
{PARTNERS.map((g) => { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
}} | ||
> | ||
{g.map((p) => { | ||
return ( | ||
<Card | ||
sx={{ | ||
background: "transparent", | ||
}} | ||
elevation={0} | ||
> | ||
<CardActionArea | ||
component={Link} | ||
to={p.url} | ||
target="_blank" | ||
> | ||
<CardMedia | ||
component="img" | ||
sx={{ height: "100%", width: "250px" }} | ||
image={p.icon} | ||
alt="" | ||
/> | ||
</CardActionArea> | ||
</Card> | ||
); | ||
})} | ||
</Box> | ||
); | ||
})} | ||
</AutoPlaySwipeableViews> | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
marginTop: "8px", | ||
display: "flex", | ||
gap: "9px", | ||
right: 14, | ||
}} | ||
> | ||
<IconButton onClick={handlePrevSlide}> | ||
<ArrowBackIcon sx={{ color: palette + "colorArrows" }} /> | ||
</IconButton> | ||
<IconButton onClick={handleNextSlide}> | ||
<ArrowForwardIcon sx={{ color: palette + "colorArrows" }} /> | ||
</IconButton> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default CarouselPortals; |
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
Oops, something went wrong.