Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SakinduRansindu committed Dec 5, 2024
1 parent 0923b0c commit d1a6fde
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/app/admin/admin-dashboard-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AdminDashboardLayout.tsx
"use client";

import React, { ReactNode, useContext, useState } from "react";
import { cn } from "@/lib/utils";
import Footer from "@/components/blocks/footer";
Expand All @@ -17,6 +17,8 @@ interface AdminDashboardLayoutProps {
children: ReactNode;
}

export const dynamic = "force-dynamic";

export function AdminDashboardLayout({ children }: AdminDashboardLayoutProps) {

console.log("AdminDashboardLayout");
Expand Down
14 changes: 11 additions & 3 deletions src/app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
'use client';

import { useEffect } from "react";
import { AdminDashboardLayout } from "@/app/admin/admin-dashboard-layout";
// import { AdminDashboardLayout } from "@/app/admin/admin-dashboard-layout";
import { useRouter } from "next/navigation";
import dynamic from 'next/dynamic';

const AdminDashboardLayout = dynamic(
() => import('@/app/admin/admin-dashboard-layout').then((mod) => mod.AdminDashboardLayout),
{ ssr: false }
);

export default function RedirectToDashboard() {

const router = useRouter();
useEffect(() => {
console.log("Redirecting page");

const router = useRouter();
useEffect(() => {
router.push('/admin/dashboard');
}, []);

Expand Down
3 changes: 2 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';


import localFont from "next/font/local";
import "./globals.css";
import React, { useCallback, useEffect, useState } from "react";
Expand All @@ -22,7 +23,7 @@ const geistMono = localFont({
export const ThemeContext = React.createContext<IThemeContextType|null>(null);

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
const DEFAULT_THEME = "dark";
const DEFAULT_THEME = "light";
const [theme, setThemeMode] = useState<ITheme>(DEFAULT_THEME);

useEffect(() => {
Expand Down
22 changes: 12 additions & 10 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import SPONSOR from "../../public/Images/partners/the-ai-team.png"
import LoadingAnimation from "../../public/animations/RUR_Loading.json"

import { Timeline } from "@/components/ui/timeline";
import LampLighting from "@/components/ui/lamp";
import { GlareCard } from "@/components/ui/glare-card";
import Image from "next/image";
import { TracingBeam } from "@/components/ui/tracing-beam";
import ReachUsSection from "@/components/blocks/reach-us-section";
Expand All @@ -42,16 +40,12 @@ import { TextGenerateEffect } from "@/components/ui/text-generate-effect";
import {CardDesign} from "@/components/ui/card-design";
import Lottie from "react-lottie-player";
import { IContact } from "@/interfaces/IContacts";
import { getReachUs } from "@/services/reachus.service";
import RegistrationStatus from "@/components/ui/google-gemini-effect";
import BackToTopButton from "@/components/ui/back-to-top";
import CodeEvelPara from "@/components/ui/code-evel-para";
import { HeroVideo } from "@/components/ui/hero-video";
import ExpandableCard from "@/components/blocks/expandable-card-standard";
import Head from "next/head";
import ExpandableCardGrid from "@/components/blocks/expandable-card-grid";
import { ICompany } from "@/interfaces/ICompanies";
import { getDataFromAggregatedCompanyDoc } from "@/services/aggregatedCompanyData.service";
import { sendGTMEvent } from "@next/third-parties/google";

export const products = [
Expand Down Expand Up @@ -172,6 +166,8 @@ const navItms = [
},
];

console.log("Home Page");


const Loading =()=> {
return (
Expand Down Expand Up @@ -270,7 +266,7 @@ export default function Home() {
} catch (err) {
console.error("Error fetching data:", err);
setError("Failed to load data. Please try again later.");
sendGTMEvent({ event:'JS_Error' , name:'AggregatedDocLoadError', error: err });
sendGTMEvent({ event:'JS_Error' , error_name:'AggregatedDocLoadError', error: err });
} finally {
setTimelineLoading(false);
setSponsorsLoading(false);
Expand All @@ -285,6 +281,8 @@ export default function Home() {
fetchData();
}, []);


function getEvents(){
const events = timeline.map((t) => ({
title: t.title,
content: <CodeEvelPara htmlContent={t.description} />,
Expand All @@ -295,6 +293,10 @@ export default function Home() {
isBtnDisabled: t.isBtnDisabled,
}));

return events;
}


const ErrorMessage = ({ message }: { message: string }) => (
<div className="flex items-center justify-center">
<HeroHighlight>
Expand Down Expand Up @@ -355,8 +357,8 @@ export default function Home() {
<ErrorMessage message={error} />
) : isTimelineLoading ? (
<Loading />
) : events.length > 0 ? (
<Timeline data={events} />
) : getEvents().length > 0 ? (
<Timeline data={getEvents()} />
) : (
<EmptyStateMessage message="Timeline will be updated soon." />
)}
Expand Down Expand Up @@ -395,7 +397,7 @@ export default function Home() {
<ExpandableCard />
{/* <ExpandableCardGrid cards={cards} /> */}

<section
<section
id="registrationStatus"
className="scroll-mt-20 relative py-16 w-full">
<div className="w-full mx-auto">
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

"use client";
import { FloatingDock } from "../ui/floating-dock";
import { FaLinkedin , FaInstagram, FaFacebook, FaYoutube, FaAt } from "react-icons/fa";
import { SiRotaryinternational } from "react-icons/si";
Expand Down
1 change: 1 addition & 0 deletions src/components/blocks/reach-us-section.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client";
import { IContact } from "@/interfaces/IContacts";
import React from "react";
import { useId } from "react";
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/back-to-top.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client";
import React, { useState, useEffect } from 'react';
import { ArrowUpIcon } from '@heroicons/react/24/solid';

Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/backgrounds.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";

export function GridBackground({title,children}:{title:string,children?:React.ReactNode}): JSX.Element {
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/code-evel-para.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import DOMPurify from 'dompurify';

const CodeEvelPara = ({ htmlContent }:{htmlContent:string}) => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/floating-dock.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

/**
* Note: Use position fixed according to your needs
* Desktop navbar is better positioned at the bottom
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/glare-card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { cn } from "@/lib/utils";
import { useRef } from "react";

Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/responsiveHero.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React, { useState, useEffect } from 'react';
import { HeroParallax } from "./hero-parallax";

Expand Down
2 changes: 2 additions & 0 deletions src/hooks/use-outside-click.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React, { useEffect } from "react";

export const useOutsideClick = (
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

Expand Down
3 changes: 3 additions & 0 deletions src/services/firebaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";

export const dynamic = "force-dynamic";

// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_API_KEY,
Expand All @@ -21,6 +23,7 @@ console.log(
);
console.log("API keys status: ", firebaseConfig.status);


// Initialize Firebase
export const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
Expand Down

0 comments on commit d1a6fde

Please sign in to comment.