From b3e4754dd09173d17d011cf1fd36c10dd876a44a Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sat, 17 Aug 2024 20:35:58 +0530 Subject: [PATCH 01/16] wip(hall-of-fame): add routing, data fetching wip --- data/annual-leaderboard/2023/round1.json | 786 ++++++++++++++++++ .../annual-leaderboard/2023/round2/final.json | 72 ++ .../2023/round2/ghost-legion.json | 786 ++++++++++++++++++ src/components/layout/header.jsx | 20 +- src/pages/hall-of-fame.jsx | 107 +++ src/pages/index.jsx | 1 + src/routes/index.jsx | 3 +- src/utils/fetch-old-data.js | 7 + 8 files changed, 1779 insertions(+), 3 deletions(-) create mode 100644 data/annual-leaderboard/2023/round1.json create mode 100644 data/annual-leaderboard/2023/round2/final.json create mode 100644 data/annual-leaderboard/2023/round2/ghost-legion.json create mode 100644 src/pages/hall-of-fame.jsx create mode 100644 src/utils/fetch-old-data.js diff --git a/data/annual-leaderboard/2023/round1.json b/data/annual-leaderboard/2023/round1.json new file mode 100644 index 0000000..7535da6 --- /dev/null +++ b/data/annual-leaderboard/2023/round1.json @@ -0,0 +1,786 @@ +[ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 550 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 525 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 525 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 350 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 300 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 200 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 200 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 150 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 150 + }, + { + "name": "FullBash/.", + "email": "wdilantha66@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 150 + }, + { + "name": "OneZero", + "email": "ravinduhapuarachchi@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 150 + }, + { + "name": "HackSquad", + "email": "nipunsandeepakck@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 150 + }, + { + "name": "Nasty_Owls", + "email": "yugantha1468@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 125 + }, + { + "name": "The X Order", + "email": "ashani.sansala16@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 125 + }, + { + "name": "Shell Warriors", + "email": "hirunaofficial@gmail.com", + "university": "ICBT", + "eliminated": true, + "score": 125 + }, + { + "name": "$cript_R0b0ts", + "email": "yasela2014@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 125 + }, + { + "name": "shiganshina :)", + "email": "wasath.vt@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 125 + }, + { + "name": "OneManArmy", + "email": "abdul.qadirv98@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 100 + }, + { + "name": "Marcopolo", + "email": "yashrashh05@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 100 + }, + { + "name": "11double0", + "email": "vidushsanidu07@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 100 + }, + { + "name": "BinaryBrilliance", + "email": "s19410@sci.pdn.ac.lk", + "university": "University of Peradeniya", + "eliminated": true, + "score": 100 + }, + { + "name": "mercode", + "email": "pathirana.sithmal@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 100 + }, + { + "name": "CATS", + "email": "samithkarunathilake@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "one-ticket-please", + "email": "adeeshamanthila@outlook.com", + "university": "IIT", + "eliminated": true, + "score": 75 + }, + { + "name": "Team 404", + "email": "weareteam404@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "Mugiwara", + "email": "shrikarsan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "Code Conjurers", + "email": "supung.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 50 + }, + { + "name": "Hackhive", + "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", + "university": "SUSL", + "eliminated": true, + "score": 50 + }, + { + "name": "Bytes_Coders", + "email": "sonacode44@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 50 + }, + { + "name": "Coding Blinders", + "email": "codingblinders@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 25 + }, + { + "name": "ByteSpark", + "email": "mithilathilochanaj@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 25 + }, + { + "name": "Ruhuna 1.0", + "email": "nevaasahanmath@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 25 + }, + { + "name": "Runtime Terror", + "email": "lightspeed.runtime@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team PhoeniXdeV", + "email": "sanuuthaya02@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hackOne", + "email": "tekshanmadhawa324@gmail.com", + "university": "University of Jaffna", + "eliminated": true, + "score": 0 + }, + { + "name": "Access_denied", + "email": "maniltenuka@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "HARIS", + "email": "isuruvihan@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Error By Night", + "email": "it21206450@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "A.A", + "email": "atheefofficial6@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Debug Entity", + "email": "prasadnirmal2021@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "What_the_Hack", + "email": "whatthehack.sltc@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Strikers", + "email": "sakithrandeev@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Geeks", + "email": "yasodalasiru@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titans", + "email": "techtitans444@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "I am Atomic", + "email": "chirathpansilu@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "tERROR ", + "email": "kavirangot@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Cyber Creepers", + "email": "glenperera2002@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Lambda Baryons", + "email": "baryonslambda@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Owls", + "email": "chamodiindrejith14@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "PySquardCoders", + "email": "thasvithu7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "SoloRider", + "email": "chirathb14@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "One2Seven", + "email": "udayanga.aj@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Kamino", + "email": "cst20004@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Meta Killers", + "email": "maleeshasparrow@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Code-Crafters", + "email": "navodyanethmi3@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Wizards", + "email": "codewizards123@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeQuest", + "email": "lumini.20221981@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scripters", + "email": "kanishkaekanayaka1004@outlook.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "8 bit shrooms", + "email": "yasithasanjula2018@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Astronauts", + "email": "risithanadimal531@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "404 Not Found", + "email": "pasinduravimal@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Smokers", + "email": "madhawalakshan718@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Binary Blitz", + "email": "binaryblitz50@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scorpions", + "email": "contact.scorpions.info@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Head Hunters", + "email": "ranushmithila45@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerInfinity#1", + "email": "powerinfinitypow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerTech", + "email": "powertechpow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Blazers", + "email": "ryanpussadeniya@gmail.com", + "university": "USJ", + "eliminated": true, + "score": 0 + }, + { + "name": "Solo Scripting Sorcerer", + "email": "senadhee1999@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Rubber Ducky", + "email": "shathurshmanoharan@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hugs 4 Bugs", + "email": "lasindumvp2001@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Dracode", + "email": "dracode0.0@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Automation", + "email": "sashinsirichandra@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Romio", + "email": "someshchandih@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Last Chance", + "email": "onaliy21@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Meraki", + "email": "chamudisiriwardena@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Satan Slaves", + "email": "dilax.18@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryX", + "email": "dilshankavinda371@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "mCoders", + "email": "arwijesuriya.7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "White Hats", + "email": "dinukaekanayaka18@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "InitialX", + "email": "minetheducation@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titanians", + "email": "techtitans2323@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Nova", + "email": "sanjulagathsara@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "v3nom", + "email": "it23195752@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hyperX", + "email": "koshala19299@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Zyndicate", + "email": "nimeshshamika@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "AnonymousHat", + "email": "4n0nym0ush4t@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "BASH Picca", + "email": "banula.19@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "codeDRINKERS", + "email": "dulankabewardhana123@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Team consoleLog", + "email": "veerasaravanan.20220157@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Janitha Prabodha", + "email": "janitha.20220212@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeCraft Samurai", + "email": "hashan_madusanka@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Vangaurd", + "email": "cst21050@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Epic byte", + "email": "mnethmi27@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LEO", + "email": "leodassma@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Redshifts", + "email": "lakindu.21@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "DevXcreW", + "email": "sahanchandrasena462@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Script_Kiddies", + "email": "himasharandil@gmail.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "Hash_Coders", + "email": "anuththaradias27@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Team WEBMates", + "email": "thevendranvithursan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PixelPioneers", + "email": "shanika010712@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Team Cygnus", + "email": "chamikasandaru01@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "URAQT", + "email": "gokulabisheak12@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "NoCode", + "email": "rajivapitiwaduge@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Night Wings", + "email": "gihangajanayaka08@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LuciferArchangel", + "email": "luminde9958@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "ALHAM", + "email": "alham@duck.com", + "university": "-", + "eliminated": true, + "score": 0 + }, + { + "name": "Team36T", + "email": "ramesharukshan3@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "A random team", + "email": "proushothkoushal@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteBlaze", + "email": "pehandassanayaka@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "The Council", + "email": "theogcouncillors@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + } +] diff --git a/data/annual-leaderboard/2023/round2/final.json b/data/annual-leaderboard/2023/round2/final.json new file mode 100644 index 0000000..79885f1 --- /dev/null +++ b/data/annual-leaderboard/2023/round2/final.json @@ -0,0 +1,72 @@ +[ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 700 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 475 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 425 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 300 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 275 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 150 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 50 + } +] diff --git a/data/annual-leaderboard/2023/round2/ghost-legion.json b/data/annual-leaderboard/2023/round2/ghost-legion.json new file mode 100644 index 0000000..6cd215a --- /dev/null +++ b/data/annual-leaderboard/2023/round2/ghost-legion.json @@ -0,0 +1,786 @@ +[ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 700 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 475 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 425 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 300 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 275 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 150 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 50 + }, + { + "name": "Runtime Terror", + "email": "lightspeed.runtime@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team PhoeniXdeV", + "email": "sanuuthaya02@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hackOne", + "email": "tekshanmadhawa324@gmail.com", + "university": "University of Jaffna", + "eliminated": true, + "score": 0 + }, + { + "name": "Access_denied", + "email": "maniltenuka@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "HARIS", + "email": "isuruvihan@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Error By Night", + "email": "it21206450@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "A.A", + "email": "atheefofficial6@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Debug Entity", + "email": "prasadnirmal2021@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "What_the_Hack", + "email": "whatthehack.sltc@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Strikers", + "email": "sakithrandeev@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Geeks", + "email": "yasodalasiru@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titans", + "email": "techtitans444@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "OneZero", + "email": "ravinduhapuarachchi@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "I am Atomic", + "email": "chirathpansilu@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "tERROR ", + "email": "kavirangot@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Cyber Creepers", + "email": "glenperera2002@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Lambda Baryons", + "email": "baryonslambda@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Owls", + "email": "chamodiindrejith14@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "PySquardCoders", + "email": "thasvithu7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "shiganshina :)", + "email": "wasath.vt@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Ruhuna 1.0", + "email": "nevaasahanmath@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "SoloRider", + "email": "chirathb14@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Marcopolo", + "email": "yashrashh05@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "FullBash/.", + "email": "wdilantha66@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "One2Seven", + "email": "udayanga.aj@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Kamino", + "email": "cst20004@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Meta Killers", + "email": "maleeshasparrow@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Bytes_Coders", + "email": "sonacode44@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code-Crafters", + "email": "navodyanethmi3@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Wizards", + "email": "codewizards123@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeQuest", + "email": "lumini.20221981@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteSpark", + "email": "mithilathilochanaj@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scripters", + "email": "kanishkaekanayaka1004@outlook.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "8 bit shrooms", + "email": "yasithasanjula2018@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Astronauts", + "email": "risithanadimal531@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "404 Not Found", + "email": "pasinduravimal@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Smokers", + "email": "madhawalakshan718@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Binary Blitz", + "email": "binaryblitz50@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scorpions", + "email": "contact.scorpions.info@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Head Hunters", + "email": "ranushmithila45@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerInfinity#1", + "email": "powerinfinitypow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerTech", + "email": "powertechpow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Blazers", + "email": "ryanpussadeniya@gmail.com", + "university": "USJ", + "eliminated": true, + "score": 0 + }, + { + "name": "Solo Scripting Sorcerer", + "email": "senadhee1999@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "OneManArmy", + "email": "abdul.qadirv98@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Rubber Ducky", + "email": "shathurshmanoharan@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hugs 4 Bugs", + "email": "lasindumvp2001@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Dracode", + "email": "dracode0.0@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Automation", + "email": "sashinsirichandra@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Romio", + "email": "someshchandih@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Last Chance", + "email": "onaliy21@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Meraki", + "email": "chamudisiriwardena@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Satan Slaves", + "email": "dilax.18@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryX", + "email": "dilshankavinda371@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "mCoders", + "email": "arwijesuriya.7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "White Hats", + "email": "dinukaekanayaka18@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "InitialX", + "email": "minetheducation@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "mercode", + "email": "pathirana.sithmal@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titanians", + "email": "techtitans2323@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Nova", + "email": "sanjulagathsara@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "v3nom", + "email": "it23195752@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team 404", + "email": "weareteam404@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "hyperX", + "email": "koshala19299@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Zyndicate", + "email": "nimeshshamika@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "The X Order", + "email": "ashani.sansala16@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "AnonymousHat", + "email": "4n0nym0ush4t@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "BASH Picca", + "email": "banula.19@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "codeDRINKERS", + "email": "dulankabewardhana123@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Team consoleLog", + "email": "veerasaravanan.20220157@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Janitha Prabodha", + "email": "janitha.20220212@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeCraft Samurai", + "email": "hashan_madusanka@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Vangaurd", + "email": "cst21050@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Epic byte", + "email": "mnethmi27@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LEO", + "email": "leodassma@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "11double0", + "email": "vidushsanidu07@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Redshifts", + "email": "lakindu.21@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Conjurers", + "email": "supung.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "DevXcreW", + "email": "sahanchandrasena462@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Script_Kiddies", + "email": "himasharandil@gmail.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "Hash_Coders", + "email": "anuththaradias27@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Blinders", + "email": "codingblinders@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Team WEBMates", + "email": "thevendranvithursan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PixelPioneers", + "email": "shanika010712@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "one-ticket-please", + "email": "adeeshamanthila@outlook.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Nasty_Owls", + "email": "yugantha1468@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "$cript_R0b0ts", + "email": "yasela2014@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Mugiwara", + "email": "shrikarsan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Shell Warriors", + "email": "hirunaofficial@gmail.com", + "university": "ICBT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team Cygnus", + "email": "chamikasandaru01@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "URAQT", + "email": "gokulabisheak12@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryBrilliance", + "email": "s19410@sci.pdn.ac.lk", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "NoCode", + "email": "rajivapitiwaduge@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Night Wings", + "email": "gihangajanayaka08@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LuciferArchangel", + "email": "luminde9958@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "ALHAM", + "email": "alham@duck.com", + "university": "-", + "eliminated": true, + "score": 0 + }, + { + "name": "Team36T", + "email": "ramesharukshan3@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "CATS", + "email": "samithkarunathilake@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "HackSquad", + "email": "nipunsandeepakck@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "A random team", + "email": "proushothkoushal@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteBlaze", + "email": "pehandassanayaka@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hackhive", + "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "The Council", + "email": "theogcouncillors@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + } +] diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index 055c2e6..31d1f89 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -1,6 +1,7 @@ import { useState } from "react"; import { RxCross1, RxHamburgerMenu } from "react-icons/rx"; import { Link } from "react-router-dom"; +import { useLocation } from "react-router-dom"; import { twMerge } from "tailwind-merge"; import { portalURL } from "@/constants"; import { useBreakpoint } from "@/hooks"; @@ -15,9 +16,11 @@ const buttonStyles = "mt-1.5 xl:mt-0 px-8 xl:px-[1.15rem] pb-2.5 xl:pb-[0.4rem] const Header = ({ className }) => { const [mobileNavOpen, setMobileNavOpen] = useState(false); - const breakpoints = useBreakpoint(); + const location = useLocation(); + const isHallOfFame = location.pathname === "/hall-of-fame"; + return (
{ : "opacity-0 pointer-events-none xl:opacity-100 xl:pointer-events-auto" )} > + window.scrollTo({ top: 0, behavior: "smooth" })} + aria-label="Home" + className="hidden xsm:flex gap-2" + > +
+ + {isHallOfFame ? "Leaderboard" : "Hall of Fame"} + + +
+
- The competition + Competition
diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx new file mode 100644 index 0000000..81efe67 --- /dev/null +++ b/src/pages/hall-of-fame.jsx @@ -0,0 +1,107 @@ +import { useEffect, useState } from "react"; +import { twMerge } from "tailwind-merge"; +import { ScoreCardSkeleton } from "@/components"; +import { ScoreCard } from "@/components/home"; +import { filters as filterData, sorts as sortData } from "@/filters"; +import { useTitle } from "@/hooks"; +import { + AnimatedSwitcher, + Filters, + NoRecords, + Pagination, + Sorts, + TwinSwitch +} from "@sliit-foss/bashaway-ui/components"; +import { useGhostLegion, useRound } from "@sliit-foss/bashaway-ui/hooks"; +import { Ghost } from "@sliit-foss/bashaway-ui/icons"; +import { Footnote, Title } from "@sliit-foss/bashaway-ui/typography"; +import { computeFilterQuery, computeSortQuery } from "@sliit-foss/bashaway-ui/utils"; +import { fetchPastLeaderboardData } from "@/utils/fetch-old-data"; + +const HallOfFame = () => { + const [page, setPage] = useState(1); + const [filters, setFilters] = useState(computeFilterQuery(filterData)); + const [sorts, setSorts] = useState(computeSortQuery(sortData)); + + const { rounds, round, roundKey, onRoundChange } = useRound(); + + const { ghostLegion, toggleGhostLegion } = useGhostLegion(); + + const { data: scores, isFetching } = fetchPastLeaderboardData({ page, filters, sorts, round, ghostLegion, year: 2023 }); + + useEffect(() => { + + }, []) + useEffect(() => { + if (page !== 1) setPage(1); + }, [filters, sorts, round, ghostLegion]); + + useTitle("Leaderboard | Bashaway"); + + return ( + <> +
+
+ Hall of Fame 2023 + + A tribute to legendary warriors + + +
+
+ +
+
+ + Ghost Legion + + +
+ +
+
+ } + alternateComponent={ + scores?.data?.docs?.length ? ( + <> + {scores.data.docs.map((item, index) => ( + + ))} + + ) : ( +
+ +
+ ) + } + /> +
+ setPage(newPage)} + totalPages={scores?.data?.totalPages} + /> +
+
+ + ); +}; + +export default HallOfFame; diff --git a/src/pages/index.jsx b/src/pages/index.jsx index c9918f0..6b339ed 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -1,2 +1,3 @@ export { default as NotFound } from "./404"; export { default as Home } from "./home"; +export { default as HallOfFame } from "./hall-of-fame"; diff --git a/src/routes/index.jsx b/src/routes/index.jsx index afa52a3..19fa51b 100644 --- a/src/routes/index.jsx +++ b/src/routes/index.jsx @@ -1,6 +1,6 @@ import { Route, Routes, useLocation } from "react-router-dom"; import { AnimatePresence } from "framer-motion"; -import { Home, NotFound } from "@/pages"; +import { HallOfFame, Home, NotFound } from "@/pages"; const AnimatedRoutes = () => { const location = useLocation(); @@ -8,6 +8,7 @@ const AnimatedRoutes = () => { } /> + } /> } /> diff --git a/src/utils/fetch-old-data.js b/src/utils/fetch-old-data.js new file mode 100644 index 0000000..1614c46 --- /dev/null +++ b/src/utils/fetch-old-data.js @@ -0,0 +1,7 @@ +export const fetchPastLeaderboardData = async ({ page, filters, sorts, round, ghostLegion, year }) => { + const round2Path = ghostLegion == true ? '/ghost-legion' : '/final'; + const path = `${year}/round${round}${round == 1 ? '': round2Path}` + const data = await import(`../../data/annual-leaderboard/${path}.json`) + console.log('HOF data', data); + console.log('Unused yet', page, filters, sorts); +}; \ No newline at end of file From 88e269de876daf53980bc96fad4300acc388a05e Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sat, 17 Aug 2024 21:42:38 +0530 Subject: [PATCH 02/16] wip(hall-of-fame): add dynamic data import --- src/pages/hall-of-fame.jsx | 23 ++++++++++++++--------- src/utils/compute-data-path.js | 5 +++++ src/utils/fetch-old-data.js | 7 ------- 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 src/utils/compute-data-path.js delete mode 100644 src/utils/fetch-old-data.js diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx index 81efe67..ec24738 100644 --- a/src/pages/hall-of-fame.jsx +++ b/src/pages/hall-of-fame.jsx @@ -4,6 +4,7 @@ import { ScoreCardSkeleton } from "@/components"; import { ScoreCard } from "@/components/home"; import { filters as filterData, sorts as sortData } from "@/filters"; import { useTitle } from "@/hooks"; +import { computePastLeaderboardDataPath } from "@/utils/compute-data-path"; import { AnimatedSwitcher, Filters, @@ -16,22 +17,26 @@ import { useGhostLegion, useRound } from "@sliit-foss/bashaway-ui/hooks"; import { Ghost } from "@sliit-foss/bashaway-ui/icons"; import { Footnote, Title } from "@sliit-foss/bashaway-ui/typography"; import { computeFilterQuery, computeSortQuery } from "@sliit-foss/bashaway-ui/utils"; -import { fetchPastLeaderboardData } from "@/utils/fetch-old-data"; const HallOfFame = () => { const [page, setPage] = useState(1); const [filters, setFilters] = useState(computeFilterQuery(filterData)); const [sorts, setSorts] = useState(computeSortQuery(sortData)); - + const [scores, setScores] = useState({}); + const { rounds, round, roundKey, onRoundChange } = useRound(); - const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - - const { data: scores, isFetching } = fetchPastLeaderboardData({ page, filters, sorts, round, ghostLegion, year: 2023 }); + const dataPath = computePastLeaderboardDataPath({ page, filters, sorts, round, ghostLegion, year: 2023 }); useEffect(() => { + const fetchPastLeaderboadData = async () => { + const data = (await import(`../../data/annual-leaderboard/${dataPath}.json`)).default; + setScores(data); + }; + + fetchPastLeaderboadData(); + }, [dataPath]); - }, []) useEffect(() => { if (page !== 1) setPage(1); }, [filters, sorts, round, ghostLegion]); @@ -75,13 +80,13 @@ const HallOfFame = () => { } alternateComponent={ - scores?.data?.docs?.length ? ( + scores?.length ? ( <> - {scores.data.docs.map((item, index) => ( + {scores.map((item, index) => ( ))} diff --git a/src/utils/compute-data-path.js b/src/utils/compute-data-path.js new file mode 100644 index 0000000..e4e732b --- /dev/null +++ b/src/utils/compute-data-path.js @@ -0,0 +1,5 @@ +export const computePastLeaderboardDataPath = ({ page, filters, sorts, round, ghostLegion, year }) => { + const round2Path = ghostLegion == true ? "/ghost-legion" : "/final"; + const path = `${year}/round${round}${round == 1 ? "" : round2Path}`; + return path; +}; diff --git a/src/utils/fetch-old-data.js b/src/utils/fetch-old-data.js deleted file mode 100644 index 1614c46..0000000 --- a/src/utils/fetch-old-data.js +++ /dev/null @@ -1,7 +0,0 @@ -export const fetchPastLeaderboardData = async ({ page, filters, sorts, round, ghostLegion, year }) => { - const round2Path = ghostLegion == true ? '/ghost-legion' : '/final'; - const path = `${year}/round${round}${round == 1 ? '': round2Path}` - const data = await import(`../../data/annual-leaderboard/${path}.json`) - console.log('HOF data', data); - console.log('Unused yet', page, filters, sorts); -}; \ No newline at end of file From 988e42477321f2c14f50f4211d881a7998c546fe Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 00:52:17 +0530 Subject: [PATCH 03/16] Fix(hall-of-fame): fix bug in dynamic imports --- .../2023/{round2 => }/final.json | 0 .../2023/{round2 => }/ghost-legion.json | 0 src/components/layout/header.jsx | 4 +--- src/hooks/past-data.jsx | 22 +++++++++++++++++++ src/pages/hall-of-fame.jsx | 18 +++++---------- src/utils/compute-data-path.js | 5 ----- 6 files changed, 28 insertions(+), 21 deletions(-) rename data/annual-leaderboard/2023/{round2 => }/final.json (100%) rename data/annual-leaderboard/2023/{round2 => }/ghost-legion.json (100%) create mode 100644 src/hooks/past-data.jsx delete mode 100644 src/utils/compute-data-path.js diff --git a/data/annual-leaderboard/2023/round2/final.json b/data/annual-leaderboard/2023/final.json similarity index 100% rename from data/annual-leaderboard/2023/round2/final.json rename to data/annual-leaderboard/2023/final.json diff --git a/data/annual-leaderboard/2023/round2/ghost-legion.json b/data/annual-leaderboard/2023/ghost-legion.json similarity index 100% rename from data/annual-leaderboard/2023/round2/ghost-legion.json rename to data/annual-leaderboard/2023/ghost-legion.json diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index 31d1f89..b6088c7 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -77,9 +77,7 @@ const Header = ({ className }) => { className="hidden xsm:flex gap-2" >
- - {isHallOfFame ? "Leaderboard" : "Hall of Fame"} - + {isHallOfFame ? "Leaderboard" : "Hall of Fame"}
diff --git a/src/hooks/past-data.jsx b/src/hooks/past-data.jsx new file mode 100644 index 0000000..590c9da --- /dev/null +++ b/src/hooks/past-data.jsx @@ -0,0 +1,22 @@ +import { useEffect, useState } from "react"; + +const usePastData = ({ round, ghostLegion, year = 2023 }) => { + const [pastData, setPastData] = useState({}); + + useEffect(() => { + const fetchPastLeaderboadData = async () => { + let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; + const data = (await import(`../../data/annual-leaderboard/${year}/${path}.json`)).default; + // console.log('Before mapping', data); + const transformedData = data.map((item, index) => ({ ...item, place: index + 1 })); + // console.log('After mapping', data); + setPastData(transformedData); + }; + + fetchPastLeaderboadData(); + }, [round, ghostLegion]); + + return pastData; +}; + +export default usePastData; diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx index ec24738..4c7cb95 100644 --- a/src/pages/hall-of-fame.jsx +++ b/src/pages/hall-of-fame.jsx @@ -4,7 +4,7 @@ import { ScoreCardSkeleton } from "@/components"; import { ScoreCard } from "@/components/home"; import { filters as filterData, sorts as sortData } from "@/filters"; import { useTitle } from "@/hooks"; -import { computePastLeaderboardDataPath } from "@/utils/compute-data-path"; +import usePastData from "@/hooks/past-data"; import { AnimatedSwitcher, Filters, @@ -22,20 +22,12 @@ const HallOfFame = () => { const [page, setPage] = useState(1); const [filters, setFilters] = useState(computeFilterQuery(filterData)); const [sorts, setSorts] = useState(computeSortQuery(sortData)); - const [scores, setScores] = useState({}); - const { rounds, round, roundKey, onRoundChange } = useRound(); const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - const dataPath = computePastLeaderboardDataPath({ page, filters, sorts, round, ghostLegion, year: 2023 }); - - useEffect(() => { - const fetchPastLeaderboadData = async () => { - const data = (await import(`../../data/annual-leaderboard/${dataPath}.json`)).default; - setScores(data); - }; - - fetchPastLeaderboadData(); - }, [dataPath]); + const scores = usePastData({ + round, + ghostLegion + }); useEffect(() => { if (page !== 1) setPage(1); diff --git a/src/utils/compute-data-path.js b/src/utils/compute-data-path.js deleted file mode 100644 index e4e732b..0000000 --- a/src/utils/compute-data-path.js +++ /dev/null @@ -1,5 +0,0 @@ -export const computePastLeaderboardDataPath = ({ page, filters, sorts, round, ghostLegion, year }) => { - const round2Path = ghostLegion == true ? "/ghost-legion" : "/final"; - const path = `${year}/round${round}${round == 1 ? "" : round2Path}`; - return path; -}; From 5917abf217b01d4e2f0a1633ffb65d64afef3214 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 01:17:31 +0530 Subject: [PATCH 04/16] Docs(hall-of-fame): add todo comments --- src/hooks/past-data.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/past-data.jsx b/src/hooks/past-data.jsx index 590c9da..c236c07 100644 --- a/src/hooks/past-data.jsx +++ b/src/hooks/past-data.jsx @@ -1,5 +1,9 @@ import { useEffect, useState } from "react"; +// TODO: add pagination +// TODO: add sorting +// TODO: add searcg +// TODO: explore the possibility of reusing The leaderboard API s response tranform function const usePastData = ({ round, ghostLegion, year = 2023 }) => { const [pastData, setPastData] = useState({}); From 3f1125683ed00f6e49022b0b73918b7095f3daeb Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 20:32:36 +0530 Subject: [PATCH 05/16] Refactor(hall-of-fame): refactor code to use RTK query --- data/annual-leaderboard/2023/final.json | 146 +- .../annual-leaderboard/2023/ghost-legion.json | 1574 +++++++++-------- data/annual-leaderboard/2023/round1.json | 1574 +++++++++-------- src/components/layout/header.jsx | 6 +- src/hooks/detect-hall-of-fame.jsx | 17 + src/hooks/past-data.jsx | 2 +- src/pages/home.jsx | 13 +- src/routes/index.jsx | 4 +- src/store/api/leaderboard.js | 52 +- src/store/api/transformer.js | 38 + 10 files changed, 1736 insertions(+), 1690 deletions(-) create mode 100644 src/hooks/detect-hall-of-fame.jsx create mode 100644 src/store/api/transformer.js diff --git a/data/annual-leaderboard/2023/final.json b/data/annual-leaderboard/2023/final.json index 79885f1..b521023 100644 --- a/data/annual-leaderboard/2023/final.json +++ b/data/annual-leaderboard/2023/final.json @@ -1,72 +1,74 @@ -[ - { - "name": "TrackTech", - "email": "radith.20@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": false, - "score": 700 - }, - { - "name": "HereForTheBytes", - "email": "hereforthebytes@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 475 - }, - { - "name": "' OR 1=1 --", - "email": "nisaldasunpriya@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 425 - }, - { - "name": "REISUB", - "email": "nirmalsavinda29@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 300 - }, - { - "name": "The BroCode", - "email": "sasikasankalana321@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 275 - }, - { - "name": "iCoders", - "email": "sandaruwanwgma@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 250 - }, - { - "name": "4bit", - "email": "patalee2001@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 250 - }, - { - "name": "MegaMinds", - "email": "kavindudamsith9@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 225 - }, - { - "name": "5H4D0W\\ G4RD3N", - "email": "qjoyal@gmail.com", - "university": "SLIIT", - "eliminated": false, - "score": 150 - }, - { - "name": "WeDoNotSow", - "email": "baqirhabeeb@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 50 - } -] +{ + "data": [ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 700 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 475 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 425 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 300 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 275 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 150 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 50 + } + ] +} diff --git a/data/annual-leaderboard/2023/ghost-legion.json b/data/annual-leaderboard/2023/ghost-legion.json index 6cd215a..48f8054 100644 --- a/data/annual-leaderboard/2023/ghost-legion.json +++ b/data/annual-leaderboard/2023/ghost-legion.json @@ -1,786 +1,788 @@ -[ - { - "name": "TrackTech", - "email": "radith.20@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": false, - "score": 700 - }, - { - "name": "HereForTheBytes", - "email": "hereforthebytes@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 475 - }, - { - "name": "' OR 1=1 --", - "email": "nisaldasunpriya@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 425 - }, - { - "name": "REISUB", - "email": "nirmalsavinda29@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 300 - }, - { - "name": "The BroCode", - "email": "sasikasankalana321@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 275 - }, - { - "name": "iCoders", - "email": "sandaruwanwgma@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 250 - }, - { - "name": "4bit", - "email": "patalee2001@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 250 - }, - { - "name": "MegaMinds", - "email": "kavindudamsith9@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 225 - }, - { - "name": "5H4D0W\\ G4RD3N", - "email": "qjoyal@gmail.com", - "university": "SLIIT", - "eliminated": false, - "score": 150 - }, - { - "name": "WeDoNotSow", - "email": "baqirhabeeb@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 50 - }, - { - "name": "Runtime Terror", - "email": "lightspeed.runtime@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Team PhoeniXdeV", - "email": "sanuuthaya02@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "hackOne", - "email": "tekshanmadhawa324@gmail.com", - "university": "University of Jaffna", - "eliminated": true, - "score": 0 - }, - { - "name": "Access_denied", - "email": "maniltenuka@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "HARIS", - "email": "isuruvihan@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Error By Night", - "email": "it21206450@my.sliit.lk", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "A.A", - "email": "atheefofficial6@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "Debug Entity", - "email": "prasadnirmal2021@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "What_the_Hack", - "email": "whatthehack.sltc@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "Strikers", - "email": "sakithrandeev@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Geeks", - "email": "yasodalasiru@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Tech Titans", - "email": "techtitans444@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "OneZero", - "email": "ravinduhapuarachchi@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "I am Atomic", - "email": "chirathpansilu@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "tERROR ", - "email": "kavirangot@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Cyber Creepers", - "email": "glenperera2002@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Lambda Baryons", - "email": "baryonslambda@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Coding Owls", - "email": "chamodiindrejith14@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "PySquardCoders", - "email": "thasvithu7@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "shiganshina :)", - "email": "wasath.vt@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 0 - }, - { - "name": "Ruhuna 1.0", - "email": "nevaasahanmath@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "SoloRider", - "email": "chirathb14@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Marcopolo", - "email": "yashrashh05@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 0 - }, - { - "name": "FullBash/.", - "email": "wdilantha66@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 0 - }, - { - "name": "One2Seven", - "email": "udayanga.aj@outlook.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Kamino", - "email": "cst20004@std.uwu.ac.lk", - "university": "Uva Wellassa University", - "eliminated": true, - "score": 0 - }, - { - "name": "Meta Killers", - "email": "maleeshasparrow@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Bytes_Coders", - "email": "sonacode44@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Code-Crafters", - "email": "navodyanethmi3@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Wizards", - "email": "codewizards123@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "CodeQuest", - "email": "lumini.20221981@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "ByteSpark", - "email": "mithilathilochanaj@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Scripters", - "email": "kanishkaekanayaka1004@outlook.com", - "university": "KDU", - "eliminated": true, - "score": 0 - }, - { - "name": "8 bit shrooms", - "email": "yasithasanjula2018@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Astronauts", - "email": "risithanadimal531@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "404 Not Found", - "email": "pasinduravimal@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Smokers", - "email": "madhawalakshan718@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Binary Blitz", - "email": "binaryblitz50@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Scorpions", - "email": "contact.scorpions.info@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Head Hunters", - "email": "ranushmithila45@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "PowerInfinity#1", - "email": "powerinfinitypow@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "PowerTech", - "email": "powertechpow@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Blazers", - "email": "ryanpussadeniya@gmail.com", - "university": "USJ", - "eliminated": true, - "score": 0 - }, - { - "name": "Solo Scripting Sorcerer", - "email": "senadhee1999@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "OneManArmy", - "email": "abdul.qadirv98@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Rubber Ducky", - "email": "shathurshmanoharan@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Hugs 4 Bugs", - "email": "lasindumvp2001@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Dracode", - "email": "dracode0.0@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Automation", - "email": "sashinsirichandra@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Romio", - "email": "someshchandih@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Last Chance", - "email": "onaliy21@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 0 - }, - { - "name": "Meraki", - "email": "chamudisiriwardena@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Satan Slaves", - "email": "dilax.18@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "BinaryX", - "email": "dilshankavinda371@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "mCoders", - "email": "arwijesuriya.7@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "White Hats", - "email": "dinukaekanayaka18@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "InitialX", - "email": "minetheducation@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "mercode", - "email": "pathirana.sithmal@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Tech Titanians", - "email": "techtitans2323@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Nova", - "email": "sanjulagathsara@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "v3nom", - "email": "it23195752@my.sliit.lk", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Team 404", - "email": "weareteam404@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "hyperX", - "email": "koshala19299@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "Zyndicate", - "email": "nimeshshamika@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "The X Order", - "email": "ashani.sansala16@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "AnonymousHat", - "email": "4n0nym0ush4t@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "BASH Picca", - "email": "banula.19@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "codeDRINKERS", - "email": "dulankabewardhana123@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "Team consoleLog", - "email": "veerasaravanan.20220157@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Janitha Prabodha", - "email": "janitha.20220212@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "CodeCraft Samurai", - "email": "hashan_madusanka@outlook.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Vangaurd", - "email": "cst21050@std.uwu.ac.lk", - "university": "Uva Wellassa University", - "eliminated": true, - "score": 0 - }, - { - "name": "Epic byte", - "email": "mnethmi27@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "LEO", - "email": "leodassma@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "11double0", - "email": "vidushsanidu07@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "Redshifts", - "email": "lakindu.21@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Conjurers", - "email": "supung.20@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "DevXcreW", - "email": "sahanchandrasena462@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Script_Kiddies", - "email": "himasharandil@gmail.com", - "university": "KDU", - "eliminated": true, - "score": 0 - }, - { - "name": "Hash_Coders", - "email": "anuththaradias27@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Coding Blinders", - "email": "codingblinders@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Team WEBMates", - "email": "thevendranvithursan@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "PixelPioneers", - "email": "shanika010712@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "one-ticket-please", - "email": "adeeshamanthila@outlook.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Nasty_Owls", - "email": "yugantha1468@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "$cript_R0b0ts", - "email": "yasela2014@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "Mugiwara", - "email": "shrikarsan@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Shell Warriors", - "email": "hirunaofficial@gmail.com", - "university": "ICBT", - "eliminated": true, - "score": 0 - }, - { - "name": "Team Cygnus", - "email": "chamikasandaru01@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "URAQT", - "email": "gokulabisheak12@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "BinaryBrilliance", - "email": "s19410@sci.pdn.ac.lk", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "NoCode", - "email": "rajivapitiwaduge@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Night Wings", - "email": "gihangajanayaka08@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "LuciferArchangel", - "email": "luminde9958@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "ALHAM", - "email": "alham@duck.com", - "university": "-", - "eliminated": true, - "score": 0 - }, - { - "name": "Team36T", - "email": "ramesharukshan3@gmail.com", - "university": "NIBM", - "eliminated": true, - "score": 0 - }, - { - "name": "CATS", - "email": "samithkarunathilake@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "HackSquad", - "email": "nipunsandeepakck@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "A random team", - "email": "proushothkoushal@gmail.com", - "university": "NIBM", - "eliminated": true, - "score": 0 - }, - { - "name": "ByteBlaze", - "email": "pehandassanayaka@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Hackhive", - "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "The Council", - "email": "theogcouncillors@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - } -] +{ + "data": [ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 700 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 475 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 425 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 300 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 275 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 250 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 150 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 50 + }, + { + "name": "Runtime Terror", + "email": "lightspeed.runtime@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team PhoeniXdeV", + "email": "sanuuthaya02@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hackOne", + "email": "tekshanmadhawa324@gmail.com", + "university": "University of Jaffna", + "eliminated": true, + "score": 0 + }, + { + "name": "Access_denied", + "email": "maniltenuka@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "HARIS", + "email": "isuruvihan@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Error By Night", + "email": "it21206450@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "A.A", + "email": "atheefofficial6@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Debug Entity", + "email": "prasadnirmal2021@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "What_the_Hack", + "email": "whatthehack.sltc@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Strikers", + "email": "sakithrandeev@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Geeks", + "email": "yasodalasiru@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titans", + "email": "techtitans444@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "OneZero", + "email": "ravinduhapuarachchi@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "I am Atomic", + "email": "chirathpansilu@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "tERROR ", + "email": "kavirangot@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Cyber Creepers", + "email": "glenperera2002@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Lambda Baryons", + "email": "baryonslambda@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Owls", + "email": "chamodiindrejith14@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "PySquardCoders", + "email": "thasvithu7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "shiganshina :)", + "email": "wasath.vt@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Ruhuna 1.0", + "email": "nevaasahanmath@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "SoloRider", + "email": "chirathb14@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Marcopolo", + "email": "yashrashh05@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "FullBash/.", + "email": "wdilantha66@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "One2Seven", + "email": "udayanga.aj@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Kamino", + "email": "cst20004@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Meta Killers", + "email": "maleeshasparrow@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Bytes_Coders", + "email": "sonacode44@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code-Crafters", + "email": "navodyanethmi3@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Wizards", + "email": "codewizards123@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeQuest", + "email": "lumini.20221981@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteSpark", + "email": "mithilathilochanaj@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scripters", + "email": "kanishkaekanayaka1004@outlook.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "8 bit shrooms", + "email": "yasithasanjula2018@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Astronauts", + "email": "risithanadimal531@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "404 Not Found", + "email": "pasinduravimal@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Smokers", + "email": "madhawalakshan718@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Binary Blitz", + "email": "binaryblitz50@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scorpions", + "email": "contact.scorpions.info@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Head Hunters", + "email": "ranushmithila45@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerInfinity#1", + "email": "powerinfinitypow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerTech", + "email": "powertechpow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Blazers", + "email": "ryanpussadeniya@gmail.com", + "university": "USJ", + "eliminated": true, + "score": 0 + }, + { + "name": "Solo Scripting Sorcerer", + "email": "senadhee1999@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "OneManArmy", + "email": "abdul.qadirv98@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Rubber Ducky", + "email": "shathurshmanoharan@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hugs 4 Bugs", + "email": "lasindumvp2001@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Dracode", + "email": "dracode0.0@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Automation", + "email": "sashinsirichandra@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Romio", + "email": "someshchandih@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Last Chance", + "email": "onaliy21@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Meraki", + "email": "chamudisiriwardena@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Satan Slaves", + "email": "dilax.18@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryX", + "email": "dilshankavinda371@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "mCoders", + "email": "arwijesuriya.7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "White Hats", + "email": "dinukaekanayaka18@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "InitialX", + "email": "minetheducation@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "mercode", + "email": "pathirana.sithmal@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titanians", + "email": "techtitans2323@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Nova", + "email": "sanjulagathsara@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "v3nom", + "email": "it23195752@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team 404", + "email": "weareteam404@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "hyperX", + "email": "koshala19299@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Zyndicate", + "email": "nimeshshamika@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "The X Order", + "email": "ashani.sansala16@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "AnonymousHat", + "email": "4n0nym0ush4t@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "BASH Picca", + "email": "banula.19@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "codeDRINKERS", + "email": "dulankabewardhana123@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Team consoleLog", + "email": "veerasaravanan.20220157@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Janitha Prabodha", + "email": "janitha.20220212@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeCraft Samurai", + "email": "hashan_madusanka@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Vangaurd", + "email": "cst21050@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Epic byte", + "email": "mnethmi27@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LEO", + "email": "leodassma@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "11double0", + "email": "vidushsanidu07@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Redshifts", + "email": "lakindu.21@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Conjurers", + "email": "supung.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "DevXcreW", + "email": "sahanchandrasena462@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Script_Kiddies", + "email": "himasharandil@gmail.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "Hash_Coders", + "email": "anuththaradias27@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Blinders", + "email": "codingblinders@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Team WEBMates", + "email": "thevendranvithursan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PixelPioneers", + "email": "shanika010712@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "one-ticket-please", + "email": "adeeshamanthila@outlook.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Nasty_Owls", + "email": "yugantha1468@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "$cript_R0b0ts", + "email": "yasela2014@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Mugiwara", + "email": "shrikarsan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Shell Warriors", + "email": "hirunaofficial@gmail.com", + "university": "ICBT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team Cygnus", + "email": "chamikasandaru01@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "URAQT", + "email": "gokulabisheak12@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryBrilliance", + "email": "s19410@sci.pdn.ac.lk", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "NoCode", + "email": "rajivapitiwaduge@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Night Wings", + "email": "gihangajanayaka08@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LuciferArchangel", + "email": "luminde9958@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "ALHAM", + "email": "alham@duck.com", + "university": "-", + "eliminated": true, + "score": 0 + }, + { + "name": "Team36T", + "email": "ramesharukshan3@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "CATS", + "email": "samithkarunathilake@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "HackSquad", + "email": "nipunsandeepakck@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "A random team", + "email": "proushothkoushal@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteBlaze", + "email": "pehandassanayaka@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hackhive", + "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "The Council", + "email": "theogcouncillors@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + } + ] +} diff --git a/data/annual-leaderboard/2023/round1.json b/data/annual-leaderboard/2023/round1.json index 7535da6..6ed986b 100644 --- a/data/annual-leaderboard/2023/round1.json +++ b/data/annual-leaderboard/2023/round1.json @@ -1,786 +1,788 @@ -[ - { - "name": "TrackTech", - "email": "radith.20@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": false, - "score": 550 - }, - { - "name": "HereForTheBytes", - "email": "hereforthebytes@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 525 - }, - { - "name": "' OR 1=1 --", - "email": "nisaldasunpriya@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 525 - }, - { - "name": "REISUB", - "email": "nirmalsavinda29@gmail.com", - "university": "UCSC", - "eliminated": false, - "score": 350 - }, - { - "name": "5H4D0W\\ G4RD3N", - "email": "qjoyal@gmail.com", - "university": "SLIIT", - "eliminated": false, - "score": 300 - }, - { - "name": "WeDoNotSow", - "email": "baqirhabeeb@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 225 - }, - { - "name": "The BroCode", - "email": "sasikasankalana321@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 200 - }, - { - "name": "MegaMinds", - "email": "kavindudamsith9@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 200 - }, - { - "name": "4bit", - "email": "patalee2001@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 150 - }, - { - "name": "iCoders", - "email": "sandaruwanwgma@gmail.com", - "university": "University of Moratuwa", - "eliminated": false, - "score": 150 - }, - { - "name": "FullBash/.", - "email": "wdilantha66@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 150 - }, - { - "name": "OneZero", - "email": "ravinduhapuarachchi@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 150 - }, - { - "name": "HackSquad", - "email": "nipunsandeepakck@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 150 - }, - { - "name": "Nasty_Owls", - "email": "yugantha1468@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 125 - }, - { - "name": "The X Order", - "email": "ashani.sansala16@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 125 - }, - { - "name": "Shell Warriors", - "email": "hirunaofficial@gmail.com", - "university": "ICBT", - "eliminated": true, - "score": 125 - }, - { - "name": "$cript_R0b0ts", - "email": "yasela2014@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 125 - }, - { - "name": "shiganshina :)", - "email": "wasath.vt@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 125 - }, - { - "name": "OneManArmy", - "email": "abdul.qadirv98@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 100 - }, - { - "name": "Marcopolo", - "email": "yashrashh05@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 100 - }, - { - "name": "11double0", - "email": "vidushsanidu07@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 100 - }, - { - "name": "BinaryBrilliance", - "email": "s19410@sci.pdn.ac.lk", - "university": "University of Peradeniya", - "eliminated": true, - "score": 100 - }, - { - "name": "mercode", - "email": "pathirana.sithmal@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 100 - }, - { - "name": "CATS", - "email": "samithkarunathilake@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 75 - }, - { - "name": "one-ticket-please", - "email": "adeeshamanthila@outlook.com", - "university": "IIT", - "eliminated": true, - "score": 75 - }, - { - "name": "Team 404", - "email": "weareteam404@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 75 - }, - { - "name": "Mugiwara", - "email": "shrikarsan@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 75 - }, - { - "name": "Code Conjurers", - "email": "supung.20@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 50 - }, - { - "name": "Hackhive", - "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", - "university": "SUSL", - "eliminated": true, - "score": 50 - }, - { - "name": "Bytes_Coders", - "email": "sonacode44@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 50 - }, - { - "name": "Coding Blinders", - "email": "codingblinders@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 25 - }, - { - "name": "ByteSpark", - "email": "mithilathilochanaj@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 25 - }, - { - "name": "Ruhuna 1.0", - "email": "nevaasahanmath@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 25 - }, - { - "name": "Runtime Terror", - "email": "lightspeed.runtime@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Team PhoeniXdeV", - "email": "sanuuthaya02@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "hackOne", - "email": "tekshanmadhawa324@gmail.com", - "university": "University of Jaffna", - "eliminated": true, - "score": 0 - }, - { - "name": "Access_denied", - "email": "maniltenuka@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "HARIS", - "email": "isuruvihan@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Error By Night", - "email": "it21206450@my.sliit.lk", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "A.A", - "email": "atheefofficial6@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "Debug Entity", - "email": "prasadnirmal2021@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "What_the_Hack", - "email": "whatthehack.sltc@gmail.com", - "university": "SLTC", - "eliminated": true, - "score": 0 - }, - { - "name": "Strikers", - "email": "sakithrandeev@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Geeks", - "email": "yasodalasiru@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Tech Titans", - "email": "techtitans444@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "I am Atomic", - "email": "chirathpansilu@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "tERROR ", - "email": "kavirangot@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Cyber Creepers", - "email": "glenperera2002@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Lambda Baryons", - "email": "baryonslambda@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Coding Owls", - "email": "chamodiindrejith14@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "PySquardCoders", - "email": "thasvithu7@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "SoloRider", - "email": "chirathb14@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "One2Seven", - "email": "udayanga.aj@outlook.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Kamino", - "email": "cst20004@std.uwu.ac.lk", - "university": "Uva Wellassa University", - "eliminated": true, - "score": 0 - }, - { - "name": "Meta Killers", - "email": "maleeshasparrow@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Code-Crafters", - "email": "navodyanethmi3@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Wizards", - "email": "codewizards123@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "CodeQuest", - "email": "lumini.20221981@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Scripters", - "email": "kanishkaekanayaka1004@outlook.com", - "university": "KDU", - "eliminated": true, - "score": 0 - }, - { - "name": "8 bit shrooms", - "email": "yasithasanjula2018@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Astronauts", - "email": "risithanadimal531@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "404 Not Found", - "email": "pasinduravimal@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Code Smokers", - "email": "madhawalakshan718@gmail.com", - "university": "EUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Binary Blitz", - "email": "binaryblitz50@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Scorpions", - "email": "contact.scorpions.info@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Head Hunters", - "email": "ranushmithila45@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "PowerInfinity#1", - "email": "powerinfinitypow@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "PowerTech", - "email": "powertechpow@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Blazers", - "email": "ryanpussadeniya@gmail.com", - "university": "USJ", - "eliminated": true, - "score": 0 - }, - { - "name": "Solo Scripting Sorcerer", - "email": "senadhee1999@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Rubber Ducky", - "email": "shathurshmanoharan@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Hugs 4 Bugs", - "email": "lasindumvp2001@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Dracode", - "email": "dracode0.0@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Automation", - "email": "sashinsirichandra@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Romio", - "email": "someshchandih@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Last Chance", - "email": "onaliy21@gmail.com", - "university": "NSBM", - "eliminated": true, - "score": 0 - }, - { - "name": "Meraki", - "email": "chamudisiriwardena@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Satan Slaves", - "email": "dilax.18@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "BinaryX", - "email": "dilshankavinda371@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "mCoders", - "email": "arwijesuriya.7@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "White Hats", - "email": "dinukaekanayaka18@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "InitialX", - "email": "minetheducation@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Tech Titanians", - "email": "techtitans2323@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Nova", - "email": "sanjulagathsara@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "v3nom", - "email": "it23195752@my.sliit.lk", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "hyperX", - "email": "koshala19299@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "Zyndicate", - "email": "nimeshshamika@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "AnonymousHat", - "email": "4n0nym0ush4t@gmail.com", - "university": "University of Kelaniya", - "eliminated": true, - "score": 0 - }, - { - "name": "BASH Picca", - "email": "banula.19@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "codeDRINKERS", - "email": "dulankabewardhana123@gmail.com", - "university": "University of Ruhuna", - "eliminated": true, - "score": 0 - }, - { - "name": "Team consoleLog", - "email": "veerasaravanan.20220157@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Janitha Prabodha", - "email": "janitha.20220212@iit.ac.lk", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "CodeCraft Samurai", - "email": "hashan_madusanka@outlook.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "Vangaurd", - "email": "cst21050@std.uwu.ac.lk", - "university": "Uva Wellassa University", - "eliminated": true, - "score": 0 - }, - { - "name": "Epic byte", - "email": "mnethmi27@gmail.com", - "university": "IIT", - "eliminated": true, - "score": 0 - }, - { - "name": "LEO", - "email": "leodassma@gmail.com", - "university": "University of Peradeniya", - "eliminated": true, - "score": 0 - }, - { - "name": "Redshifts", - "email": "lakindu.21@cse.mrt.ac.lk", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "DevXcreW", - "email": "sahanchandrasena462@gmail.com", - "university": "UCSC", - "eliminated": true, - "score": 0 - }, - { - "name": "Script_Kiddies", - "email": "himasharandil@gmail.com", - "university": "KDU", - "eliminated": true, - "score": 0 - }, - { - "name": "Hash_Coders", - "email": "anuththaradias27@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Team WEBMates", - "email": "thevendranvithursan@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "PixelPioneers", - "email": "shanika010712@gmail.com", - "university": "SUSL", - "eliminated": true, - "score": 0 - }, - { - "name": "Team Cygnus", - "email": "chamikasandaru01@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "URAQT", - "email": "gokulabisheak12@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "NoCode", - "email": "rajivapitiwaduge@gmail.com", - "university": "University of Moratuwa", - "eliminated": true, - "score": 0 - }, - { - "name": "Night Wings", - "email": "gihangajanayaka08@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "LuciferArchangel", - "email": "luminde9958@gmail.com", - "university": "University of Vavuniya", - "eliminated": true, - "score": 0 - }, - { - "name": "ALHAM", - "email": "alham@duck.com", - "university": "-", - "eliminated": true, - "score": 0 - }, - { - "name": "Team36T", - "email": "ramesharukshan3@gmail.com", - "university": "NIBM", - "eliminated": true, - "score": 0 - }, - { - "name": "A random team", - "email": "proushothkoushal@gmail.com", - "university": "NIBM", - "eliminated": true, - "score": 0 - }, - { - "name": "ByteBlaze", - "email": "pehandassanayaka@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - }, - { - "name": "The Council", - "email": "theogcouncillors@gmail.com", - "university": "SLIIT", - "eliminated": true, - "score": 0 - } -] +{ + "data": [ + { + "name": "TrackTech", + "email": "radith.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": false, + "score": 550 + }, + { + "name": "HereForTheBytes", + "email": "hereforthebytes@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 525 + }, + { + "name": "' OR 1=1 --", + "email": "nisaldasunpriya@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 525 + }, + { + "name": "REISUB", + "email": "nirmalsavinda29@gmail.com", + "university": "UCSC", + "eliminated": false, + "score": 350 + }, + { + "name": "5H4D0W\\ G4RD3N", + "email": "qjoyal@gmail.com", + "university": "SLIIT", + "eliminated": false, + "score": 300 + }, + { + "name": "WeDoNotSow", + "email": "baqirhabeeb@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 225 + }, + { + "name": "The BroCode", + "email": "sasikasankalana321@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 200 + }, + { + "name": "MegaMinds", + "email": "kavindudamsith9@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 200 + }, + { + "name": "4bit", + "email": "patalee2001@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 150 + }, + { + "name": "iCoders", + "email": "sandaruwanwgma@gmail.com", + "university": "University of Moratuwa", + "eliminated": false, + "score": 150 + }, + { + "name": "FullBash/.", + "email": "wdilantha66@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 150 + }, + { + "name": "OneZero", + "email": "ravinduhapuarachchi@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 150 + }, + { + "name": "HackSquad", + "email": "nipunsandeepakck@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 150 + }, + { + "name": "Nasty_Owls", + "email": "yugantha1468@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 125 + }, + { + "name": "The X Order", + "email": "ashani.sansala16@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 125 + }, + { + "name": "Shell Warriors", + "email": "hirunaofficial@gmail.com", + "university": "ICBT", + "eliminated": true, + "score": 125 + }, + { + "name": "$cript_R0b0ts", + "email": "yasela2014@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 125 + }, + { + "name": "shiganshina :)", + "email": "wasath.vt@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 125 + }, + { + "name": "OneManArmy", + "email": "abdul.qadirv98@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 100 + }, + { + "name": "Marcopolo", + "email": "yashrashh05@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 100 + }, + { + "name": "11double0", + "email": "vidushsanidu07@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 100 + }, + { + "name": "BinaryBrilliance", + "email": "s19410@sci.pdn.ac.lk", + "university": "University of Peradeniya", + "eliminated": true, + "score": 100 + }, + { + "name": "mercode", + "email": "pathirana.sithmal@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 100 + }, + { + "name": "CATS", + "email": "samithkarunathilake@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "one-ticket-please", + "email": "adeeshamanthila@outlook.com", + "university": "IIT", + "eliminated": true, + "score": 75 + }, + { + "name": "Team 404", + "email": "weareteam404@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "Mugiwara", + "email": "shrikarsan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 75 + }, + { + "name": "Code Conjurers", + "email": "supung.20@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 50 + }, + { + "name": "Hackhive", + "email": "hmsvhettiarachchi@std.foc.sab.ac.lk", + "university": "SUSL", + "eliminated": true, + "score": 50 + }, + { + "name": "Bytes_Coders", + "email": "sonacode44@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 50 + }, + { + "name": "Coding Blinders", + "email": "codingblinders@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 25 + }, + { + "name": "ByteSpark", + "email": "mithilathilochanaj@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 25 + }, + { + "name": "Ruhuna 1.0", + "email": "nevaasahanmath@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 25 + }, + { + "name": "Runtime Terror", + "email": "lightspeed.runtime@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Team PhoeniXdeV", + "email": "sanuuthaya02@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hackOne", + "email": "tekshanmadhawa324@gmail.com", + "university": "University of Jaffna", + "eliminated": true, + "score": 0 + }, + { + "name": "Access_denied", + "email": "maniltenuka@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "HARIS", + "email": "isuruvihan@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Error By Night", + "email": "it21206450@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "A.A", + "email": "atheefofficial6@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Debug Entity", + "email": "prasadnirmal2021@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "What_the_Hack", + "email": "whatthehack.sltc@gmail.com", + "university": "SLTC", + "eliminated": true, + "score": 0 + }, + { + "name": "Strikers", + "email": "sakithrandeev@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Geeks", + "email": "yasodalasiru@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titans", + "email": "techtitans444@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "I am Atomic", + "email": "chirathpansilu@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "tERROR ", + "email": "kavirangot@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Cyber Creepers", + "email": "glenperera2002@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Lambda Baryons", + "email": "baryonslambda@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Coding Owls", + "email": "chamodiindrejith14@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "PySquardCoders", + "email": "thasvithu7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "SoloRider", + "email": "chirathb14@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "One2Seven", + "email": "udayanga.aj@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Kamino", + "email": "cst20004@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Meta Killers", + "email": "maleeshasparrow@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Code-Crafters", + "email": "navodyanethmi3@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Wizards", + "email": "codewizards123@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeQuest", + "email": "lumini.20221981@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scripters", + "email": "kanishkaekanayaka1004@outlook.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "8 bit shrooms", + "email": "yasithasanjula2018@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Astronauts", + "email": "risithanadimal531@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "404 Not Found", + "email": "pasinduravimal@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Code Smokers", + "email": "madhawalakshan718@gmail.com", + "university": "EUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Binary Blitz", + "email": "binaryblitz50@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Scorpions", + "email": "contact.scorpions.info@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Head Hunters", + "email": "ranushmithila45@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerInfinity#1", + "email": "powerinfinitypow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PowerTech", + "email": "powertechpow@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Blazers", + "email": "ryanpussadeniya@gmail.com", + "university": "USJ", + "eliminated": true, + "score": 0 + }, + { + "name": "Solo Scripting Sorcerer", + "email": "senadhee1999@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Rubber Ducky", + "email": "shathurshmanoharan@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Hugs 4 Bugs", + "email": "lasindumvp2001@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Dracode", + "email": "dracode0.0@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Automation", + "email": "sashinsirichandra@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Romio", + "email": "someshchandih@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Last Chance", + "email": "onaliy21@gmail.com", + "university": "NSBM", + "eliminated": true, + "score": 0 + }, + { + "name": "Meraki", + "email": "chamudisiriwardena@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Satan Slaves", + "email": "dilax.18@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "BinaryX", + "email": "dilshankavinda371@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "mCoders", + "email": "arwijesuriya.7@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "White Hats", + "email": "dinukaekanayaka18@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "InitialX", + "email": "minetheducation@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Tech Titanians", + "email": "techtitans2323@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Nova", + "email": "sanjulagathsara@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "v3nom", + "email": "it23195752@my.sliit.lk", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "hyperX", + "email": "koshala19299@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Zyndicate", + "email": "nimeshshamika@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "AnonymousHat", + "email": "4n0nym0ush4t@gmail.com", + "university": "University of Kelaniya", + "eliminated": true, + "score": 0 + }, + { + "name": "BASH Picca", + "email": "banula.19@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "codeDRINKERS", + "email": "dulankabewardhana123@gmail.com", + "university": "University of Ruhuna", + "eliminated": true, + "score": 0 + }, + { + "name": "Team consoleLog", + "email": "veerasaravanan.20220157@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Janitha Prabodha", + "email": "janitha.20220212@iit.ac.lk", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "CodeCraft Samurai", + "email": "hashan_madusanka@outlook.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "Vangaurd", + "email": "cst21050@std.uwu.ac.lk", + "university": "Uva Wellassa University", + "eliminated": true, + "score": 0 + }, + { + "name": "Epic byte", + "email": "mnethmi27@gmail.com", + "university": "IIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LEO", + "email": "leodassma@gmail.com", + "university": "University of Peradeniya", + "eliminated": true, + "score": 0 + }, + { + "name": "Redshifts", + "email": "lakindu.21@cse.mrt.ac.lk", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "DevXcreW", + "email": "sahanchandrasena462@gmail.com", + "university": "UCSC", + "eliminated": true, + "score": 0 + }, + { + "name": "Script_Kiddies", + "email": "himasharandil@gmail.com", + "university": "KDU", + "eliminated": true, + "score": 0 + }, + { + "name": "Hash_Coders", + "email": "anuththaradias27@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Team WEBMates", + "email": "thevendranvithursan@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "PixelPioneers", + "email": "shanika010712@gmail.com", + "university": "SUSL", + "eliminated": true, + "score": 0 + }, + { + "name": "Team Cygnus", + "email": "chamikasandaru01@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "URAQT", + "email": "gokulabisheak12@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "NoCode", + "email": "rajivapitiwaduge@gmail.com", + "university": "University of Moratuwa", + "eliminated": true, + "score": 0 + }, + { + "name": "Night Wings", + "email": "gihangajanayaka08@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "LuciferArchangel", + "email": "luminde9958@gmail.com", + "university": "University of Vavuniya", + "eliminated": true, + "score": 0 + }, + { + "name": "ALHAM", + "email": "alham@duck.com", + "university": "-", + "eliminated": true, + "score": 0 + }, + { + "name": "Team36T", + "email": "ramesharukshan3@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "A random team", + "email": "proushothkoushal@gmail.com", + "university": "NIBM", + "eliminated": true, + "score": 0 + }, + { + "name": "ByteBlaze", + "email": "pehandassanayaka@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + }, + { + "name": "The Council", + "email": "theogcouncillors@gmail.com", + "university": "SLIIT", + "eliminated": true, + "score": 0 + } + ] +} diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index b6088c7..b89f29d 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -1,10 +1,10 @@ import { useState } from "react"; import { RxCross1, RxHamburgerMenu } from "react-icons/rx"; import { Link } from "react-router-dom"; -import { useLocation } from "react-router-dom"; import { twMerge } from "tailwind-merge"; import { portalURL } from "@/constants"; import { useBreakpoint } from "@/hooks"; +import useDetectHallOfFame from "@/hooks/detect-hall-of-fame"; import { BashawayLeaderboard } from "@/icons"; import { AnimatedSwitcher, Button } from "@sliit-foss/bashaway-ui/components"; import { Bashaway, FOSS, Link as LinkIcon, Times } from "@sliit-foss/bashaway-ui/icons"; @@ -17,9 +17,7 @@ const buttonStyles = "mt-1.5 xl:mt-0 px-8 xl:px-[1.15rem] pb-2.5 xl:pb-[0.4rem] const Header = ({ className }) => { const [mobileNavOpen, setMobileNavOpen] = useState(false); const breakpoints = useBreakpoint(); - - const location = useLocation(); - const isHallOfFame = location.pathname === "/hall-of-fame"; + const isHallOfFame = useDetectHallOfFame(); return (
{ + const [isHallOfFame, setIsHallOfFame] = useState(false); + const { pathname } = useLocation(); + + useEffect(() => { + setIsHallOfFame(pathname == "hall-of-fame"); + }, [pathname]); + + return isHallOfFame; +}; + +export default useDetectHallOfFame; diff --git a/src/hooks/past-data.jsx b/src/hooks/past-data.jsx index c236c07..6456e38 100644 --- a/src/hooks/past-data.jsx +++ b/src/hooks/past-data.jsx @@ -12,7 +12,7 @@ const usePastData = ({ round, ghostLegion, year = 2023 }) => { let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; const data = (await import(`../../data/annual-leaderboard/${year}/${path}.json`)).default; // console.log('Before mapping', data); - const transformedData = data.map((item, index) => ({ ...item, place: index + 1 })); + const transformedData = data.data.map((item, index) => ({ ...item, place: index + 1 })); // console.log('After mapping', data); setPastData(transformedData); }; diff --git a/src/pages/home.jsx b/src/pages/home.jsx index abf61f7..1ab227f 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -4,7 +4,8 @@ import { ScoreCardSkeleton } from "@/components"; import { ScoreCard } from "@/components/home"; import { filters as filterData, sorts as sortData } from "@/filters"; import { useTitle } from "@/hooks"; -import { useFetchLeaderboardQuery } from "@/store/api"; +import useDetectHallOfFame from "@/hooks/detect-hall-of-fame"; +import { useFetchPastLeaderboardsQuery } from "@/store/api"; import { AnimatedSwitcher, Filters, @@ -22,13 +23,15 @@ const Home = () => { const [page, setPage] = useState(1); const [filters, setFilters] = useState(computeFilterQuery(filterData)); const [sorts, setSorts] = useState(computeSortQuery(sortData)); - const { rounds, round, roundKey, onRoundChange } = useRound(); - const { ghostLegion, toggleGhostLegion } = useGhostLegion(); + const isHallOfFame = useDetectHallOfFame(); - const { data: scores, isFetching } = useFetchLeaderboardQuery({ page, filters, sorts, round, ghostLegion }); + // const { data: scores, isFetching } = useFetchLeaderboardQuery({ page, filters, sorts, round, ghostLegion }); + const { data: scores, isFetching } = useFetchPastLeaderboardsQuery({ page, filters, sorts, round, ghostLegion }); + console.log("The scores is fetching", isFetching, "\n scores are", scores); + useEffect(() => {}, [isHallOfFame]); useEffect(() => { if (page !== 1) setPage(1); }, [filters, sorts, round, ghostLegion]); @@ -72,7 +75,7 @@ const Home = () => { } alternateComponent={ diff --git a/src/routes/index.jsx b/src/routes/index.jsx index 19fa51b..f6b0027 100644 --- a/src/routes/index.jsx +++ b/src/routes/index.jsx @@ -1,6 +1,6 @@ import { Route, Routes, useLocation } from "react-router-dom"; import { AnimatePresence } from "framer-motion"; -import { HallOfFame, Home, NotFound } from "@/pages"; +import { Home, NotFound } from "@/pages"; const AnimatedRoutes = () => { const location = useLocation(); @@ -8,7 +8,7 @@ const AnimatedRoutes = () => { } /> - } /> + } /> } /> diff --git a/src/store/api/leaderboard.js b/src/store/api/leaderboard.js index 50ef0fc..795ba85 100644 --- a/src/store/api/leaderboard.js +++ b/src/store/api/leaderboard.js @@ -1,7 +1,6 @@ import { createApi } from "@reduxjs/toolkit/query/react"; -import { orderBy } from "lodash"; -import { isRegex } from "@/utils"; import baseQuery from "./base"; +import transformLeaderboardData from "./transformer"; export const leaderboardApi = createApi({ reducerPath: "leaderboardApi", @@ -9,41 +8,26 @@ export const leaderboardApi = createApi({ endpoints: (builder) => ({ fetchLeaderboard: builder.query({ query: ({ round, ghostLegion }) => `/api/leaderboard?round=${round}&ghost_legion=${ghostLegion}`, - transformResponse: (response, _, arg) => { - const { page, filters, sorts } = arg; - response.data = response.data.map((item, index) => ({ ...item, place: index + 1 })); - filters?.split("&").forEach((filter) => { - let [key, value] = filter.split("="); - key = key.replace("filter[", "").replace("]", ""); - response.data = response.data.filter((item) => - isRegex(value) ? item[key].match(new RegExp(value.slice(1, -1), "i")) : item[key] === value - ); - }); - if (sorts) { - const [keys, values] = sorts.split("&").reduce( - (acc, sort) => { - let [key, value] = sort.split("="); - key = key.replace("sort[", "").replace("]", ""); - acc[0].push(key); - acc[1].push(value === "1" ? "asc" : "desc"); - return acc; - }, - [[], []] - ); - response.data = orderBy(response.data, keys, values); + transformResponse: transformLeaderboardData + }), + fetchPastLeaderboards: builder.query({ + queryFn: async ({ year = 2023, round, ghostLegion, page, filters, sorts }) => { + let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; + try { + const data = await import(`../../../data/annual-leaderboard/${year}/${path}.json`); + const transformedData = transformLeaderboardData(data.default, undefined, { page, filters, sorts }); + return { data: transformedData }; + } catch (error) { + console.log("Failed to fetch data dynamically"); } - const totalPages = Math.ceil(response.data.length / 10); - response.data = response.data.slice((page - 1) * 10, page * 10); - return { - data: { - docs: response.data, - totalPages - }, - message: response.message - }; } }) }) }); -export const { useFetchLeaderboardQuery, useLazyFetchLeaderboardQuery } = leaderboardApi; +export const { + useFetchLeaderboardQuery, + useLazyFetchLeaderboardQuery, + useFetchPastLeaderboardsQuery, + useLazyFetchPastLeaderboardsQuery +} = leaderboardApi; diff --git a/src/store/api/transformer.js b/src/store/api/transformer.js new file mode 100644 index 0000000..d55ddde --- /dev/null +++ b/src/store/api/transformer.js @@ -0,0 +1,38 @@ +import { orderBy } from "lodash"; +import { isRegex } from "@/utils"; + +const transformLeaderboardData = (response, _, arg) => { + const { page, filters, sorts } = arg; + response.data = response.data.map((item, index) => ({ ...item, place: index + 1 })); + filters?.split("&").forEach((filter) => { + let [key, value] = filter.split("="); + key = key.replace("filter[", "").replace("]", ""); + response.data = response.data.filter((item) => + isRegex(value) ? item[key].match(new RegExp(value.slice(1, -1), "i")) : item[key] === value + ); + }); + if (sorts) { + const [keys, values] = sorts.split("&").reduce( + (acc, sort) => { + let [key, value] = sort.split("="); + key = key.replace("sort[", "").replace("]", ""); + acc[0].push(key); + acc[1].push(value === "1" ? "asc" : "desc"); + return acc; + }, + [[], []] + ); + response.data = orderBy(response.data, keys, values); + } + const totalPages = Math.ceil(response.data.length / 10); + response.data = response.data.slice((page - 1) * 10, page * 10); + return { + data: { + docs: response.data, + totalPages + }, + message: response.message + }; +}; + +export default transformLeaderboardData; From 61d6478c0ae7d597394b0aa0baf19259f067d64f Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 23:53:16 +0530 Subject: [PATCH 06/16] Fix(lefthook): modify lefthook to only lint,format staged files --- lefthook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lefthook.yml b/lefthook.yml index 7f5a84c..c6b2f0f 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -3,10 +3,10 @@ pre-commit: commands: format: glob: "*.{js,ts,jsx}" - run: npm run format && git add . + run: npm run format {staged_files} lint: glob: "*.{js,ts,jsx}" - run: npm run lint && git add . + run: npm run lint {staged_files} commit-msg: commands: From d5e85f97f530fa7115509b517481a1e14cf60770 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 23:54:19 +0530 Subject: [PATCH 07/16] Fix(hooks): minor fixes in useDetectHallOfFame --- src/hooks/detect-hall-of-fame.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hooks/detect-hall-of-fame.jsx b/src/hooks/detect-hall-of-fame.jsx index 9341fa5..07d0cff 100644 --- a/src/hooks/detect-hall-of-fame.jsx +++ b/src/hooks/detect-hall-of-fame.jsx @@ -1,14 +1,13 @@ import { useEffect } from "react"; import { useState } from "react"; - -const { useLocation } = require("react-router-dom"); +import { useLocation } from "react-router-dom"; const useDetectHallOfFame = () => { const [isHallOfFame, setIsHallOfFame] = useState(false); const { pathname } = useLocation(); useEffect(() => { - setIsHallOfFame(pathname == "hall-of-fame"); + setIsHallOfFame(pathname == "/hall-of-fame"); }, [pathname]); return isHallOfFame; From fc75852b5e910acee9dc1f4cfb9825d5bb38572d Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Sun, 18 Aug 2024 23:57:05 +0530 Subject: [PATCH 08/16] Refactor: use a separate page for hall of fame --- src/pages/hall-of-fame.jsx | 14 ++++++-------- src/pages/home.jsx | 13 ++++--------- src/routes/index.jsx | 4 ++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx index 4c7cb95..b5dcf9a 100644 --- a/src/pages/hall-of-fame.jsx +++ b/src/pages/hall-of-fame.jsx @@ -4,7 +4,7 @@ import { ScoreCardSkeleton } from "@/components"; import { ScoreCard } from "@/components/home"; import { filters as filterData, sorts as sortData } from "@/filters"; import { useTitle } from "@/hooks"; -import usePastData from "@/hooks/past-data"; +import { useFetchPastLeaderboardsQuery } from "@/store/api"; import { AnimatedSwitcher, Filters, @@ -22,12 +22,10 @@ const HallOfFame = () => { const [page, setPage] = useState(1); const [filters, setFilters] = useState(computeFilterQuery(filterData)); const [sorts, setSorts] = useState(computeSortQuery(sortData)); + const { rounds, round, roundKey, onRoundChange } = useRound(); const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - const scores = usePastData({ - round, - ghostLegion - }); + const { data: scores, isFetching } = useFetchPastLeaderboardsQuery({ page, filters, sorts, round, ghostLegion }); useEffect(() => { if (page !== 1) setPage(1); @@ -72,13 +70,13 @@ const HallOfFame = () => { } alternateComponent={ - scores?.length ? ( + scores?.data?.docs?.length ? ( <> - {scores.map((item, index) => ( + {scores.data.docs.map((item, index) => ( ))} diff --git a/src/pages/home.jsx b/src/pages/home.jsx index 1ab227f..a664db0 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -4,8 +4,7 @@ import { ScoreCardSkeleton } from "@/components"; import { ScoreCard } from "@/components/home"; import { filters as filterData, sorts as sortData } from "@/filters"; import { useTitle } from "@/hooks"; -import useDetectHallOfFame from "@/hooks/detect-hall-of-fame"; -import { useFetchPastLeaderboardsQuery } from "@/store/api"; +import { useFetchLeaderboardQuery } from "@/store/api"; import { AnimatedSwitcher, Filters, @@ -23,15 +22,11 @@ const Home = () => { const [page, setPage] = useState(1); const [filters, setFilters] = useState(computeFilterQuery(filterData)); const [sorts, setSorts] = useState(computeSortQuery(sortData)); + const { rounds, round, roundKey, onRoundChange } = useRound(); const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - const isHallOfFame = useDetectHallOfFame(); - - // const { data: scores, isFetching } = useFetchLeaderboardQuery({ page, filters, sorts, round, ghostLegion }); - const { data: scores, isFetching } = useFetchPastLeaderboardsQuery({ page, filters, sorts, round, ghostLegion }); - console.log("The scores is fetching", isFetching, "\n scores are", scores); + const { data: scores, isFetching } = useFetchLeaderboardQuery({ page, filters, sorts, round, ghostLegion }); - useEffect(() => {}, [isHallOfFame]); useEffect(() => { if (page !== 1) setPage(1); }, [filters, sorts, round, ghostLegion]); @@ -75,7 +70,7 @@ const Home = () => { } alternateComponent={ diff --git a/src/routes/index.jsx b/src/routes/index.jsx index f6b0027..19fa51b 100644 --- a/src/routes/index.jsx +++ b/src/routes/index.jsx @@ -1,6 +1,6 @@ import { Route, Routes, useLocation } from "react-router-dom"; import { AnimatePresence } from "framer-motion"; -import { Home, NotFound } from "@/pages"; +import { HallOfFame, Home, NotFound } from "@/pages"; const AnimatedRoutes = () => { const location = useLocation(); @@ -8,7 +8,7 @@ const AnimatedRoutes = () => { } /> - } /> + } /> } /> From 198b3fe3ea747f105ef2e7b68d7a494633a6e4ac Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Mon, 19 Aug 2024 00:30:51 +0530 Subject: [PATCH 09/16] Refactor: remove unused code --- src/hooks/past-data.jsx | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/hooks/past-data.jsx diff --git a/src/hooks/past-data.jsx b/src/hooks/past-data.jsx deleted file mode 100644 index 6456e38..0000000 --- a/src/hooks/past-data.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import { useEffect, useState } from "react"; - -// TODO: add pagination -// TODO: add sorting -// TODO: add searcg -// TODO: explore the possibility of reusing The leaderboard API s response tranform function -const usePastData = ({ round, ghostLegion, year = 2023 }) => { - const [pastData, setPastData] = useState({}); - - useEffect(() => { - const fetchPastLeaderboadData = async () => { - let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; - const data = (await import(`../../data/annual-leaderboard/${year}/${path}.json`)).default; - // console.log('Before mapping', data); - const transformedData = data.data.map((item, index) => ({ ...item, place: index + 1 })); - // console.log('After mapping', data); - setPastData(transformedData); - }; - - fetchPastLeaderboadData(); - }, [round, ghostLegion]); - - return pastData; -}; - -export default usePastData; From 7b5ffec83b7ffe1903d80728247312c137374259 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Mon, 19 Aug 2024 23:05:23 +0530 Subject: [PATCH 10/16] Refactor: move data to constants --- {data => src/constants}/annual-leaderboard/2023/final.json | 0 {data => src/constants}/annual-leaderboard/2023/ghost-legion.json | 0 {data => src/constants}/annual-leaderboard/2023/round1.json | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {data => src/constants}/annual-leaderboard/2023/final.json (100%) rename {data => src/constants}/annual-leaderboard/2023/ghost-legion.json (100%) rename {data => src/constants}/annual-leaderboard/2023/round1.json (100%) diff --git a/data/annual-leaderboard/2023/final.json b/src/constants/annual-leaderboard/2023/final.json similarity index 100% rename from data/annual-leaderboard/2023/final.json rename to src/constants/annual-leaderboard/2023/final.json diff --git a/data/annual-leaderboard/2023/ghost-legion.json b/src/constants/annual-leaderboard/2023/ghost-legion.json similarity index 100% rename from data/annual-leaderboard/2023/ghost-legion.json rename to src/constants/annual-leaderboard/2023/ghost-legion.json diff --git a/data/annual-leaderboard/2023/round1.json b/src/constants/annual-leaderboard/2023/round1.json similarity index 100% rename from data/annual-leaderboard/2023/round1.json rename to src/constants/annual-leaderboard/2023/round1.json From fd80f49384a3c94f29fc55d39f75ad9e6e7b1f96 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Mon, 19 Aug 2024 23:09:48 +0530 Subject: [PATCH 11/16] Refactor(hall-of-flame): update dynamic import path, fix pass by ref and format code --- src/store/api/{leaderboard.js => leaderboard/index.js} | 9 +++++---- src/store/api/{ => leaderboard}/transformer.js | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) rename src/store/api/{leaderboard.js => leaderboard/index.js} (78%) rename src/store/api/{ => leaderboard}/transformer.js (98%) diff --git a/src/store/api/leaderboard.js b/src/store/api/leaderboard/index.js similarity index 78% rename from src/store/api/leaderboard.js rename to src/store/api/leaderboard/index.js index 795ba85..68f8094 100644 --- a/src/store/api/leaderboard.js +++ b/src/store/api/leaderboard/index.js @@ -1,5 +1,5 @@ import { createApi } from "@reduxjs/toolkit/query/react"; -import baseQuery from "./base"; +import baseQuery from "../base"; import transformLeaderboardData from "./transformer"; export const leaderboardApi = createApi({ @@ -13,14 +13,15 @@ export const leaderboardApi = createApi({ fetchPastLeaderboards: builder.query({ queryFn: async ({ year = 2023, round, ghostLegion, page, filters, sorts }) => { let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; + try { - const data = await import(`../../../data/annual-leaderboard/${year}/${path}.json`); - const transformedData = transformLeaderboardData(data.default, undefined, { page, filters, sorts }); + const data = await import(`../../../constants/annual-leaderboard/${year}/${path}.json`); + const transformedData = transformLeaderboardData({...(data.default)}, undefined, { page, filters, sorts }); return { data: transformedData }; } catch (error) { console.log("Failed to fetch data dynamically"); } - } + }, }) }) }); diff --git a/src/store/api/transformer.js b/src/store/api/leaderboard/transformer.js similarity index 98% rename from src/store/api/transformer.js rename to src/store/api/leaderboard/transformer.js index d55ddde..8f71142 100644 --- a/src/store/api/transformer.js +++ b/src/store/api/leaderboard/transformer.js @@ -3,14 +3,18 @@ import { isRegex } from "@/utils"; const transformLeaderboardData = (response, _, arg) => { const { page, filters, sorts } = arg; + response.data = response.data.map((item, index) => ({ ...item, place: index + 1 })); + filters?.split("&").forEach((filter) => { let [key, value] = filter.split("="); key = key.replace("filter[", "").replace("]", ""); + response.data = response.data.filter((item) => isRegex(value) ? item[key].match(new RegExp(value.slice(1, -1), "i")) : item[key] === value ); }); + if (sorts) { const [keys, values] = sorts.split("&").reduce( (acc, sort) => { @@ -22,10 +26,13 @@ const transformLeaderboardData = (response, _, arg) => { }, [[], []] ); + response.data = orderBy(response.data, keys, values); } + const totalPages = Math.ceil(response.data.length / 10); response.data = response.data.slice((page - 1) * 10, page * 10); + return { data: { docs: response.data, From ced050bf9e3e1288a72fb3d480faf3327eeda702 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Mon, 19 Aug 2024 23:12:29 +0530 Subject: [PATCH 12/16] Fix(hall-of-flame): fix pass by reference issue --- src/store/api/leaderboard/index.js | 6 +++--- src/store/api/leaderboard/transformer.js | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/store/api/leaderboard/index.js b/src/store/api/leaderboard/index.js index 68f8094..d1fab76 100644 --- a/src/store/api/leaderboard/index.js +++ b/src/store/api/leaderboard/index.js @@ -13,15 +13,15 @@ export const leaderboardApi = createApi({ fetchPastLeaderboards: builder.query({ queryFn: async ({ year = 2023, round, ghostLegion, page, filters, sorts }) => { let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; - + try { const data = await import(`../../../constants/annual-leaderboard/${year}/${path}.json`); - const transformedData = transformLeaderboardData({...(data.default)}, undefined, { page, filters, sorts }); + const transformedData = transformLeaderboardData({ ...data.default }, undefined, { page, filters, sorts }); return { data: transformedData }; } catch (error) { console.log("Failed to fetch data dynamically"); } - }, + } }) }) }); diff --git a/src/store/api/leaderboard/transformer.js b/src/store/api/leaderboard/transformer.js index 8f71142..1d42b5b 100644 --- a/src/store/api/leaderboard/transformer.js +++ b/src/store/api/leaderboard/transformer.js @@ -3,18 +3,18 @@ import { isRegex } from "@/utils"; const transformLeaderboardData = (response, _, arg) => { const { page, filters, sorts } = arg; - + response.data = response.data.map((item, index) => ({ ...item, place: index + 1 })); - + filters?.split("&").forEach((filter) => { let [key, value] = filter.split("="); key = key.replace("filter[", "").replace("]", ""); - + response.data = response.data.filter((item) => isRegex(value) ? item[key].match(new RegExp(value.slice(1, -1), "i")) : item[key] === value ); }); - + if (sorts) { const [keys, values] = sorts.split("&").reduce( (acc, sort) => { @@ -26,13 +26,13 @@ const transformLeaderboardData = (response, _, arg) => { }, [[], []] ); - + response.data = orderBy(response.data, keys, values); } - + const totalPages = Math.ceil(response.data.length / 10); response.data = response.data.slice((page - 1) * 10, page * 10); - + return { data: { docs: response.data, From 18826dbef7fadd66deb48f7427e96e78cc5ae6e3 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Mon, 19 Aug 2024 23:14:57 +0530 Subject: [PATCH 13/16] Feat(hall-of-flame): update content and minor style fixes --- src/components/layout/header.jsx | 5 ++--- src/pages/hall-of-fame.jsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index b89f29d..d952580 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -72,16 +72,15 @@ const Header = ({ className }) => { to={isHallOfFame ? "/" : "/hall-of-fame"} onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })} aria-label="Home" - className="hidden xsm:flex gap-2" + className="ml-[-1.6125rem] gap-2" >
{isHallOfFame ? "Leaderboard" : "Hall of Fame"} -
diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx index b5dcf9a..fa4e8aa 100644 --- a/src/pages/hall-of-fame.jsx +++ b/src/pages/hall-of-fame.jsx @@ -31,7 +31,7 @@ const HallOfFame = () => { if (page !== 1) setPage(1); }, [filters, sorts, round, ghostLegion]); - useTitle("Leaderboard | Bashaway"); + useTitle("Hall of Fame | Bashaway"); return ( <> @@ -39,7 +39,7 @@ const HallOfFame = () => {
Hall of Fame 2023 - A tribute to legendary warriors + A tribute to legendary warriors who once marched amongst us with unwavering valour
From e15278ad52c8d9d5eb0e31e5a3b6eeff68bea5b0 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Tue, 20 Aug 2024 00:51:37 +0530 Subject: [PATCH 14/16] Refactor: extract common code into score-board component --- lefthook.yml | 4 +- src/components/home/score-board/index.jsx | 101 ++++++++++++++++++++++ src/pages/hall-of-fame.jsx | 101 ++-------------------- src/pages/home.jsx | 101 ++-------------------- 4 files changed, 117 insertions(+), 190 deletions(-) create mode 100644 src/components/home/score-board/index.jsx diff --git a/lefthook.yml b/lefthook.yml index c6b2f0f..f0cad28 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -3,10 +3,10 @@ pre-commit: commands: format: glob: "*.{js,ts,jsx}" - run: npm run format {staged_files} + run: npm run format {staged_files} && git add {staged_files} lint: glob: "*.{js,ts,jsx}" - run: npm run lint {staged_files} + run: npm run lint {staged_files} && git add {staged_files} commit-msg: commands: diff --git a/src/components/home/score-board/index.jsx b/src/components/home/score-board/index.jsx new file mode 100644 index 0000000..aa6b33c --- /dev/null +++ b/src/components/home/score-board/index.jsx @@ -0,0 +1,101 @@ +import { useEffect, useState } from "react"; +import { twMerge } from "tailwind-merge"; +import { ScoreCardSkeleton } from "@/components"; +import { ScoreCard } from "@/components/home"; +import { filters as filterData, sorts as sortData } from "@/filters"; +import { useTitle } from "@/hooks"; +import { + AnimatedSwitcher, + Filters, + NoRecords, + Pagination, + Sorts, + TwinSwitch +} from "@sliit-foss/bashaway-ui/components"; +import { useGhostLegion, useRound } from "@sliit-foss/bashaway-ui/hooks"; +import { Ghost } from "@sliit-foss/bashaway-ui/icons"; +import { Footnote, Title } from "@sliit-foss/bashaway-ui/typography"; +import { computeFilterQuery, computeSortQuery } from "@sliit-foss/bashaway-ui/utils"; + +const ScoreBoard = ({ pageTitle, title, subTitle, useFetchData }) => { + const [page, setPage] = useState(1); + const [filters, setFilters] = useState(computeFilterQuery(filterData)); + const [sorts, setSorts] = useState(computeSortQuery(sortData)); + + const { rounds, round, roundKey, onRoundChange } = useRound(); + const { ghostLegion, toggleGhostLegion } = useGhostLegion(); + const { data: scores, isFetching } = useFetchData({ page, filters, sorts, round, ghostLegion }); + + useEffect(() => { + if (page !== 1) setPage(1); + }, [filters, sorts, round, ghostLegion]); + + useTitle(pageTitle); + + return ( + <> +
+
+ {title} + + {subTitle} + + +
+
+ +
+
+ + Ghost Legion + + +
+ +
+
+ } + alternateComponent={ + scores?.data?.docs?.length ? ( + <> + {scores.data.docs.map((item, index) => ( + + ))} + + ) : ( +
+ +
+ ) + } + /> +
+ setPage(newPage)} + totalPages={scores?.data?.totalPages} + /> +
+
+ + ); +}; + +export default ScoreBoard; diff --git a/src/pages/hall-of-fame.jsx b/src/pages/hall-of-fame.jsx index fa4e8aa..d396655 100644 --- a/src/pages/hall-of-fame.jsx +++ b/src/pages/hall-of-fame.jsx @@ -1,101 +1,14 @@ -import { useEffect, useState } from "react"; -import { twMerge } from "tailwind-merge"; -import { ScoreCardSkeleton } from "@/components"; -import { ScoreCard } from "@/components/home"; -import { filters as filterData, sorts as sortData } from "@/filters"; -import { useTitle } from "@/hooks"; +import ScoreBoard from "@/components/home/score-board"; import { useFetchPastLeaderboardsQuery } from "@/store/api"; -import { - AnimatedSwitcher, - Filters, - NoRecords, - Pagination, - Sorts, - TwinSwitch -} from "@sliit-foss/bashaway-ui/components"; -import { useGhostLegion, useRound } from "@sliit-foss/bashaway-ui/hooks"; -import { Ghost } from "@sliit-foss/bashaway-ui/icons"; -import { Footnote, Title } from "@sliit-foss/bashaway-ui/typography"; -import { computeFilterQuery, computeSortQuery } from "@sliit-foss/bashaway-ui/utils"; const HallOfFame = () => { - const [page, setPage] = useState(1); - const [filters, setFilters] = useState(computeFilterQuery(filterData)); - const [sorts, setSorts] = useState(computeSortQuery(sortData)); - - const { rounds, round, roundKey, onRoundChange } = useRound(); - const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - const { data: scores, isFetching } = useFetchPastLeaderboardsQuery({ page, filters, sorts, round, ghostLegion }); - - useEffect(() => { - if (page !== 1) setPage(1); - }, [filters, sorts, round, ghostLegion]); - - useTitle("Hall of Fame | Bashaway"); - return ( - <> -
-
- Hall of Fame 2023 - - A tribute to legendary warriors who once marched amongst us with unwavering valour - - -
-
- -
-
- - Ghost Legion - - -
- -
-
- } - alternateComponent={ - scores?.data?.docs?.length ? ( - <> - {scores.data.docs.map((item, index) => ( - - ))} - - ) : ( -
- -
- ) - } - /> -
- setPage(newPage)} - totalPages={scores?.data?.totalPages} - /> -
-
- + ); }; diff --git a/src/pages/home.jsx b/src/pages/home.jsx index a664db0..47540bf 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -1,101 +1,14 @@ -import { useEffect, useState } from "react"; -import { twMerge } from "tailwind-merge"; -import { ScoreCardSkeleton } from "@/components"; -import { ScoreCard } from "@/components/home"; -import { filters as filterData, sorts as sortData } from "@/filters"; -import { useTitle } from "@/hooks"; +import ScoreBoard from "@/components/home/score-board"; import { useFetchLeaderboardQuery } from "@/store/api"; -import { - AnimatedSwitcher, - Filters, - NoRecords, - Pagination, - Sorts, - TwinSwitch -} from "@sliit-foss/bashaway-ui/components"; -import { useGhostLegion, useRound } from "@sliit-foss/bashaway-ui/hooks"; -import { Ghost } from "@sliit-foss/bashaway-ui/icons"; -import { Footnote, Title } from "@sliit-foss/bashaway-ui/typography"; -import { computeFilterQuery, computeSortQuery } from "@sliit-foss/bashaway-ui/utils"; const Home = () => { - const [page, setPage] = useState(1); - const [filters, setFilters] = useState(computeFilterQuery(filterData)); - const [sorts, setSorts] = useState(computeSortQuery(sortData)); - - const { rounds, round, roundKey, onRoundChange } = useRound(); - const { ghostLegion, toggleGhostLegion } = useGhostLegion(); - const { data: scores, isFetching } = useFetchLeaderboardQuery({ page, filters, sorts, round, ghostLegion }); - - useEffect(() => { - if (page !== 1) setPage(1); - }, [filters, sorts, round, ghostLegion]); - - useTitle("Leaderboard | Bashaway"); - return ( - <> -
-
- The Leaderboard - - A place where your true colors show off despite all the differences - - -
-
- -
-
- - Ghost Legion - - -
- -
-
- } - alternateComponent={ - scores?.data?.docs?.length ? ( - <> - {scores.data.docs.map((item, index) => ( - - ))} - - ) : ( -
- -
- ) - } - /> -
- setPage(newPage)} - totalPages={scores?.data?.totalPages} - /> -
-
- + ); }; From 9da0022ac945e54a1f62c5b67a262e27c166c8b9 Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Tue, 20 Aug 2024 01:40:20 +0530 Subject: [PATCH 15/16] Fix: remove detect-hof hook and minor fixes --- src/components/layout/header.jsx | 13 ++++++++++--- src/constants/routes.js | 1 + src/hooks/detect-hall-of-fame.jsx | 16 ---------------- src/store/api/leaderboard/index.js | 4 ++-- src/store/api/leaderboard/transformer.js | 2 +- 5 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 src/constants/routes.js delete mode 100644 src/hooks/detect-hall-of-fame.jsx diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index d952580..04d82ec 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -1,10 +1,11 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { RxCross1, RxHamburgerMenu } from "react-icons/rx"; import { Link } from "react-router-dom"; +import { useLocation } from "react-router-dom"; import { twMerge } from "tailwind-merge"; import { portalURL } from "@/constants"; +import { hallOfFame } from "@/constants/routes"; import { useBreakpoint } from "@/hooks"; -import useDetectHallOfFame from "@/hooks/detect-hall-of-fame"; import { BashawayLeaderboard } from "@/icons"; import { AnimatedSwitcher, Button } from "@sliit-foss/bashaway-ui/components"; import { Bashaway, FOSS, Link as LinkIcon, Times } from "@sliit-foss/bashaway-ui/icons"; @@ -16,8 +17,14 @@ const buttonStyles = "mt-1.5 xl:mt-0 px-8 xl:px-[1.15rem] pb-2.5 xl:pb-[0.4rem] const Header = ({ className }) => { const [mobileNavOpen, setMobileNavOpen] = useState(false); + const [isHallOfFame, setIsHallOfFame] = useState(); + const breakpoints = useBreakpoint(); - const isHallOfFame = useDetectHallOfFame(); + const { pathname } = useLocation(); + + useEffect(() => { + setIsHallOfFame(pathname === hallOfFame); + }, [pathname]); return (
{ - const [isHallOfFame, setIsHallOfFame] = useState(false); - const { pathname } = useLocation(); - - useEffect(() => { - setIsHallOfFame(pathname == "/hall-of-fame"); - }, [pathname]); - - return isHallOfFame; -}; - -export default useDetectHallOfFame; diff --git a/src/store/api/leaderboard/index.js b/src/store/api/leaderboard/index.js index d1fab76..96f15a3 100644 --- a/src/store/api/leaderboard/index.js +++ b/src/store/api/leaderboard/index.js @@ -12,14 +12,14 @@ export const leaderboardApi = createApi({ }), fetchPastLeaderboards: builder.query({ queryFn: async ({ year = 2023, round, ghostLegion, page, filters, sorts }) => { - let path = round == 1 ? "round1" : ghostLegion == true ? "ghost-legion" : "final"; + let path = round === 1 ? "round1" : ghostLegion === true ? "ghost-legion" : "final"; try { const data = await import(`../../../constants/annual-leaderboard/${year}/${path}.json`); const transformedData = transformLeaderboardData({ ...data.default }, undefined, { page, filters, sorts }); return { data: transformedData }; } catch (error) { - console.log("Failed to fetch data dynamically"); + console.error("Failed to fetch data dynamically"); } } }) diff --git a/src/store/api/leaderboard/transformer.js b/src/store/api/leaderboard/transformer.js index 1d42b5b..7693483 100644 --- a/src/store/api/leaderboard/transformer.js +++ b/src/store/api/leaderboard/transformer.js @@ -1,4 +1,4 @@ -import { orderBy } from "lodash"; +import { default as orderBy } from "lodash"; import { isRegex } from "@/utils"; const transformLeaderboardData = (response, _, arg) => { From 7ea2aa9abd0fa8be73c0fa096ce0d135d1662a5e Mon Sep 17 00:00:00 2001 From: Thulina Wickramasinghe Date: Wed, 21 Aug 2024 19:35:26 +0530 Subject: [PATCH 16/16] Refactor: use hallOfFame from state and use it as a variable --- src/components/layout/header.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/layout/header.jsx b/src/components/layout/header.jsx index 04d82ec..05b5e9b 100644 --- a/src/components/layout/header.jsx +++ b/src/components/layout/header.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useState } from "react"; import { RxCross1, RxHamburgerMenu } from "react-icons/rx"; import { Link } from "react-router-dom"; import { useLocation } from "react-router-dom"; @@ -17,14 +17,11 @@ const buttonStyles = "mt-1.5 xl:mt-0 px-8 xl:px-[1.15rem] pb-2.5 xl:pb-[0.4rem] const Header = ({ className }) => { const [mobileNavOpen, setMobileNavOpen] = useState(false); - const [isHallOfFame, setIsHallOfFame] = useState(); const breakpoints = useBreakpoint(); const { pathname } = useLocation(); - useEffect(() => { - setIsHallOfFame(pathname === hallOfFame); - }, [pathname]); + const isHallOfFame = pathname === hallOfFame; return (