Skip to content
Merged
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
15 changes: 12 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import React, {
useEffect,
} from 'react';
import Body from './Body';
import {
BrowserRouter,
Expand All @@ -9,9 +11,16 @@ import ErrorPage from './components/ErrorPage';
import About from './pages/About';
import Landing from './pages/Home';
import Student from './pages/Student';
import Album_Image from './pages/Album_Image';
import ContactUs from './components/ContactUs';
import Album_Image from './components/Album_Image_Components/Album_Image';
import ContactUs from './pages/ContactUs';
import Loader from './components/Loader';
const App = () => {
useEffect(() => {
window.onload = () => {
return <Loader />;
};
}, []);

return (
<>
<BrowserRouter basename='/'>
Expand Down
32 changes: 32 additions & 0 deletions src/components/Album_Image_Components/Album_Image.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import axios from 'axios';
import React from 'react';
import { useParams } from 'react-router-dom';
import Swal from 'sweetalert2';

const Album_Image = () => {
let parms = useParams();
let name = parms.name;

let Find_Image = async () => {
try {
// let res = await axios.get(`/api/image/${name}`)
} catch (error) {
console.log(error);
Swal.fire(() => {
icon: 'error';
title: 'Oops...';
text: error.message;
});
}
};

Find_Image();

return (
<div>
Album_Image <h1>{name}</h1>
</div>
);
};

export default Album_Image;
1 change: 1 addition & 0 deletions src/components/Loader.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useRef } from 'react';
import gsap from 'gsap';
import { useGSAP } from '@gsap/react';
import { useSelector } from 'react-redux';

const Loader = () => {
let loader = useRef();
Expand Down
7 changes: 4 additions & 3 deletions src/components/aboutComponents/AboutHero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
import About_BG from '../../assets/images/aboutbg.svg';
import Loader from '../Loader';
import { useSelector } from 'react-redux';
import useAbout from '../../hooks/useAbout';

const AboutHero = () => {
const [image, setimage] =
Expand All @@ -13,6 +14,8 @@ const AboutHero = () => {
const [heading, setheading] =
useState('');

useAbout();

let about = useSelector(
state => state.about.aboutPage,
);
Expand All @@ -28,9 +31,7 @@ const AboutHero = () => {
);
}
}, [about]);
return !about ? (
<Loader />
) : (
return (
<section className='bg-black w-full text-white'>
<div className='about_hero relative w-full h-[90vh] bg-gradient-to-b from-white via-gray-700 to-black'>
<img
Expand Down
3 changes: 3 additions & 0 deletions src/components/aboutComponents/CampusFacilities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';
import bulletPoint from '../../assets/images/bulletPoint.svg';
import { useSelector } from 'react-redux';
import { use } from 'react';
import useAbout from '../../hooks/useAbout';

export let Facilites_Card = ({
Title,
Expand Down Expand Up @@ -34,6 +35,8 @@ const CampusFacilities = () => {
const [Description, setDescription] =
useState({});

useAbout();

let About_Page_Data = useSelector(
state => state.about.aboutPage,
);
Expand Down
23 changes: 20 additions & 3 deletions src/components/aboutComponents/Teachers.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import React from 'react';
import React, {
useEffect,
useState,
} from 'react';
import {
Swiper,
SwiperSlide,
Expand All @@ -14,6 +17,7 @@ import 'swiper/css/navigation';
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import useTeacher from '../../hooks/useTeacher';
import Loader from '../Loader';

const TeacherCard = ({ teacher }) => (
<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%]'>
Expand Down Expand Up @@ -128,11 +132,24 @@ const TeacherCard = ({ teacher }) => (
);

const Teachers = () => {
const teachers = useSelector(
let [teachers, SetTeacher] =
useState();

useTeacher();

const data = useSelector(
state => state.about.teacher,
);

useTeacher();
useEffect(() => {
if (data) {
SetTeacher([...data]);
}
}, [data]);

{
!data && <Loader />;
}

return (
<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'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
useState,
} from 'react';
import { Link } from 'react-router-dom';
import useAlbum from '../hooks/useAlbum';
import useAlbum from '../../hooks/useAlbum';
import { useSelector } from 'react-redux';

const Album = () => {
Expand Down
14 changes: 5 additions & 9 deletions src/components/homeComponents/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ import React, {
useState,
} from 'react';
import Loader from '../Loader';
import useHomeUi from '../../hooks/useHomeUi';

const Hero = () => {
let [image, setImage] = useState();

const [heading, setHeading] =
useState();
const [Paragraph, setParagraph] =
useState();

useHomeUi();

let hero = useSelector(
state => state.home.landingPage,
);

useEffect(() => {
setImage('');
setHeading('');
setParagraph(
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo, nemo.',
);

if (hero) {
let data = hero.HeroSection;
setImage(
Expand All @@ -34,9 +32,7 @@ const Hero = () => {
}
}, [hero]);

return !hero ? (
<Loader />
) : (
return (
<section
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'
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import Slider from 'react-slick';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';

import useTestimonial from '../hooks/useTestimoniyal';
import useTestimonial from '../../hooks/useTestimoniyal';
import { useSelector } from 'react-redux';

const Testimonials = () => {
useTestimonial();

let testimonial = useSelector(
state => state.home.Testimonital,
);
Expand All @@ -19,8 +21,6 @@ const Testimonials = () => {
setTestimonials,
] = useState([]);

useTestimonial();

useEffect(() => {
if (testimonial) {
setTestimonials([...testimonial]);
Expand Down
1 change: 1 addition & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Provider } from 'react-redux';
import App from './App';
import { HelmetProvider } from 'react-helmet-async';
import Lenis from 'lenis';
import Loader from './components/Loader';

// Initialize Lenis
const lenis = new Lenis({
Expand Down
13 changes: 13 additions & 0 deletions src/pages/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@ import AboutHero from '../components/aboutComponents/AboutHero';
import Teachers from '../components/aboutComponents/Teachers';
import Courses from '../components/aboutComponents/Courses';
import CampusFacilities from '../components/aboutComponents/CampusFacilities';
import { useSelector } from 'react-redux';
import useAbout from '../hooks/useAbout';
import Loader from '../components/Loader';

const About = () => {
useAbout();

let about = useSelector(
state => state.about.aboutPage,
);

if (!about) {
return <Loader />;
}

return (
<>
<Helmet>
Expand Down
7 changes: 0 additions & 7 deletions src/pages/Album_Image.jsx

This file was deleted.

4 changes: 4 additions & 0 deletions src/components/ContactUs.jsx → src/pages/ContactUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ const ContactUs = () => {
About Us
</h1>
<p className='text-[0.9vw] max-[410px]:text-[2.5vw] max-[823px]:text-[2.2vw] font-medium'>

Welcome to [Institute Name], an institution dedicated to fostering innovation, knowledge, and personal growth. Our mission is to shape tomorrow’s leaders by offering exceptional educational opportunities and encouraging intellectual exploration.

</p>

<h2 className='font-semibold text-[1.5vw] max-[410px]:text-[5vw] max-[823px]:text-[3vw] mt-[.8rem] mb-[.5rem]'>
Location
</h2>
<p className='text-[0.9vw] max-[410px]:text-[2.5vw] max-[823px]:text-[2.2vw] font-medium'>

Welcome to [Institute Name], an institution dedicated to fostering innovation, knowledge, and personal growth.

</p>

<h2 className='font-semibold text-[1.5vw] max-[410px]:text-[5vw] max-[823px]:text-[3vw] mt-[.8rem] mb-[.5rem]'>
Expand Down
16 changes: 14 additions & 2 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import Hero from '../components/homeComponents/Hero';
import Empower from '../components/homeComponents/Empower';
import Skills from '../components/homeComponents/Skills';
import Album from '../components/Album';
import Testimonials from '../components/Testimonials';
import Album from '../components/homeComponents/Album';
import Testimonials from '../components/homeComponents/Testimonials';
import { Helmet } from 'react-helmet-async';
import useHomeUi from '../hooks/useHomeUi';
import { useSelector } from 'react-redux';
import Loader from '../components/Loader';

function Home() {
useHomeUi();
let data = useSelector(
state => state.home.landingPage,
);

{
!data ? <Loader /> : null;
}

return (
<>
<Helmet>
Expand Down
5 changes: 2 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api':
backend_Url ||
'http://localhost:3000',
'/api': backend_Url,
// 'http://localhost:3000',
},
},
});