Skip to content

Commit 3832bff

Browse files
committed
Merge branch 'old-dev' into old-dev-server
2 parents 19bfb9c + 258d7f0 commit 3832bff

File tree

10 files changed

+217
-22
lines changed

10 files changed

+217
-22
lines changed

src/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import YIP2023 from "./Pages/YIP2023/YIP2023";
4141
import BeWebDev from "./Pages/Events/BeWebDev/BeWebDev";
4242
import YipForm from "./Pages/YIP/YIPAfterForm/YipForm";
4343
import Journey from "./Pages/UserJourney/Journey";
44+
import MutechLeaderboard from "./Pages/MutechLeaderBoard/MutechLeaderBoard";
4445

4546
function App() {
4647
const [redirects, setRedirects] = useState([]);
@@ -80,6 +81,8 @@ function App() {
8081
<Redirection link="https://yip.kerala.gov.in/" />
8182
}
8283
/> */}
84+
<Route path='mutech/leaderboard' element={<MutechLeaderboard />} />
85+
8386
<Route path="/careers" element={<Career />} />
8487
<Route path="*" element={<NotFound isLoaded={isLoaded} />} />
8588
<Route path="/termsandconditions" element={<TermsAndCondition />} />

src/Components/Footer/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const Footer = () => {
128128
</p>
129129

130130
<p className={styles.mail}>
131-
131+
132132
</p>
133133
</div>
134134
</div>

src/Components/Navbar/Mylinks.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const links = [
206206
},
207207
{
208208
name: "Success Stories",
209-
link: "/successstories",
209+
link: "/blogs",
210210
submenu: false,
211211
sublinks: [],
212212
foreign: false,
@@ -433,15 +433,15 @@ export const links = [
433433
foreign: false,
434434
},
435435
{
436-
name: "Rust",
437-
link: mainlink + "/bootcamps/rust",
436+
name: "Unreal Engine",
437+
link: mainlink + "/bootcamps/ig/unreal",
438438
submenu: false,
439439
sublinks: [],
440440
foreign: false,
441441
},
442442
{
443-
name: "JavaScript",
444-
link: mainlink + "/bootcamps/javascript",
443+
name: "Web Development",
444+
link: mainlink + "/bootcamps/ig/web",
445445
submenu: false,
446446
sublinks: [],
447447
foreign: false,

src/Pages/CommPartners/data/partners.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import kuttycoders from "../assets/partners/kuttycoders.webp";
1212
import google_android from "../assets/partners/google_android.webp";
1313
import gdsc from "../assets/partners/gdsc.webp";
1414
import icfoss from "../assets/partners/icfoss.webp";
15-
import riglabs from "../assets/partners/riglabs.webp"
1615

1716
const partners = [
1817
{
@@ -25,8 +24,8 @@ const partners = [
2524
{
2625
name: "Kerala Startup Mission",
2726
image: ksum,
28-
link: "",
29-
customlink: "/community-partners/iedc",
27+
link: "https://startupmission.kerala.gov.in/",
28+
// customlink: "/community-partners/iedc",
3029
},
3130

3231
{
@@ -42,12 +41,6 @@ const partners = [
4241
link: "",
4342
customlink: "/community-partners/foxlab",
4443
},
45-
{
46-
name: "Riglabs",
47-
image: riglabs,
48-
link: "",
49-
customlink: "https://www.riglabs.co/",
50-
},
5144
{
5245
name: "Institute of Electrical and Electronics Engineers",
5346
image: ieee,

src/Pages/Events/BuildForTeam/BuildForTeam.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const Build4Team = () => {
211211
<p className={styles.tv_tagline}>
212212
<ul>
213213
<li>
214-
• First level filteration will be there from which all the
214+
• First level filtration will be there from which all the
215215
valid websites will be selected and they enter to phase two.
216216
</li>
217217
<li>
@@ -265,7 +265,7 @@ const Build4Team = () => {
265265
contact us via Discord.
266266
</p>
267267
<a
268-
href="https://app.mulearn.org/user/register"
268+
href="https://app.mulearn.org/register"
269269
target="_blank"
270270
rel="noopener noreferrer"
271271
>

src/Pages/Events/HacktoberFest/HacktoberFest.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const HacktoberFest = () => {
143143
</div>
144144
<div className={styles.svp_text}>
145145
For the Next step in the challenge. You have to create a
146-
website for a buissness nearby by following the requirements
146+
website for a business nearby by following the requirements
147147
which are specified below.
148148
</div>
149149
</div>
@@ -161,7 +161,7 @@ const HacktoberFest = () => {
161161
Contribute
162162
</div>
163163
<div className={styles.svp_text}>
164-
Since you have created a website for a buissness nearby you
164+
Since you have created a website for a business nearby you
165165
are ready to contribute to the project. For that all you
166166
have to do is make Pull request to our repository.
167167
</div>

src/Pages/LeaderBoard/leaderBoard.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ const LeaderBoard = () => {
176176
</div>
177177
</div> */}
178178
</div>
179+
179180
<Footer />
180181
</>
181182
);
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import React, { useState, useEffect, useRef } from 'react'
2+
import axios from "axios";
3+
import Style from './MutechLeaderBoard.module.css'
4+
import Navbar from '../../Components/Navbar/Navbar'
5+
const MutechLeaderBoard = () => {
6+
const API = "https://opensheet.elk.sh/"
7+
const [data, setData] = useState([])
8+
const fetchOnce = useRef(false)
9+
const spreadsheetId = 'https://docs.google.com/spreadsheets/d/1gAX7dGO5KFAOiPQfoo8vb22RbwtmjZ4Y1tslcULkrXE/edit#gid=564307130'
10+
const sheet = "CommitBox"
11+
const now = new Date()
12+
const month = now.getMonth()
13+
const today = now.getDate()
14+
const [scoreBoard, setScoreBoard] = useState({})
15+
useEffect(() => {
16+
if (spreadsheetId.length >= 83 && !fetchOnce.current) {
17+
try {
18+
axios.get(`${API + spreadsheetId.split("/")[5]}/${sheet}`)
19+
.then(res => res.data)
20+
.then(result => {
21+
setData(result)
22+
})
23+
}
24+
catch (err) {
25+
console.error(err)
26+
}
27+
}
28+
}, [])
29+
useEffect(() => {
30+
if (fetchOnce.current && data.length > 0) {
31+
const PeopleScoreBoard = {}
32+
const people = []
33+
for (let work of data) {
34+
// eslint-disable-next-line array-callback-return
35+
Object.keys(work).slice(1,).map((key, index) => {
36+
if (!people.includes(key)) {
37+
if (key !== "undefined") {
38+
people.push(key)
39+
PeopleScoreBoard[key] = { name: key, score: 0, streak: 0, longestStreak: 0, overallStreak: 0 }
40+
}
41+
}
42+
})
43+
const da = new Date(work.Date)
44+
if (da.getMonth() === month && da.getDate() < today) {
45+
for (let person of people) {
46+
if (work[person] !== null && work[person] !== undefined) {
47+
if (work[person].toLowerCase().includes('done')) {
48+
let x = work[person].split('\n'), score = 10
49+
PeopleScoreBoard[person].streak += 1
50+
PeopleScoreBoard[person].score += x.length * score + (PeopleScoreBoard[person].streak <= 5 ? (PeopleScoreBoard[person].streak - 1) * score : 50)
51+
}
52+
else {
53+
PeopleScoreBoard[person].streak = 0
54+
}
55+
}
56+
}
57+
}
58+
for (let person of people) {
59+
if (work[person] !== null && work[person] !== undefined) {
60+
PeopleScoreBoard[person].overallStreak += 1
61+
setLongestStreak(PeopleScoreBoard, person)
62+
}
63+
else {
64+
setLongestStreak(PeopleScoreBoard, person)
65+
PeopleScoreBoard[person].overallStreak = 0
66+
}
67+
}
68+
}
69+
sortScore(PeopleScoreBoard)
70+
}
71+
fetchOnce.current = true
72+
// eslint-disable-next-line react-hooks/exhaustive-deps
73+
}, [data])
74+
function sortScore(PeopleScoreBoard) {
75+
const scoreSet = Object.values(PeopleScoreBoard)
76+
const scoreBoard = scoreSet.sort((a, b) => {
77+
if (a.streak === b.streak)
78+
return b.score - a.score
79+
return b.streak - a.streak
80+
})
81+
setScoreBoard(scoreBoard)
82+
}
83+
function setLongestStreak(PeopleScoreBoard, person) {
84+
if (PeopleScoreBoard[person].overallStreak > PeopleScoreBoard[person].longestStreak)
85+
PeopleScoreBoard[person].longestStreak = PeopleScoreBoard[person].overallStreak
86+
}
87+
return (
88+
<>
89+
<Navbar />
90+
<div className={Style.container}>
91+
92+
<div className={Style.table}>
93+
<h1 className={Style.h1}>µTech Commit Leaderboard</h1>
94+
95+
<h1 className={Style.h1}>{now.toLocaleString('en-US', { month: 'long' })} {now.toLocaleString('en-US', { year: 'numeric' })}</h1>
96+
97+
<table className={Style.tableContainer} >
98+
<thead>
99+
<tr>
100+
<th >Rank</th>
101+
<th >Name</th>
102+
<th >Monthly Score</th>
103+
<th>Monthly Streak</th>
104+
<th>Overall Streak</th>
105+
</tr>
106+
</thead>
107+
<tbody>
108+
{Object.values(scoreBoard).map((score, index) => {
109+
return (
110+
<tr key={index}>
111+
<td >{index + 1}</td>
112+
<td >{score.name}</td>
113+
<td >{score.score}</td>
114+
<td>{score.streak}</td>
115+
<td><div className={Style.clear}>{score.longestStreak}</div></td>
116+
</tr>
117+
)
118+
})}
119+
</tbody>
120+
</table>
121+
</div>
122+
</div>
123+
</>
124+
)
125+
}
126+
127+
export default MutechLeaderBoard
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.container{
2+
display: flex;
3+
width: 100%;
4+
justify-content: center;
5+
}
6+
7+
.table{
8+
margin: 20px;
9+
padding: 30px;
10+
border-radius: 15px;
11+
background-color: rgb(248, 252, 255);
12+
box-shadow: 0 0px 5px 2px rgba(0, 0, 0, 0.1);
13+
overflow-x: auto;
14+
}
15+
.h1{
16+
text-align: center;
17+
font-size: 30px;
18+
font-weight: 700;
19+
padding:0px;
20+
width: 100%;
21+
margin: 0;
22+
}
23+
h1:first-child{
24+
margin-top: 15px;
25+
}
26+
h1:nth-child(2){
27+
margin-bottom:30px;
28+
}
29+
.h2{
30+
font-size: 25px;
31+
font-weight: 400;
32+
margin: 0;
33+
margin-top: 15px;
34+
margin-bottom:30px;
35+
}
36+
table,.tableContainer {
37+
width: 100%;
38+
border-spacing: 10px;
39+
word-break: break;
40+
min-width: 500px;
41+
width: 600px;
42+
}
43+
th{
44+
text-align: center;
45+
font-weight: 600;
46+
}
47+
tr{
48+
border-bottom: 1px solid rgba(0, 0, 0, 0.20) ;
49+
50+
51+
}
52+
.clear{
53+
padding:10px;
54+
}
55+
tbody
56+
td{
57+
text-align: center;
58+
}
59+
tbody tr:nth-child(-n+3){
60+
background-color: rgb(255, 191, 0);
61+
border-radius: 10px;
62+
color: white;
63+
}
64+
.side{
65+
text-align: left;
66+
}
67+
tr:nth-child(-n+3) td{
68+
font-size: 16px;
69+
font-weight: 700;
70+
/* text-align: center; */
71+
}

src/Pages/YIP2023/YIP2023.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const YIP2023 = () => {
146146
</a>
147147
to go to the Pre-Registration page. Enter all your
148148
details in the Pre-Registration Form and Complete the
149-
OTP Verification. By Now you would have recived an
149+
OTP Verification. By Now you would have received an
150150
email with login credentials, you can now login with
151151
that.
152152
</p>
@@ -262,7 +262,7 @@ const YIP2023 = () => {
262262
<b>person who formed the team</b> can submit the idea
263263
by going to the
264264
<b>&nbsp;Idea Submission Option</b> from his/her
265-
Navbar.Post your idea submission certiciate with the
265+
Navbar.Post your idea submission certificate with the
266266
hashtag&nbsp;
267267
<b>#yip5.0-idea</b> to gain <b>800 Karma Points</b>.
268268
You could submit upto 2 ideas per person.
@@ -287,7 +287,7 @@ const YIP2023 = () => {
287287
<div className="timeline__event__description">
288288
<p>
289289
After the submission of the idea, it requires the
290-
approval of the repective Institution and you may
290+
approval of the respective Institution and you may
291291
contact the concerned authority for the approval of
292292
your idea.
293293
</p>

0 commit comments

Comments
 (0)