i-darrshan commited on
Commit
c049d8c
·
1 Parent(s): a6351fc
.gitignore CHANGED
@@ -26,3 +26,8 @@ data.db
26
 
27
  # Ignore node_modules
28
  node_modules
 
 
 
 
 
 
26
 
27
  # Ignore node_modules
28
  node_modules
29
+
30
+ #Ignore compressed things and build
31
+ *.zip
32
+ *.tar.gz
33
+ build
frontend/src/pages/Contact.jsx CHANGED
@@ -104,12 +104,12 @@ const Container = styled.div`
104
  box-sizing: border-box;
105
  `
106
 
107
- const Title = styled.h1`
108
- font-size: 2.5rem;
109
- font-weight: bold;
110
- text-align: center;
111
- margin-bottom: 2rem;
112
- `
113
 
114
  const Grid = styled.div`
115
  display: grid;
 
104
  box-sizing: border-box;
105
  `
106
 
107
+ // const Title = styled.h1`
108
+ // font-size: 2.5rem;
109
+ // font-weight: bold;
110
+ // text-align: center;
111
+ // margin-bottom: 2rem;
112
+ // `
113
 
114
  const Grid = styled.div`
115
  display: grid;
frontend/src/sections/Header.jsx CHANGED
@@ -49,6 +49,7 @@ const DesktopMenu = styled.nav`
49
  @media (min-width: 768px) {
50
  display: flex;
51
  gap: 1rem;
 
52
  }
53
  `;
54
 
@@ -57,6 +58,7 @@ const MenuLink = styled(Link)`
57
  padding: 0.5rem 2rem;
58
  text-decoration: none;
59
  position: relative;
 
60
 
61
  @media (min-width: 992px) {
62
  padding: 0.5rem 4rem;
@@ -78,6 +80,35 @@ const MenuLink = styled(Link)`
78
  `}
79
  `;
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  const MobileMenuButton = styled.button`
82
  display: block;
83
  background: none;
@@ -126,23 +157,32 @@ const MobileMenu = styled.nav`
126
 
127
  const Header = () => {
128
  const [isMenuOpen, setIsMenuOpen] = useState(false);
 
129
  const location = useLocation();
130
- const menuRef = useRef(null); // Ref for the menu
131
- const buttonRef = useRef(null); // Ref for the button
 
132
 
133
  const toggleMenu = () => setIsMenuOpen(prev => !prev);
 
134
 
135
  // Close menu if clicking outside
136
  useEffect(() => {
137
  const handleClickOutside = (event) => {
138
  if (
139
  menuRef.current &&
140
- !menuRef.current.contains(event.target) && // Not inside the menu
141
  buttonRef.current &&
142
- !buttonRef.current.contains(event.target) // Not the button
143
  ) {
144
  setIsMenuOpen(false);
145
  }
 
 
 
 
 
 
146
  };
147
 
148
  document.addEventListener("mousedown", handleClickOutside);
@@ -151,9 +191,10 @@ const Header = () => {
151
  };
152
  }, []);
153
 
154
- // Close menu on navigation
155
  useEffect(() => {
156
  setIsMenuOpen(false);
 
157
  }, [location.pathname]);
158
 
159
  return (
@@ -164,14 +205,25 @@ const Header = () => {
164
  </SLogo>
165
 
166
  <DesktopMenu>
167
- {["/vardig", "/about", "/blogs", "/jobs", "/contact"].map((path, i) => (
168
- <MenuLink key={i} to={path} $active={location.pathname === path}>
169
- {path === "/vardig"
170
- ? "VarDiG"
171
- : path.replace("/", "").charAt(0).toUpperCase() +
172
- path.replace("/", "").slice(1)}
173
- </MenuLink>
174
- ))}
 
 
 
 
 
 
 
 
 
 
 
175
  </DesktopMenu>
176
 
177
  <MobileMenuButton
@@ -183,22 +235,20 @@ const Header = () => {
183
  </MobileMenuButton>
184
  </NavWrapper>
185
 
186
- <MobileMenu $isOpen={isMenuOpen} ref={menuRef} data-testid="mobile-menu">
187
- {["/", "/vardig", "/about", "/blogs", "/jobs", "/contact"].map((path, i) => (
188
- <Link
189
- key={i}
190
- to={path}
191
- onClick={() => setIsMenuOpen(false)} // Close on click
192
- style={{
193
- backgroundColor: location.pathname === path ? "#1d9b62" : "transparent",
194
- }}
195
- >
196
- {path === "/"
197
- ? "Home"
198
- : path.replace("/", "").charAt(0).toUpperCase() +
199
- path.replace("/", "").slice(1)}
200
  </Link>
201
  ))}
 
 
 
 
 
 
 
 
202
  </MobileMenu>
203
  </HeaderContainer>
204
  );
 
49
  @media (min-width: 768px) {
50
  display: flex;
51
  gap: 1rem;
52
+ position: relative;
53
  }
54
  `;
55
 
 
58
  padding: 0.5rem 2rem;
59
  text-decoration: none;
60
  position: relative;
61
+ cursor: pointer;
62
 
