This repository has been archived by the owner on Dec 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from Cassianky/angely-homepage-testimonials
[Client/Vendor] Homepage updates (testimonial, landing)
- Loading branch information
Showing
14 changed files
with
371 additions
and
6 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,64 @@ | ||
import { FormatQuote } from "@mui/icons-material"; | ||
import { | ||
Box, | ||
Card, | ||
CardContent, | ||
Paper, | ||
Typography, | ||
styled, | ||
} from "@mui/material"; | ||
import React from "react"; | ||
|
||
const StyledPaper = styled(Paper)` | ||
padding: 10px; | ||
padding-top: 6px; | ||
width: 500px; | ||
border-radius: 10px; | ||
border: 1px solid rgb(159, 145, 204); | ||
box-shadow: 3px 3px 0px 0px rgb(159, 145, 204, 40%); | ||
`; | ||
function ClientTestimonial({ testimonial }) { | ||
return ( | ||
<StyledPaper> | ||
<Card elevation={0}> | ||
<CardContent> | ||
<FormatQuote | ||
color="primary" | ||
sx={{ | ||
fontSize: "3rem", | ||
transform: "scaleX(-1)", | ||
}} | ||
/> | ||
|
||
<div | ||
style={{ | ||
height: "200px", | ||
overflowY: "auto", | ||
|
||
overflowWrap: "break-word", | ||
}} | ||
> | ||
<Typography | ||
variant="h6" | ||
align="center" | ||
sx={{ | ||
lineHeight: 1.2, | ||
textAlign: "justify", | ||
fontSize: "1.3rem", | ||
padding: 2, | ||
}} | ||
> | ||
{testimonial.testimonialBody} | ||
</Typography> | ||
</div> | ||
|
||
<Typography variant="body1" align="center" paddingTop={2}> | ||
- {testimonial.displayName}, {testimonial.clientName} | ||
</Typography> | ||
</CardContent> | ||
</Card> | ||
</StyledPaper> | ||
); | ||
} | ||
|
||
export default ClientTestimonial; |
121 changes: 121 additions & 0 deletions
121
client-frontend/src/components/Home/TestimonialSection.jsx
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,121 @@ | ||
import { Container, Stack, Typography } from "@mui/material"; | ||
import { useEffect } from "react"; | ||
import "swiper/css"; | ||
import "swiper/css/navigation"; | ||
import "swiper/css/autoplay"; | ||
import "swiper/css/pagination"; | ||
import { Autoplay, Navigation, Pagination } from "swiper/modules"; | ||
import { Swiper, SwiperSlide } from "swiper/react"; | ||
import useSnackbarStore from "../../zustand/SnackbarStore"; | ||
import { useTestimonialStore } from "../../zustand/TestimonialStore"; | ||
import ClientTestimonial from "./ClientTestimonial"; | ||
|
||
function TestimonialSection() { | ||
const { testimonials, getAllTestimonials } = useTestimonialStore(); | ||
const { openSnackbar } = useSnackbarStore(); | ||
const testimonialsPerSlide = 3; | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
try { | ||
await getAllTestimonials(); | ||
} catch (err) { | ||
console.error(err); | ||
openSnackbar("Error when retrieving testimonials.", "error"); | ||
} | ||
}; | ||
fetchData(); | ||
}, [getAllTestimonials]); | ||
|
||
if (testimonials.length === 0) return <></>; | ||
|
||
function TestimonialSwiper() { | ||
return ( | ||
<Swiper | ||
maxWidth="fit-content" | ||
slidesPerView={3} | ||
autoplay={{ | ||
delay: 6000, | ||
disableOnInteraction: true, | ||
pauseOnMouseEnter: true | ||
}} | ||
|
||
speed={1200} | ||
spaceBetween={30} | ||
// pagination={{ | ||
// clickable: true, | ||
// }} | ||
navigation={true} | ||
modules={[Pagination, Navigation, Autoplay]} | ||
className="mySwiper" | ||
style={{ | ||
boxShadow: "none", | ||
padding: 30, | ||
backgroundColor: "transparent", | ||
}} | ||
breakpoints={{ | ||
600: { | ||
slidesPerView: 2, | ||
}, | ||
960: { | ||
slidesPerView: 3, | ||
}, | ||
}} | ||
> | ||
{testimonials.map((testimonial, index) => ( | ||
<SwiperSlide | ||
key={index} | ||
style={{ | ||
display: "flex", | ||
position: "relative", | ||
padding: "10px", | ||
boxSizing: "border-box", | ||
backgroundColor: "transparent", | ||
}} | ||
> | ||
<ClientTestimonial | ||
key={testimonial._id} | ||
testimonial={testimonial} | ||
style={{}} | ||
/> | ||
</SwiperSlide> | ||
))} | ||
</Swiper> | ||
); | ||
} | ||
function TestimonialGrid() { | ||
return ( | ||
<Stack spacing={5} justifyContent="center" direction={"row"} width="100%"> | ||
{testimonials.map((testimonial) => ( | ||
<> | ||
<ClientTestimonial testimonial={testimonial} /> | ||
</> | ||
))} | ||
</Stack> | ||
); | ||
} | ||
|
||
return ( | ||
<Container | ||
maxWidth="xl" | ||
sx={{ | ||
width: "100%", | ||
maxWidth: "80vw", | ||
height: "100%", | ||
paddingTop: 5, | ||
}} | ||
> | ||
<Typography | ||
variant="h4" | ||
gutterBottom | ||
py={6} | ||
sx={{ fontSize: "2rem", textAlign: "center" }} | ||
> | ||
What our clients say | ||
</Typography> | ||
{testimonials.length < 3 ? <TestimonialGrid /> : <TestimonialSwiper />} | ||
</Container> | ||
); | ||
} | ||
|
||
export default TestimonialSection; |
25 changes: 25 additions & 0 deletions
25
client-frontend/src/components/Recommendation/FeatureSection.jsx
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,25 @@ | ||
import React from "react"; | ||
import useClientStore from "../../zustand/ClientStore"; | ||
import useVendorStore from "../../zustand/VendorStore"; | ||
import { Container } from "@mui/material"; | ||
|
||
function FeatureSection() { | ||
const { authenticated } = useClientStore(); | ||
const { vendorAuthenticated } = useVendorStore(); | ||
if (!authenticated) return <></>; | ||
return ( | ||
<Container | ||
maxWidth="xl" | ||
sx={{ | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
paddingTop: "3rem", | ||
}} | ||
> | ||
Insert Featured Activities Here | ||
</Container> | ||
); | ||
} | ||
|
||
export default FeatureSection; |
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.