Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added loading page #41

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions vriddhi/src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@

"use client";
import React, { useState } from "react";
import "./globals.css";
import { Inter } from "next/font/google";
import Navbar from "./Components/Navbar/Navbar";
import connectMongoDB from '../../libs/mongodb'
import connectMongoDB from "../../libs/mongodb";
import Footer from "./Components/Footer/page";
import Head from "next/head";


const inter = Inter({ subsets: ["latin"] });

export const metadata = {
title: "Vriddhi 2023",
description: "Vriddhi 2023",

};

export default function RootLayout({ children }) {

const [loading, setLoading] = useState(true);
setTimeout(() => {
setLoading(false);
}, 3000);
return (
<html lang="en">
<Head>
<link rel='icon' href='../favicon.ico'/>
<Head>
<link rel="icon" href="../favicon.ico" />
</Head>
<body className={inter.className}>
<Navbar />
{children}
<Footer/>
</body>

{loading ? <></> : <Navbar />}

<body className={inter.className}>{children}</body>

{loading ? <></> : <Footer />}
</html>
);
}
59 changes: 35 additions & 24 deletions vriddhi/src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@



import React from 'react';
import Image from "next/image";
import Navbar from "./Components/Navbar/Navbar";
"use client";
import React, { useState } from "react";
import Hero from "./Components/Hero/Hero";
import Score from "./Components/scorecard/score";
import Tally from "./Components/Tally/tally";
import Contact from "./Components/Contact/page"
import Tournaments from '../tournaments/tournaments'
import About from "./components/About"
import Team from './components/Team'
import Gallery from './Components/Gallery/gallery';
import Contact from "./Components/Contact/page";
import Tournaments from "../tournaments/tournaments";
import About from "./components/About";
import Team from "./components/Team";
import Gallery from "./Components/Gallery/gallery";

export default function Home() {
const [loading, setLoading] = useState(true);
setTimeout(() => {
setLoading(false);
}, 3000);
return (
<div className='overflow-hidden'>
<Hero/>
<Tournaments/>
<Score/>
<Tally/>
<Gallery/>
<About/>
<Team/>
<Contact/>
</div>
<>
{loading ? (
<>
<div className="w-screen h-screen flex justify-center items-center bg-[#172027]">
<img
alt="loader"
className="h-fit w-fit"
src="https://res.cloudinary.com/dgy8ybeoy/image/upload/v1666186569/0_U2RiSXJx8U9K4thZ_vsmfww.gif"
/>
</div>
</>
) : (
<div className="overflow-hidden">
<Hero />
<Tournaments />
<Score />
<Tally />
<Gallery />
<About />
<Team />
<Contact />
</div>
)}
</>
);


}