63
  @media (min-width: 992px) {
64
  padding: 0.5rem 4rem;
 
80
  `}
81
  `;
82
 
83
+ // Dropdown Menu
84
+ const DropdownMenu = styled.div`
85
+ position: absolute;
86
+ background: rgba(0, 0, 0, 0.9);
87
+ border-radius: 5px;
88
+ top: 100%;
89
+ left: 0;
90
+ min-width: 150px;
91
+ display: ${(props) => (props.$isOpen ? "block" : "none")};
92
+ z-index: 1000;
93
+
94
+ a {
95
+ display: block;
96
+ padding: 0.5rem;
97
+ color: white;
98
+ text-decoration: none;
99
+
100
+ &:hover {
101
+ background: #333;
102
+ }
103
+ }
104
+ `;
105
+
106
+ const ContactWrapper = styled.div`
107
+ position: relative;
108
+ cursor: pointer;
109
+ `;
110
+
111
+ // Mobile Menu
112
  const MobileMenuButton = styled.button`
113
  display: block;
114
  background: none;
 
157
 
158
  const Header = () => {
159
  const [isMenuOpen, setIsMenuOpen] = useState(false);
160
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false);
161
  const location = useLocation();
162
+ const menuRef = useRef(null);
163
+ const buttonRef = useRef(null);
164
+ const dropdownRef = useRef(null);
165
 
166
  const toggleMenu = () => setIsMenuOpen(prev => !prev);
167
+ const toggleDropdown = () => setIsDropdownOpen(prev => !prev);
168
 
169
  // Close menu if clicking outside
170
  useEffect(() => {
171
  const handleClickOutside = (event) => {
172
  if (
173
  menuRef.current &&
174
+ !menuRef.current.contains(event.target) &&
175
  buttonRef.current &&
176
+ !buttonRef.current.contains(event.target)
177
  ) {
178
  setIsMenuOpen(false);
179
  }
180
+ if (
181
+ dropdownRef.current &&
182
+ !dropdownRef.current.contains(event.target)
183
+ ) {
184
+ setIsDropdownOpen(false);
185
+ }
186
  };
187
 
188
  document.addEventListener("mousedown", handleClickOutside);
 
191
  };
192
  }, []);
193
 
194
+ // Close menu and dropdown on navigation
195
  useEffect(() => {
196
  setIsMenuOpen(false);
197
+ setIsDropdownOpen(false);
198
  }, [location.pathname]);
199
 
200
  return (
 
205
  </SLogo>
206
 
207
  <DesktopMenu>
208
+ {["/vardig", "/about", "/blogs", "/jobs"].map((path, i) => (
209
+ <MenuLink key={i} to={path} $active={location.pathname === path}>
210
+ {path === "/vardig"
211
+ ? "VarDiG"
212
+ : path.replace("/", "").charAt(0).toUpperCase() +
213
+ path.replace("/", "").slice(1)}
214
+ </MenuLink>
215
+ ))}
216
+
217
+ {/* Contact with Dropdown */}
218
+ <ContactWrapper ref={dropdownRef}>
219
+ <MenuLink as="div" onClick={toggleDropdown}>
220
+ Contact ▾
221
+ </MenuLink>
222
+ <DropdownMenu $isOpen={isDropdownOpen}>
223
+ <Link to="/contact">Contact</Link>
224
+ <Link to="/privacy-policy">Privacy Policy</Link>
225
+ </DropdownMenu>
226
+ </ContactWrapper>
227
  </DesktopMenu>
228
 
229
  <MobileMenuButton
 
235
  </MobileMenuButton>
236
  </NavWrapper>
237
 
238
+ <MobileMenu $isOpen={isMenuOpen} ref={menuRef}>
239
+ {["/", "/vardig", "/about", "/blogs", "/jobs"].map((path, i) => (
240
+ <Link key={i} to={path} onClick={() => setIsMenuOpen(false)}>
241
+ {path === "/" ? "Home" : path.replace("/", "").charAt(0).toUpperCase() + path.slice(2)}
 
 
 
 
 
 
 
 
 
 
242
  </Link>
243
  ))}
244
+
245
+ {/* Mobile Contact Dropdown */}
246
+ <div>
247
+ <Link to="/contact" onClick={() => setIsMenuOpen(false)}>Contact</Link>
248
+ <Link to="/privacy-policy" onClick={() => setIsMenuOpen(false)} style={{ paddingLeft: "20px" }}>
249
+ Privacy Policy
250
+ </Link>
251
+ </div>
252
  </MobileMenu>
253
  </HeaderContainer>
254
  );
frontend/src/sections/about/Leaders.jsx CHANGED
@@ -1,6 +1,6 @@
1
  import React from "react";
2
  import styled from "styled-components";
3
- import { FaLinkedin, FaXTwitter } from "react-icons/fa6"; // Correct social media icons
4
 
5
  import leaders from "../../data/leaders"; // Import leader data
6
 
 
1
  import React from "react";
2
  import styled from "styled-components";
3
+ import { FaLinkedin } from "react-icons/fa6"; // Correct social media icons
4
 
5
  import leaders from "../../data/leaders"; // Import leader data
6
 
frontend/src/sections/vardig/Testimonials.jsx CHANGED
@@ -19,11 +19,11 @@ const Heading = styled.h2`
19
  margin-bottom: 16px;
20
  `;
21
 
22
- const Subheading = styled.p`
23
- font-size: 1.125rem;
24
- color: #ccc;
25
- margin-bottom: 40px;
26
- `;
27
 
28
  const CardList = styled.ul`
29
  display: grid;
 
19
  margin-bottom: 16px;
20
  `;
21
 
22
+ // const Subheading = styled.p`
23
+ // font-size: 1.125rem;
24
+ // color: #ccc;
25
+ // margin-bottom: 40px;
26
+ // `;
27
 
28
  const CardList = styled.ul`
29
  display: grid;