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

campaigns pg #133

Open
wants to merge 3 commits into
base: master
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
217 changes: 105 additions & 112 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,124 +1,117 @@
import React from 'react'
import {
HashRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import Footer from './Components/Footer/index';
import Navbar from './Components/Navbar/index';
import About from './pages/About/index';
import Blogs from './pages/Blogs/index';
import EditBlog from './pages/Blogs/editBlog';
import NewBlog from './pages/Blogs/newBlog';
import Contact from './pages/Contact/index';
import Events from './pages/Events/index';
import EditEvent from './pages/Events/editEvent';
import NewEvent from './pages/Events/newEvent';
import Home from './pages/Home/index';
import Projects from './pages/Projects/index';
import EditProject from './pages/Projects/editProject';
import NewProject from './pages/Projects/newProject';
import Team from './pages/Team/index';
import EditMember from './pages/Team/editMember';
import NewMember from './pages/Team/newMember';
import LoginPage from "./pages/Projects/loginPage"
import React from "react";
import { HashRouter as Router, Switch, Route, Link } from "react-router-dom";
import Footer from "./Components/Footer/index";
import Navbar from "./Components/Navbar/index";
import About from "./pages/About/index";
import Campaigns from "./pages/Campaigns";
import Blogs from "./pages/Blogs/index";
import EditBlog from "./pages/Blogs/editBlog";
import NewBlog from "./pages/Blogs/newBlog";
import Contact from "./pages/Contact/index";
import Events from "./pages/Events/index";
import EditEvent from "./pages/Events/editEvent";
import NewEvent from "./pages/Events/newEvent";
import Home from "./pages/Home/index";
import Projects from "./pages/Projects/index";
import EditProject from "./pages/Projects/editProject";
import NewProject from "./pages/Projects/newProject";
import Team from "./pages/Team/index";
import EditMember from "./pages/Team/editMember";
import NewMember from "./pages/Team/newMember";
import LoginPage from "./pages/Projects/loginPage";
import ViewportProvider from "./viewport";
import ApiState from './ContextApi/ApiState';
import ApiState from "./ContextApi/ApiState";
import ScrollToTop from "./scrollToTop";

// import Loader from "../src/Loader";
import { useState, useEffect } from 'react';
import Secondload from './Secondload';


import LeaderBoard from './Components/LeaderBoard/LeaderBoard';
import { useState, useEffect } from "react";
import Secondload from "./Secondload";

import LeaderBoard from "./Components/LeaderBoard/LeaderBoard";

function App() {
const [loading, setLoading] = useState(false);

const [loading, setLoading] = useState(false);

useEffect(() => {
setLoading(true)
setTimeout(()=>{
setLoading(false);
},4500)
}, [])
useEffect(() => {
setLoading(true);
setTimeout(() => {
setLoading(false);
}, 4500);
}, []);

return (
<React.Fragment>
{
loading?
<Secondload />


:
<ApiState>
<ViewportProvider>
<Router basename={process.env.PUBLIC_URL}>
<ScrollToTop />
<Navbar />
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route path="/Home">
<Home />
</Route>
<Route path="/events" exact>
<Events />
</Route>
<Route path="/team" exact>
<Team />
</Route>
<Route path="/projects" exact>
<Projects />
</Route>
<Route path="/blogs" exact>
<Blogs />
</Route>
<Route path="/contact">
<Contact />
</Route>
<Route path="/events/new_event">
<NewEvent/>
</Route>
<Route path="/events/edit_event">
<EditEvent/>
</Route>
<Route path="/events/event_details">
<LeaderBoard/>
</Route>
<Route path="/blogs/new_blog">
<NewBlog/>
</Route>
<Route path="/blogs/edit_blog">
<EditBlog/>
</Route>
<Route path="/team/new_member">
<NewMember/>
</Route>
<Route path="/team/edit_member">
<EditMember/>
</Route>
<Route path="/projects/new_project">
<NewProject/>
</Route>
<Route path="/projects/login_page">
<LoginPage />
</Route>
<Route path="/projects/edit_project">
<EditProject/>
</Route>
</Switch>
<Footer />
</Router>
</ViewportProvider>
</ApiState>
}
</React.Fragment>
);
return (
<React.Fragment>
{loading ? (
<Secondload />
) : (
<ApiState>
<ViewportProvider>
<Router basename={process.env.PUBLIC_URL}>
<ScrollToTop />
<Navbar />
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route path="/Home">
<Home />
</Route>
<Route path="/events" exact>
<Events />
</Route>
<Route path="/team" exact>
<Team />
</Route>
<Route path="/projects" exact>
<Projects />
</Route>
<Route path="/blogs" exact>
<Blogs />
</Route>
<Route path="/campaigns" exact>
<Campaigns />
</Route>
<Route path="/contact">
<Contact />
</Route>
<Route path="/events/new_event">
<NewEvent />
</Route>
<Route path="/events/edit_event">
<EditEvent />
</Route>
<Route path="/events/event_details">
<LeaderBoard />
</Route>
<Route path="/blogs/new_blog">
<NewBlog />
</Route>
<Route path="/blogs/edit_blog">
<EditBlog />
</Route>
<Route path="/team/new_member">
<NewMember />
</Route>
<Route path="/team/edit_member">
<EditMember />
</Route>
<Route path="/projects/new_project">
<NewProject />
</Route>
<Route path="/projects/login_page">
<LoginPage />
</Route>
<Route path="/projects/edit_project">
<EditProject />
</Route>
</Switch>
<Footer />
</Router>
</ViewportProvider>
</ApiState>
)}
</React.Fragment>
);
}

export default App;
Binary file added frontend/src/Assets/Images/campaigns-hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 24 additions & 7 deletions frontend/src/Components/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NavLink } from "react-router-dom";
import "./Navbar.css";
import Navbar_logo from "../../Assets/DSC-IIITA-Light-Horizontal.png";

