Skip to content

Commit 25f6237

Browse files
Merge branch 'main' into feat/privacy-terms-pages
2 parents 420b664 + 2debb23 commit 25f6237

9 files changed

Lines changed: 329 additions & 30 deletions

File tree

.github/workflows/auto-label-gssoc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ jobs:
2727
labels: |
2828
level:intermediate
2929
quality:clean
30+
type:accessibility
3031
gssoc:approved

backend/server.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ const logger = require('./logger');
1414
const app = express();
1515

1616
// CORS configuration
17-
app.use(cors('*'));
17+
const allowedOrigins = ['http://localhost:5173', 'https://github-spy.etlify.app'];
18+
app.use(cors({
19+
origin: function (origin, callback) {
20+
if (!origin || allowedOrigins.indexOf(origin) !== -1) {
21+
callback(null, true);
22+
} else{
23+
callback(new Error('Blocked by CORS policy'));
24+
}
25+
},
26+
credentials: true
27+
}));
1828

1929
// Middleware
2030
app.use(bodyParser.json());
@@ -33,8 +43,10 @@ app.use('/api/auth', authRoutes);
3343
// Connect to MongoDB
3444
mongoose.connect(process.env.MONGO_URI, {}).then(() => {
3545
logger.info('Connected to MongoDB');
36-
app.listen(process.env.PORT, () => {
37-
logger.info(`Server running on port ${process.env.PORT}`);
46+
47+
const PORT = process.env.PORT || 5000;
48+
app.listen(PORT, () => {
49+
logger.info(`Server running on port ${PORT}`);
3850
});
3951
}).catch((err) => {
4052
logger.error('MongoDB connection error', err);

src/Routes/Router.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Login from "../pages/Login/Login.tsx";
1010
import ContributorProfile from "../pages/ContributorProfile/ContributorProfile.tsx";
1111
import Home from "../pages/Home/Home.tsx";
1212
import Activity from "../pages/Activity.tsx";
13+
import PrivacyPolicy from "../pages/Privacy/PrivacyPolicy.tsx"; // ✅ Updated import path to match your new folder structure
1314

1415
const Router = () => {
1516
return (
@@ -24,9 +25,10 @@ const Router = () => {
2425
<Route path="/contact" element={<Contact />} />
2526
<Route path="/contributors" element={<Contributors />} />
2627
<Route path="/contributor/:username" element={<ContributorProfile />} />
27-
28-
{/* ✅ new route */}
2928
<Route path="/activity" element={<Activity />} />
29+
30+
{/* Privacy Policy page route */}
31+
<Route path="/privacy" element={<PrivacyPolicy />} />
3032
</Routes>
3133
);
3234
};

src/components/Footer.tsx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,29 @@ function Footer() {
111111
onSubmit={handleSubscribe}
112112
className="flex flex-col sm:flex-row items-stretch gap-2"
113113
>
114-
<input
115-
type="email"
116-
required
117-
placeholder="Enter email address"
118-
value={email}
119-
onChange={(e) => setEmail(e.target.value)}
120-
className="
121-
flex-grow text-sm px-4 py-3
122-
bg-zinc-50 dark:bg-zinc-800/40
123-
border border-zinc-200 dark:border-zinc-700/50
124-
rounded-xl
125-
focus:outline-none focus:ring-2
126-
focus:ring-blue-500/20 focus:border-blue-500
127-
text-zinc-900 dark:text-white
128-
placeholder-zinc-400 dark:placeholder-zinc-500
129-
transition-all
130-
"
131-
/>
114+
<div className="relative flex-grow">
115+
<label htmlFor="newsletter-email" className="sr-only">Email address</label>
116+
<input
117+
id="newsletter-email"
118+
type="email"
119+
name="email"
120+
required
121+
placeholder="Enter email address"
122+
value={email}
123+
onChange={(e) => setEmail(e.target.value)}
124+
className="
125+
w-full text-sm px-4 py-3
126+
bg-zinc-50 dark:bg-zinc-800/40
127+
border border-zinc-200 dark:border-zinc-700/50
128+
rounded-xl
129+
focus:outline-none focus:ring-2
130+
focus:ring-blue-500/20 focus:border-blue-500
131+
text-zinc-900 dark:text-white
132+
placeholder-zinc-400 dark:placeholder-zinc-500
133+
transition-all
134+
"
135+
/>
136+
</div>
132137

133138
<button
134139
type="submit"
@@ -199,4 +204,4 @@ function Footer() {
199204
);
200205
}
201206

202-
export default Footer;
207+
export default Footer;

src/pages/Contact/Contact.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ function Contact() {
208208
{/* Full Name */}
209209
<div>
210210
<label
211+
htmlFor="fullname"
211212
className={`block text-xs font-medium mb-1 ${
212213
mode === "dark"
213214
? "text-gray-300"
@@ -217,6 +218,8 @@ function Contact() {
217218
Full Name
218219
</label>
219220
<input
221+
id="fullname"
222+
name="fullname"
220223
type="text"
221224
placeholder="Enter your full name"
222225
required
@@ -231,6 +234,7 @@ function Contact() {
231234
{/* Email */}
232235
<div>
233236
<label
237+
htmlFor="email"
234238
className={`block text-xs font-medium mb-1 ${
235239
mode === "dark"
236240
? "text-gray-300"
@@ -240,6 +244,8 @@ function Contact() {
240244
Email Address
241245
</label>
242246
<input
247+
id="email"
248+
name="email"
243249
type="email"
244250
placeholder="your.email@example.com"
245251
required
@@ -254,6 +260,7 @@ function Contact() {
254260
{/* Subject */}
255261
<div>
256262
<label
263+
htmlFor="subject"
257264
className={`block text-xs font-medium mb-1 ${
258265
mode === "dark"
259266
? "text-gray-300"
@@ -263,6 +270,8 @@ function Contact() {
263270
Subject
264271
</label>
265272
<select
273+
id="subject"
274+
name="subject"
266275
className={`w-full p-2 sm:p-3 rounded-lg sm:rounded-xl text-sm sm:text-base transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-purple-500 ${
267276
mode === "dark"
268277
? "bg-white/5 border border-white/20 text-white placeholder-gray-400"
@@ -284,6 +293,7 @@ function Contact() {
284293
{/* Message */}
285294
<div className="relative">
286295
<label
296+
htmlFor="message"
287297
className={`block text-xs font-medium mb-1 ${
288298
mode === "dark"
289299
? "text-gray-300"
@@ -293,6 +303,8 @@ function Contact() {
293303
Message
294304
</label>
295305
<textarea
306+
id="message"
307+
name="message"
296308
placeholder="Type your message here..."
297309
required
298310
rows={4}
@@ -348,4 +360,4 @@ function Contact() {
348360
);
349361
}
350362

351-
export default Contact;
363+
export default Contact;

src/pages/Login/Login.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const Login: React.FC = () => {
9090

9191
<form onSubmit={handleSubmit} className="space-y-6">
9292
<div className="relative">
93+
<label htmlFor="email" className="sr-only">Email address</label>
9394
<input
95+
id="email"
9496
type="email"
9597
name="email"
9698
placeholder="Enter your email"
@@ -107,7 +109,9 @@ const Login: React.FC = () => {
107109
</div>
108110

109111
<div className="relative">
112+
<label htmlFor="password" className="sr-only">Password</label>
110113
<input
114+
id="password"
111115
type="password"
112116
name="password"
113117
autoComplete="current-password"

0 commit comments

Comments
 (0)