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 d33948f + fb75058 commit ee9b6c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build --no-lint",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/case-studies/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CaseStudiesTemplate = ({ params }: { params: { slug: string } }) => {
<Approach data={approach} />
<Results data={result} />
<OurReview data={review} />
<ClientsReviews testimonial={false} />
<ClientsReviews testimonial={true} />
</Fragment>
);
};
Expand Down
25 changes: 20 additions & 5 deletions src/app/case-studies/_utils/clients-reviews.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
"use client"

import { Action___GET__AllReviews } from "@/app/reviews/post/_utils/actions";
import ProjectIdea from "../../_utils/project-idea-banner";
import Testimonials from "../../services/_utils/testimonials";
import { useEffect, useState } from "react";

const ClientsReviews = async ({
const ClientsReviews = ({
testimonial = true,
projectIdea = true,
reviews,
}: {
testimonial?: boolean;
projectIdea?: boolean;
reviews?: object[];
}) => {
if (!reviews) {
}) => {
const [clientReviews, setClientReviews] = useState<object[]>([]);
const fetchReviews = async () => {
const result = await Action___GET__AllReviews();
reviews = result?.data?.length ? result?.data : [];
setClientReviews(result?.data?.length ? result?.data : []);
}


useEffect(() => {
if (!reviews) {
fetchReviews();
}
}, []);
return (
<>
{testimonial && reviews?.length ? <Testimonials data={reviews} /> : null}
{testimonial ? (
clientReviews?.length ? (
<Testimonials data={clientReviews} />
) : null
) : null}
{projectIdea ? <ProjectIdea /> : null}
</>
);
Expand Down

0 comments on commit ee9b6c6

Please sign in to comment.