File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,12 @@ import { TestimonialCard } from "../services/_utils/testimonials";
3
3
import ANIM__FadeInOutOnScroll from "@/components/anims/fadein.anim" ;
4
4
import { Action___GET__AllReviews } from "../reviews/post/_utils/actions" ;
5
5
6
- const MasonryLayout = async ( ) => {
7
- const reviews = await Action___GET__AllReviews ( ) ;
6
+ const MasonryLayout = ( { reviews } : { reviews : object [ ] } ) => {
8
7
return (
9
8
< div className = "container mx-auto p-4" >
10
9
< div className = "columns-1 min-[700px]:columns-2 min-[1030px]:columns-3 space-x-4" >
11
- { reviews ?. data ?. length ? (
12
- reviews . data . map ( ( review : any ) => {
10
+ { reviews ?. length ? (
11
+ reviews . map ( ( review : any ) => {
13
12
return (
14
13
< ANIM__FadeInOutOnScroll key = { review ?. _id } className = "py-4" >
15
14
< TestimonialCard details = { review } />
Original file line number Diff line number Diff line change 1
1
import MasonryLayout from "../_utils/masonry-layout" ;
2
+ import { Action___GET__AllReviews } from "./post/_utils/actions" ;
2
3
3
- const Reviews = ( ) => {
4
+ const Reviews = async ( ) => {
5
+ const result = await Action___GET__AllReviews ( ) ;
6
+ const reviews = result ?. data ?. length ? result ?. data : [ ] ;
4
7
return (
5
8
< div className = "bg-[url('/images/backgrounds/SquareBackground.svg')] bg-center bg-cover" >
6
9
< div className = "bg-gradient-to-r from-secondary/50 via-secondary to-secondary/50 section" >
7
10
< h2 className = "text-muted text-center" > Our Wall of Love</ h2 >
8
11
</ div >
9
12
< div className = "-mt-[50px] container pb-20" >
10
- < MasonryLayout />
13
+ < MasonryLayout reviews = { reviews } />
11
14
</ div >
12
15
</ div >
13
16
) ;
You can’t perform that action at this time.
0 commit comments