added Badges to Dashboard, warning for full events

This commit is contained in:
PxlLoewe
2025-03-10 23:29:02 -07:00
parent c01e618a56
commit 92dff8f3c9
20 changed files with 141 additions and 31 deletions

View File

@@ -27,7 +27,7 @@ model User {
moodleId Int? @map(name: "moodle_id")
emailVerified DateTime? @map(name: "email_verified")
image String?
badges BADGES[] @default([])
badges BADGES[] @unique @default([])
permissions PERMISSION[] @default([])
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @default(now()) @map(name: "updated_at")

View File

@@ -1,28 +0,0 @@
import { BADGES } from "@repo/db";
import P1 from "./p-1.png";
import P2 from "./p-2.png";
import P3 from "./p-3.png";
import D1 from "./d-1.png";
import D2 from "./d-2.png";
import D3 from "./d-3.png";
import DAY1 from "./day-1-member.png";
const BadgeImage = {
[BADGES.P1]: P1,
[BADGES.P2]: P2,
[BADGES.P3]: P3,
[BADGES.D1]: D1,
[BADGES.D2]: D2,
[BADGES.D3]: D3,
[BADGES.DAY1]: DAY1,
};
export const Badge = ({ name }: { name: BADGES }) => {
const image = BadgeImage[name];
return (
<span className="badge">
<img src={image} />
</span>
);
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,2 +1 @@
export * from "./Badge/Badge";
export * from "./helper/event";