Skip to content

Commit 764bec9

Browse files
styles: snowflakes on only landing page; top left logo is not a link now
1 parent 0f62fb0 commit 764bec9

File tree

4 files changed

+41
-45
lines changed

4 files changed

+41
-45
lines changed

src/App.tsx

-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import MentorDashboard from "./pages/MentorDashboard";
1414
import PastProgramsPage from "./pages/PastProgramsPage";
1515
import StudentDashboard from "./pages/StudentDashboard";
1616
import RegistrationForm from "./pages/RegistrationForm";
17-
import Snowfall from "react-snowfall";
1817
import { Header } from "./components/Header";
1918
import Footer from "./components/Footer";
2019

@@ -24,19 +23,6 @@ function App() {
2423
<BrowserRouter>
2524
<AuthProvider>
2625
<Header />
27-
<Snowfall // the image can be edited into anything we want, feel free to change
28-
snowflakeCount={75}
29-
speed={[0.5, 1]} // array takes [min, max]
30-
wind={[-0.5, 0.5]}
31-
radius={[2, 4]}
32-
style={{
33-
position: "fixed",
34-
width: "100vw",
35-
height: "100vh",
36-
opacity: 0.5,
37-
zIndex: 0,
38-
}}
39-
/>
4026
<Routes>
4127
<Route index element={<Home />} />
4228
<Route

src/components/Navbar.tsx

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from 'react';
1+
import { useState, useEffect } from "react";
22
import { Link, useLocation } from "react-router-dom";
33
import kwoc_logo from "../assets/kwoc_logo.png";
44
import "../styles/Navbar.css";
@@ -7,8 +7,8 @@ import {
77
GH_OAUTH_URL,
88
REGISTRATIONS_OPEN,
99
} from "../util/constants";
10-
import { useAuthContext } from '../util/auth';
11-
import { UserType } from '../util/types';
10+
import { useAuthContext } from "../util/auth";
11+
import { UserType } from "../util/types";
1212

1313
function LoginButton() {
1414
const authContext = useAuthContext();
@@ -31,24 +31,20 @@ function LoginButton() {
3131
) : REGISTRATIONS_OPEN ? (
3232
["mentor", "student"].map((userType, i) => (
3333
<button
34-
className='reg-button'
34+
className="reg-button"
3535
key={i}
3636
onClick={(e) => {
3737
e.preventDefault();
3838

3939
authContext.setUserType(userType as UserType);
40-
window.location.href = GH_OAUTH_URL
40+
window.location.href = GH_OAUTH_URL;
4141
}}
4242
>
4343
{userType.toUpperCase()} LOGIN
4444
</button>
4545
))
4646
) : (
47-
<Link
48-
to={GH_OAUTH_URL}
49-
>
50-
LOGIN
51-
</Link>
47+
<Link to={GH_OAUTH_URL}>LOGIN</Link>
5248
)}
5349
</>
5450
);
@@ -73,26 +69,20 @@ const Navbar = () => {
7369
}, [location.pathname]);
7470

7571
function closeNavbar() {
76-
const element = document.getElementById('linkList');
72+
const element = document.getElementById("linkList");
7773

78-
if (element) {
79-
element.addEventListener('click', () => {
80-
element.classList.remove('open');
74+
if (element) {
75+
element.addEventListener("click", () => {
76+
element.classList.remove("open");
8177
});
8278
}
8379
setIsOpen(false);
8480
}
8581

8682
return (
87-
<div className='navbar'>
88-
<div className='light-logo'>
89-
<Link to="/">
90-
<img
91-
className="logo"
92-
src={kwoc_logo}
93-
alt="KWoC Logo"
94-
/>
95-
</Link>
83+
<div className="navbar">
84+
<div className="light-logo">
85+
<img className="logo" src={kwoc_logo} alt="KWoC Logo" />
9686
<div className="container">
9787
<div className="dots dot1"></div>
9888
<div className="dots dot2"></div>
@@ -102,20 +92,28 @@ const Navbar = () => {
10292
<div className="dots dot6"></div>
10393
</div>
10494
</div>
105-
<ul id="linkList" className={`link-container ${isOpen ? 'open' : ''}`}>
95+
<ul id="linkList" className={`link-container ${isOpen ? "open" : ""}`}>
10696
{LINKS.map((link) => (
10797
<li key={link.name}>
108-
<Link to={link.link} className={link.isActive ? `link nav-glow` : `link`} onClick={() => { closeNavbar() }}>
98+
<Link
99+
to={link.link}
100+
className={link.isActive ? `link nav-glow` : `link`}
101+
onClick={() => {
102+
closeNavbar();
103+
}}
104+
>
109105
{link.name}
110106
</Link>
111107
</li>
112108
))}
113109

114110
<LoginButton />
115111
</ul>
116-
<div className='burger' onClick={() => setIsOpen(!isOpen)}>{isOpen ? '✖' : '☰'}</div>
112+
<div className="burger" onClick={() => setIsOpen(!isOpen)}>
113+
{isOpen ? "✖" : "☰"}
114+
</div>
117115
</div>
118-
)
119-
}
116+
);
117+
};
120118

121-
export default Navbar
119+
export default Navbar;

src/pages/Home.tsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,24 @@ import { AboutSection } from "../components/About";
44
import { WhyKWoC } from "../components/WhyKWoC";
55
import "../styles/Santa.css";
66
import Testimonials from "../components/Testimonials";
7+
import { Snowfall } from "react-snowfall";
78

89
function Home() {
9-
1010
return (
1111
<div>
12+
<Snowfall // the image can be edited into anything we want, feel free to change
13+
snowflakeCount={75}
14+
speed={[0.5, 1]} // array takes [min, max]
15+
wind={[-0.5, 0.5]}
16+
radius={[2, 4]}
17+
style={{
18+
position: "fixed",
19+
width: "100vw",
20+
height: "100vh",
21+
opacity: 0.5,
22+
zIndex: 0,
23+
}}
24+
/>
1225
<HeroComponent />
1326
<AboutSection />
1427
<WhyKWoC />

src/styles/Navbar.css

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
.logo {
1111
height: 60px;
1212
width: 60px;
13-
cursor: pointer;
1413
position: absolute;
1514
z-index: 2;
1615
top: 50%;

0 commit comments

Comments
 (0)