From c59eda49ebc6270187073f8a964d9761835b4e7b Mon Sep 17 00:00:00 2001 From: Daniel Shi <144500568+danielshid@users.noreply.github.com> Date: Sun, 17 Aug 2025 06:52:55 +0000 Subject: [PATCH] dashboard sample --- .github/workflows/formatting.yml | 8 +-- app/dashboard/page.tsx | 99 +++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index f53f78c9..82466215 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -8,19 +8,19 @@ jobs: runs-on: ubuntu-latest permissions: - contents: write # Required to push to the repo + contents: write # Required to push to the repo steps: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} # Checkout PR branch + ref: ${{ github.head_ref }} # Checkout PR branch - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'npm' + node-version: "20" + cache: "npm" - name: Install dependencies run: npm ci diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 46e7ba5a..ceb0f03e 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -1,5 +1,100 @@ import React from "react"; -export default function page() { - return
dashboard page
; +type Event = { + id: string; + title: string; + participants: string[]; +}; + +export default function Page() { + // Mock data for testing + const joinedEvents: Event[] = [ + { + id: "1", + title: "Dinner With Friends", + participants: ["A", "B", "C", "D", "E", "F"], + }, + { id: "2", title: "Board Game Night", participants: ["D", "E"] }, + { + id: "3", + title: "Dungeons & Dragons ", + participants: ["F", "G", "H", "I"], + }, + { id: "4", title: "Project Meeting", participants: ["I", "J", "K"] }, + { + id: "5", + title: "Competitive Slug Racing", + participants: ["L", "M", "N", "O", "P"], + }, + ]; + + const createdEvents: Event[] = [ + { id: "6", title: "Study Session", participants: ["I", "J", "K"] }, + { + id: "7", + title: "Eboard Meeting", + participants: ["L", "M", "N", "O", "P"], + }, + ]; + + const renderParticipants = (participants: string[]) => { + const visible = participants.slice(0, 4); + const extraCount = participants.length - visible.length; + + return ( + <> + {visible.map((p, i) => ( +
+ {p} +
+ ))} + {extraCount > 0 && ( +
+ +{extraCount} +
+ )} + + ); + }; + + return ( +
+ {/* Events You Joined */} +
+

Events You Joined

+
+ {joinedEvents.map((event) => ( +
+
+
+ {renderParticipants(event.participants)} +
+
+

{event.title}

+
+ ))} +
+
+ + {/* Events You Created */} +
+

Events You Created

+
+ {createdEvents.map((event) => ( +
+
+
+ {renderParticipants(event.participants)} +
+
+

{event.title}

+
+ ))} +
+
+
+ ); }