const navbarContent = ["Home", "Events", "Team", "Projects", "Blogs"];
const navbarContent = ["Home", "Events", "Team", "Projects", "Blogs", "Campaigns"];

function Navbar() {
const [width, setWidth] = useState(window.innerWidth);
Expand Down Expand Up @@ -38,8 +38,8 @@ function Navbar() {
setnavCheck("nav-checked");
}
};
const UpdateActivePage = (e) => {
console.log(e.target.innerText)
const UpdateActivePage = e => {
console.log(e.target.innerText);
// setActivePage("about");
};

Expand All @@ -51,7 +51,13 @@ function Navbar() {
</NavLink>
<div className="navbar_links">
{navbarContent.map((item, index) => (
<NavLink activeClassName="active_nav_link" className="navbar_link" key={index} to={`../${item.toLowerCase()}`} onClick={UpdateActivePage}>
<NavLink
activeClassName="active_nav_link"
className="navbar_link"
key={index}
to={`../${item.toLowerCase()}`}
onClick={UpdateActivePage}
>
<p className="navbar_link_txt">{item}</p>
</NavLink>
))}
Expand All @@ -68,7 +74,7 @@ function Navbar() {
<img src={Navbar_logo} alt="logo" />
</NavLink>
<div className="navbar_Drawer">
<input type="checkbox" className={navCheck} value="drawer" onClick={ExpandMenu}/>
<input type="checkbox" className={navCheck} value="drawer" onClick={ExpandMenu} />
<div className="navbar_drawer_icon">
<p className="drawer_line_1"></p>
<p className="drawer_line_2"></p>
Expand All @@ -77,11 +83,22 @@ function Navbar() {
</div>
<div className="navbar_drawer_links" style={{ display: `${Drawer}` }}>
{navbarContent.map((item, index) => (
<NavLink activeClassName="active_nav_link" className="navbar_link" key={index} to={`../${item.toLowerCase()}`} onClick={CollapseMenu}>
<NavLink
activeClassName="active_nav_link"
className="navbar_link"
key={index}
to={`../${item.toLowerCase()}`}
onClick={CollapseMenu}
>
<p className="navbar_link_txt">{item}</p>
</NavLink>
))}
<NavLink activeClassName="active_contact_link" className="navbar_link" to="../contact" onClick={CollapseMenu}>
<NavLink
activeClassName="active_contact_link"
className="navbar_link"
to="../contact"
onClick={CollapseMenu}
>
<p className="navbar_link_txt navbar_contact">Contact</p>
</NavLink>
</div>
Expand Down
Loading