From 225a018743faacc178f6aea8384ed54f0ce17b65 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 6 Jan 2025 23:28:23 +0530 Subject: [PATCH 1/2] fix: initialize new users with leaderboard data --- src/services/localStore.ts | 11 ++++++++--- src/types/auth.ts | 11 +++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/services/localStore.ts b/src/services/localStore.ts index 17cb1fe..9774cb3 100644 --- a/src/services/localStore.ts +++ b/src/services/localStore.ts @@ -14,7 +14,9 @@ const initializeStore = () => { github: 'aryanvbw', role: 'super_admin', avatar: `https://avatars.githubusercontent.com/aryanvbw`, - devCoins: 100 + devCoins: 100, + contributions: [], + joinedAt: new Date().toISOString() }; setUsers([superAdmin]); } @@ -46,10 +48,13 @@ export const addUser = (userData: SignUpData): User => { linkedin: userData.linkedin, role: 'user', avatar: `https://avatars.githubusercontent.com/${userData.github}`, - devCoins: 0 + devCoins: 10, + contributions: [], + joinedAt: new Date().toISOString() }; - setUsers([...users, newUser]); + users.push(newUser); + setUsers(users); return newUser; }; diff --git a/src/types/auth.ts b/src/types/auth.ts index cf0de40..b6ed2ae 100644 --- a/src/types/auth.ts +++ b/src/types/auth.ts @@ -7,6 +7,17 @@ export interface User { role: 'user' | 'admin' | 'super_admin'; avatar?: string; devCoins: number; + contributions: Contribution[]; + joinedAt: string; +} + +export interface Contribution { + id: string; + type: 'PR' | 'COLLAB' | 'EVENT' | 'OTHER'; + description: string; + coins: number; + date: string; + verified: boolean; } export interface SignUpData { From fef7d66a287805cb3c7cd229691fecc25bb12292 Mon Sep 17 00:00:00 2001 From: Vivek W <92390419+AryanVBW@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:54:59 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3438f07..a9e543f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dev Club Portal 🚀 -[![Deployment Status](https://img.shields.io/badge/deployment-live-success)](https://portal-aryanvbw.vercel.app/) +[![Deployment Status](https://img.shields.io/badge/deployment-live-success)](https://www.nstsdc.org/) [![Version](https://img.shields.io/badge/version-1.1.0-blue)](https://github.com/AryanVBW/Portal/releases) [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)