From dc8d02b8e6b76d56a3c6cc747e87105fc26b18c0 Mon Sep 17 00:00:00 2001 From: "Aman Kumar [SSW]" <71385247+amankumarrr@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:23:55 +1100 Subject: [PATCH] Event Pages - Largest Contentful Paint (#3277) * Events - Removing the search Param * Removing reducer * removing redundant code * removing unused reducer import * Adding placeholder image for the events * Adding lazy loading for the images * adding minimum height for the timing * Adding query param feature * Adding breadcrumb * fixing mobile view * removing query param * Adding bluredBase 64 image * removing unused func * Adding the blurred image for the events * fixing the image import path * Adding search param for client rendering * Adding some spaces for mobile view on relative timings * removing unused placeholder image * Updating the comment * Events page - Largest Contentful Paint Affected route: `/events/*` * Removing layoutshifting on the page * splitting the client side code * updating the deprecated prop * fixing the prop for the video card --- app/events/[filename]/index.tsx | 16 +++++++++++++--- components/blocks-renderer.tsx | 8 ++------ components/blocks/content.tsx | 1 + components/events/eventsHeader.tsx | 30 +++++++++++------------------- tailwind.config.js | 1 + 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/events/[filename]/index.tsx b/app/events/[filename]/index.tsx index fc90910b99..69e434c912 100644 --- a/app/events/[filename]/index.tsx +++ b/app/events/[filename]/index.tsx @@ -1,18 +1,28 @@ "use client"; import { Blocks } from "@/components/blocks-renderer"; -import { ClientLogos } from "@/components/blocks/clientLogos"; import { componentRenderer } from "@/components/blocks/mdxComponentRenderer"; import EventsHeader from "@/components/events/eventsHeader"; -import { TestimonialRow } from "@/components/testimonials/TestimonialRow"; import { Container } from "@/components/util/container"; import { Section } from "@/components/util/section"; -import VideoCards from "@/components/util/videoCards"; import { removeExtension } from "@/services/client/utils.service"; import { Breadcrumbs } from "app/components/breadcrumb"; +import dynamic from "next/dynamic"; import { tinaField } from "tinacms/dist/react"; import { TinaMarkdown } from "tinacms/dist/rich-text"; +const ClientLogos = dynamic(() => + import("@/components/blocks/clientLogos").then((mod) => mod.ClientLogos) +); + +const TestimonialRow = dynamic(() => + import("@/components/testimonials/TestimonialRow").then( + (mod) => mod.TestimonialRow + ) +); + +const VideoCards = dynamic(() => import("@/components/util/videoCards")); + export default function EventsPage({ props, tinaProps }) { const { data } = tinaProps; diff --git a/components/blocks-renderer.tsx b/components/blocks-renderer.tsx index 0a6c0fb35a..aabc9b7c56 100644 --- a/components/blocks-renderer.tsx +++ b/components/blocks-renderer.tsx @@ -13,9 +13,7 @@ const AboutUs = dynamic(() => import("./blocks/aboutUs").then((mod) => mod.AboutUs) ); -const Agenda = dynamic(() => - import("./blocks/agenda").then((mod) => mod.Agenda) -); +import { Agenda } from "./blocks/agenda"; const BuiltOnAzure = dynamic(() => import("./blocks/builtOnAzure").then((mod) => mod.BuiltOnAzure) @@ -91,9 +89,7 @@ const LatestTech = dynamic(() => import("./usergroup/latestTech").then((mod) => mod.LatestTech) ); -const EventBooking = dynamic(() => - import("./training/eventBooking").then((mod) => mod.EventBooking) -); +import { EventBooking } from "./training/eventBooking"; const InterestForm = dynamic( () => import("./events/interestForm").then((mod) => mod.InterestForm), diff --git a/components/blocks/content.tsx b/components/blocks/content.tsx index c00c74db99..bf941eb27d 100644 --- a/components/blocks/content.tsx +++ b/components/blocks/content.tsx @@ -50,6 +50,7 @@ export const Content = ({ data }: ContentProps) => {
{ - const { - props: { srcSet }, - } = getImageProps({ - src: data?.heroBackground || "/images/polygonBackground.png", - alt: "Events header background", - height: 724, - width: 1728, - }); - const backgroundImage = getBackgroundImage(srcSet); - return ( -
+
+ {data?.altText {data?.imgOverlay && ( -
+