From d6665b192b7595c42009f5a252ac82d3c516d389 Mon Sep 17 00:00:00 2001 From: musiur Date: Fri, 6 Dec 2024 16:58:32 +0600 Subject: [PATCH] update testimonial section --- public/images/backgrounds/Quotes.svg | 4 ++-- src/app/_utils/testimonial.tsx | 2 +- .../case-studies/_utils/clients-reviews.tsx | 7 ++++--- src/app/globals.scss | 2 +- src/app/joining/_utils/actions.ts | 10 +++++----- src/app/services/[slug]/page.tsx | 5 +++-- src/app/services/_utils/marquee-wrapper.tsx | 6 ++++-- src/app/services/_utils/testimonials.tsx | 16 +++++++++------- src/app/services/page.tsx | 5 +++-- src/components/magicui/feature-with-grid.tsx | 6 +++--- src/components/molecule/email-modal.tsx | 19 +++++++++++++++---- 11 files changed, 50 insertions(+), 32 deletions(-) diff --git a/public/images/backgrounds/Quotes.svg b/public/images/backgrounds/Quotes.svg index 8cf4f28..6711038 100644 --- a/public/images/backgrounds/Quotes.svg +++ b/public/images/backgrounds/Quotes.svg @@ -1,8 +1,8 @@ + fill="#e5ebf0" /> + fill="#e5ebf0" /> \ No newline at end of file diff --git a/src/app/_utils/testimonial.tsx b/src/app/_utils/testimonial.tsx index 2610a19..5af0fb9 100644 --- a/src/app/_utils/testimonial.tsx +++ b/src/app/_utils/testimonial.tsx @@ -12,7 +12,7 @@ const Testimonial = ({ data, calendly }: { data: any; calendly: boolean }) => { const [currentTestimonial, setCurrentTestimonial] = useState(2); return (
-
+
{ - const [clientReviews, setClientReviews] = useState([]); + const [clientReviews, setClientReviews] = useState(reviews); const fetchReviews = async () => { const result = await Action___GET__AllReviews(); setClientReviews(result?.data?.length ? result?.data : []); @@ -25,7 +25,8 @@ const ClientsReviews = ({ if (!reviews) { fetchReviews(); } - }, []); + }, [reviews]); + console.log(reviews?.length, clientReviews?.length) return ( <> {testimonial ? ( diff --git a/src/app/globals.scss b/src/app/globals.scss index 60e2a0c..45b723a 100644 --- a/src/app/globals.scss +++ b/src/app/globals.scss @@ -21,7 +21,7 @@ --secondary-muted: 242 76% 90%; --secondary-foreground: 222.2 47.4% 11.2%; - --muted: 207 28% 92%; + --muted: 207 27% 92%; --dimmed: 246 10% 37%; --muted-foreground: 215.4 16.3% 46.9%; diff --git a/src/app/joining/_utils/actions.ts b/src/app/joining/_utils/actions.ts index f1952d6..15bbe98 100644 --- a/src/app/joining/_utils/actions.ts +++ b/src/app/joining/_utils/actions.ts @@ -1,11 +1,10 @@ "use server"; // @this variable should be in env in future while refactoring -const BaseURL = "https://sociomatic-backend.onrender.com"; -// const BaseURL = "https://f9f3-104-28-208-84.ngrok-free.app"; +const BASEURL = process.env.BASEURL; export const GetOtp = async (email: string) => { try { - const response = await fetch(`${BaseURL}/send-otp`, { + const response = await fetch(`${BASEURL}/send-otp`, { method: "POST", headers: { "Content-Type": "application/json", @@ -15,6 +14,7 @@ export const GetOtp = async (email: string) => { }), }); const result = await response.json(); + return result; } catch (error) { return { @@ -26,7 +26,7 @@ export const GetOtp = async (email: string) => { export const VerifyOtp = async (otp: number, email: string) => { try { - const response = await fetch(`${BaseURL}/verify-otp`, { + const response = await fetch(`${BASEURL}/verify-otp`, { method: "POST", headers: { "Content-Type": "application/json", @@ -48,7 +48,7 @@ export const VerifyOtp = async (otp: number, email: string) => { export const FunnelFormAction = async (data: any) => { try { - const response = await fetch(`${BaseURL}/funnel-form`, { + const response = await fetch(`${BASEURL}/funnel-form`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/src/app/services/[slug]/page.tsx b/src/app/services/[slug]/page.tsx index 9b94ee4..e54479f 100644 --- a/src/app/services/[slug]/page.tsx +++ b/src/app/services/[slug]/page.tsx @@ -8,6 +8,7 @@ import LimitedOfferSection from "@/app/services/_utils/limited-offer-section"; import UserEmpathyBanner from "@/app/services/_utils/user-empathy-banner"; import WhatAndWhySection from "@/app/services/_utils/what-and-why-section"; import { ServicePageCOPY } from "@/app/services/_utils/data/services"; +import { Fragment } from "react"; export type T__SlugType = | "googleads" @@ -43,7 +44,7 @@ const Services = async ({ params }: { params: { slug: string } }) => { } = data; return ( -
+ @@ -52,7 +53,7 @@ const Services = async ({ params }: { params: { slug: string } }) => { -
+ ); }; diff --git a/src/app/services/_utils/marquee-wrapper.tsx b/src/app/services/_utils/marquee-wrapper.tsx index ad0c90e..1f62a8f 100644 --- a/src/app/services/_utils/marquee-wrapper.tsx +++ b/src/app/services/_utils/marquee-wrapper.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useEffect, useState } from "react"; +import React, { Fragment, useEffect, useState } from "react"; import Marquee from "@/components/ui/marquee"; interface MarqueeWrapperProps { @@ -80,7 +80,9 @@ const MarqueeWrapper = ({ onMouseLeave={() => setIsHovered(false)} // Reset hover state on mouse leave >
- {infiniteChildren} + {infiniteChildren.map((child, index) => ( + {child} + ))}
diff --git a/src/app/services/_utils/testimonials.tsx b/src/app/services/_utils/testimonials.tsx index 60f250c..79bc6c1 100644 --- a/src/app/services/_utils/testimonials.tsx +++ b/src/app/services/_utils/testimonials.tsx @@ -54,13 +54,15 @@ const Testimonials = ({ data }: { data: any }) => { itemWidth={300} gapWidth={16} > - {filteredData?.slice(0, 10)?.map((item: any) => ( - - ))} + {filteredData?.slice(0, 10)?.map((item: any, index: number) => { + return ( + + ) + })} )}
diff --git a/src/app/services/page.tsx b/src/app/services/page.tsx index 91ca9ac..a00baea 100644 --- a/src/app/services/page.tsx +++ b/src/app/services/page.tsx @@ -6,16 +6,17 @@ import { homeTestimonialData, } from "@/lib/data/data"; import Faq from "../_utils/faq"; +import { Fragment } from "react"; const Services = () => { return ( -
+
-
+ ); }; diff --git a/src/components/magicui/feature-with-grid.tsx b/src/components/magicui/feature-with-grid.tsx index f0ff797..f1cf7bb 100644 --- a/src/components/magicui/feature-with-grid.tsx +++ b/src/components/magicui/feature-with-grid.tsx @@ -17,7 +17,7 @@ export function FeatureWithGrid({ }) { return (
- {features.map((feature) => ( + {features.map((feature, index) => ( {squares && ( - {squares.map(([x, y]: any) => ( + {squares.map(([x, y]: any, index: number) => ( { @@ -103,15 +104,21 @@ const EmailModal = ({ setPending(true); const result = await VerifyOtp(parseInt(otp), email); - setPending(false); if (result.success) { if (winDow) { localStorage.setItem("user_email", email); emailVerified({ email, otp }); } + setRedirecting(true); router.push(path); } else { + setPending(false); winDow && otpVerificationAbandoned({ email, otp }); + toast({ + variant: "error", + title: "OTP Verification", + description: result?.message || "Something went wrong!", + }); } }; @@ -178,10 +185,14 @@ const EmailModal = ({ type="submit" className="w-full items-center gap-2" onClick={step === 1 ? submitEmail : verifyEmail} - disabled={pending} + disabled={pending || redirecting} > {pending ? : null} - {step === 1 ? "Get Started" : "Verify Email"} + {step === 1 + ? "Get Started" + : redirecting + ? "Redirecting..." + : "Verify Email"}