File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , {
2+ useEffect ,
3+ } from 'react' ;
24import Body from './Body' ;
35import {
46 BrowserRouter ,
@@ -9,9 +11,16 @@ import ErrorPage from './components/ErrorPage';
911import About from './pages/About' ;
1012import Landing from './pages/Home' ;
1113import Student from './pages/Student' ;
12- import Album_Image from './pages/Album_Image' ;
13- import ContactUs from './components/ContactUs' ;
14+ import Album_Image from './components/Album_Image_Components/Album_Image' ;
15+ import ContactUs from './pages/ContactUs' ;
16+ import Loader from './components/Loader' ;
1417const App = ( ) => {
18+ useEffect ( ( ) => {
19+ window . onload = ( ) => {
20+ return < Loader /> ;
21+ } ;
22+ } , [ ] ) ;
23+
1524 return (
1625 < >
1726 < BrowserRouter basename = '/' >
Original file line number Diff line number Diff line change 1+ import axios from 'axios' ;
2+ import React from 'react' ;
3+ import { useParams } from 'react-router-dom' ;
4+ import Swal from 'sweetalert2' ;
5+
6+ const Album_Image = ( ) => {
7+ let parms = useParams ( ) ;
8+ let name = parms . name ;
9+
10+ let Find_Image = async ( ) => {
11+ try {
12+ // let res = await axios.get(`/api/image/${name}`)
13+ } catch ( error ) {
14+ console . log ( error ) ;
15+ Swal . fire ( ( ) => {
16+ icon: 'error' ;
17+ title: 'Oops...' ;
18+ text: error . message ;
19+ } ) ;
20+ }
21+ } ;
22+
23+ Find_Image ( ) ;
24+
25+ return (
26+ < div >
27+ Album_Image < h1 > { name } </ h1 >
28+ </ div >
29+ ) ;
30+ } ;
31+
32+ export default Album_Image ;
Original file line number Diff line number Diff line change 11import React , { useRef } from 'react' ;
22import gsap from 'gsap' ;
33import { useGSAP } from '@gsap/react' ;
4+ import { useSelector } from 'react-redux' ;
45
56const Loader = ( ) => {
67 let loader = useRef ( ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import React, {
55import About_BG from '../../assets/images/aboutbg.svg' ;
66import Loader from '../Loader' ;
77import { useSelector } from 'react-redux' ;
8+ import useAbout from '../../hooks/useAbout' ;
89
910const AboutHero = ( ) => {
1011 const [ image , setimage ] =
@@ -13,6 +14,8 @@ const AboutHero = () => {
1314 const [ heading , setheading ] =
1415 useState ( '' ) ;
1516
17+ useAbout ( ) ;
18+
1619 let about = useSelector (
1720 state => state . about . aboutPage ,
1821 ) ;
@@ -28,9 +31,7 @@ const AboutHero = () => {
2831 ) ;
2932 }
3033 } , [ about ] ) ;
31- return ! about ? (
32- < Loader />
33- ) : (
34+ return (
3435 < section className = 'bg-black w-full text-white' >
3536 < div className = 'about_hero relative w-full h-[90vh] bg-gradient-to-b from-white via-gray-700 to-black' >
3637 < img
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';
66import bulletPoint from '../../assets/images/bulletPoint.svg' ;
77import { useSelector } from 'react-redux' ;
88import { use } from 'react' ;
9+ import useAbout from '../../hooks/useAbout' ;
910
1011export let Facilites_Card = ( {
1112 Title,
@@ -34,6 +35,8 @@ const CampusFacilities = () => {
3435 const [ Description , setDescription ] =
3536 useState ( { } ) ;
3637
38+ useAbout ( ) ;
39+
3740 let About_Page_Data = useSelector (
3841 state => state . about . aboutPage ,
3942 ) ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , {
2+ useEffect ,
3+ useState ,
4+ } from 'react' ;
25import {
36 Swiper ,
47 SwiperSlide ,
@@ -14,6 +17,7 @@ import 'swiper/css/navigation';
1417import { useSelector } from 'react-redux' ;
1518import { Link } from 'react-router-dom' ;
1619import useTeacher from '../../hooks/useTeacher' ;
20+ import Loader from '../Loader' ;
1721
1822const TeacherCard = ( { teacher } ) => (
1923 < div className = 'card w-[25%] max-[599px]:w-full h-full bg-white text-black flex items-start p-4 justify-between flex-col gap-2 rounded-xl max-[1098px]:w-[40%]' >
@@ -128,11 +132,24 @@ const TeacherCard = ({ teacher }) => (
128132) ;
129133
130134const Teachers = ( ) => {
131- const teachers = useSelector (
135+ let [ teachers , SetTeacher ] =
136+ useState ( ) ;
137+
138+ useTeacher ( ) ;
139+
140+ const data = useSelector (
132141 state => state . about . teacher ,
133142 ) ;
134143
135- useTeacher ( ) ;
144+ useEffect ( ( ) => {
145+ if ( data ) {
146+ SetTeacher ( [ ...data ] ) ;
147+ }
148+ } , [ data ] ) ;
149+
150+ {
151+ ! data && < Loader /> ;
152+ }
136153
137154 return (
138155 < section className = 'w-full px-10 py-10 max-[599px]:py-6 flex items-center justify-between gap-4 flex-col bg-[#333] text-white overflow-hidden' >
Original file line number Diff line number Diff line change 44 useState ,
55} from 'react' ;
66import { Link } from 'react-router-dom' ;
7- import useAlbum from '../hooks/useAlbum' ;
7+ import useAlbum from '../../ hooks/useAlbum' ;
88import { useSelector } from 'react-redux' ;
99
1010const Album = ( ) => {
Original file line number Diff line number Diff line change @@ -5,25 +5,23 @@ import React, {
55 useState ,
66} from 'react' ;
77import Loader from '../Loader' ;
8+ import useHomeUi from '../../hooks/useHomeUi' ;
89
910const Hero = ( ) => {
1011 let [ image , setImage ] = useState ( ) ;
12+
1113 const [ heading , setHeading ] =
1214 useState ( ) ;
1315 const [ Paragraph , setParagraph ] =
1416 useState ( ) ;
1517
18+ useHomeUi ( ) ;
19+
1620 let hero = useSelector (
1721 state => state . home . landingPage ,
1822 ) ;
1923
2024 useEffect ( ( ) => {
21- setImage ( '' ) ;
22- setHeading ( '' ) ;
23- setParagraph (
24- 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo, nemo.' ,
25- ) ;
26-
2725 if ( hero ) {
2826 let data = hero . HeroSection ;
2927 setImage (
@@ -34,9 +32,7 @@ const Hero = () => {
3432 }
3533 } , [ hero ] ) ;
3634
37- return ! hero ? (
38- < Loader />
39- ) : (
35+ return (
4036 < section
4137 className = 'w-full min-h-screen flex flex-col lg:flex-row items-center justify-center text-white bg-cover bg-no-repeat px-10 relative overflow-clip'
4238 style = { {
Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ import Slider from 'react-slick';
66import 'slick-carousel/slick/slick.css' ;
77import 'slick-carousel/slick/slick-theme.css' ;
88
9- import useTestimonial from '../hooks/useTestimoniyal' ;
9+ import useTestimonial from '../../ hooks/useTestimoniyal' ;
1010import { useSelector } from 'react-redux' ;
1111
1212const Testimonials = ( ) => {
13+ useTestimonial ( ) ;
14+
1315 let testimonial = useSelector (
1416 state => state . home . Testimonital ,
1517 ) ;
@@ -19,8 +21,6 @@ const Testimonials = () => {
1921 setTestimonials ,
2022 ] = useState ( [ ] ) ;
2123
22- useTestimonial ( ) ;
23-
2424 useEffect ( ( ) => {
2525 if ( testimonial ) {
2626 setTestimonials ( [ ...testimonial ] ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { Provider } from 'react-redux';
66import App from './App' ;
77import { HelmetProvider } from 'react-helmet-async' ;
88import Lenis from 'lenis' ;
9+ import Loader from './components/Loader' ;
910
1011// Initialize Lenis
1112const lenis = new Lenis ( {
You can’t perform that action at this time.
0 commit comments