Skip to content

Commit

Permalink
Merge branch 'crescents-stack:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
musiur authored Dec 6, 2024
2 parents ee9b6c6 + d48587b commit b6b6129
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/app/_utils/masonry-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { TestimonialCard } from "../services/_utils/testimonials";
import ANIM__FadeInOutOnScroll from "@/components/anims/fadein.anim";
import { Action___GET__AllReviews } from "../reviews/post/_utils/actions";

const MasonryLayout = async () => {
const reviews = await Action___GET__AllReviews();
const MasonryLayout = ({ reviews }: { reviews: object[] }) => {
return (
<div className="container mx-auto p-4">
<div className="columns-1 min-[700px]:columns-2 min-[1030px]:columns-3 space-x-4">
{reviews?.data?.length ? (
reviews.data.map((review: any) => {
{reviews?.length ? (
reviews.map((review: any) => {
return (
<ANIM__FadeInOutOnScroll key={review?._id} className="py-4">
<TestimonialCard details={review} />
Expand Down
7 changes: 5 additions & 2 deletions src/app/reviews/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import MasonryLayout from "../_utils/masonry-layout";
import { Action___GET__AllReviews } from "./post/_utils/actions";

const Reviews = () => {
const Reviews = async () => {
const result = await Action___GET__AllReviews();
const reviews = result?.data?.length ? result?.data : [];
return (
<div className="bg-[url('/images/backgrounds/SquareBackground.svg')] bg-center bg-cover">
<div className="bg-gradient-to-r from-secondary/50 via-secondary to-secondary/50 section">
<h2 className="text-muted text-center">Our Wall of Love</h2>
</div>
<div className="-mt-[50px] container pb-20">
<MasonryLayout />
<MasonryLayout reviews={reviews} />
</div>
</div>
);
Expand Down

0 comments on commit b6b6129

Please sign in to comment.