Connect, collaborate, and grow with a community of TypeScript developers
Trash/update difficulty enum (#1226)
bautistaaac1a28f739947
diff --git a/apps/og-image/app/api/challenge/route.tsx b/apps/og-image/app/api/challenge/route.tsxindex 0e6b5cc9..45910ba5 100644--- a/apps/og-image/app/api/challenge/route.tsx+++ b/apps/og-image/app/api/challenge/route.tsx@@ -27,6 +27,8 @@ export async function GET(req: Request) {MEDIUM: 'bg-[#f19c41]',HARD: 'bg-[#f87272]',EXTREME: 'bg-[#d8b4fe]',+ // should never actually be used+ EVENT: 'bg-[#d8b4fe]',};const GRADIENT_BY_DIFFICULTY = {@@ -35,6 +37,8 @@ export async function GET(req: Request) {MEDIUM: '#66421b',HARD: '#5c2020',EXTREME: '#48345c',+ // should never actually be used+ EVENT: '#48345c',};const mogus_coords = Array.from(diff --git a/apps/og-image/utils/zodParams.ts b/apps/og-image/utils/zodParams.tsindex ece0e964..49f45d22 100644--- a/apps/og-image/utils/zodParams.ts+++ b/apps/og-image/utils/zodParams.ts@@ -55,7 +55,7 @@ export const challengeParam = zodParams(title: truncatedWordSchema({ maxCharacters: 70 }),description: truncatedWordSchema({ maxCharacters: 145 }),username: z.string(),- difficulty: z.enum(['BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'EXTREME']),+ difficulty: z.enum(['BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'EXTREME', 'EVENT']),date: z.string().optional(),}),);diff --git a/apps/web/src/app/[locale]/_components/hero-challenge-card.tsx b/apps/web/src/app/[locale]/_components/hero-challenge-card.tsxindex 8c904ea0..4e329171 100644--- a/apps/web/src/app/[locale]/_components/hero-challenge-card.tsx+++ b/apps/web/src/app/[locale]/_components/hero-challenge-card.tsx@@ -27,6 +27,8 @@ const COLORS_BY_DIFFICULTY = {MEDIUM: 'dark:bg-yellow-300 bg-yellow-600',HARD: 'dark:bg-red-300 bg-red-600',EXTREME: 'dark:bg-orange-300 bg-orange-600',+ // this will never actually be used+ EVENT: 'dark:bg-orange-300 bg-orange-600',};const codeLineProps = {diff --git a/apps/web/src/app/[locale]/explore/_components/explore-card.tsx b/apps/web/src/app/[locale]/explore/_components/explore-card.tsxindex a352bc61..d26d756d 100644--- a/apps/web/src/app/[locale]/explore/_components/explore-card.tsx+++ b/apps/web/src/app/[locale]/explore/_components/explore-card.tsx@@ -40,6 +40,9 @@ const BORDERS_BY_DIFFICULTY = {HARD: 'dark:hover:border-difficulty-hard-dark hover:border-difficulty-hard dark:group-focus:border-difficulty-hard-dark group-focus:border-difficulty-hard',EXTREME:'dark:hover:border-difficulty-extreme-dark hover:border-difficulty-extreme dark:group-focus:border-difficulty-extreme-dark group-focus:border-difficulty-extreme',+ // this will never actually be used+ EVENT:+ 'dark:hover:border-difficulty-extreme-dark hover:border-difficulty-extreme dark:group-focus:border-difficulty-extreme-dark group-focus:border-difficulty-extreme',};const SHADOWS_BY_DIFFICULTY = {@@ -51,6 +54,9 @@ const SHADOWS_BY_DIFFICULTY = {HARD: 'hover:shadow-hard group-focus:shadow-hard dark:hover:shadow-hard-dark dark:group-focus:shadow-hard-dark',EXTREME:'hover:shadow-extreme group-focus:shadow-extreme dark:hover:shadow-extreme-dark dark:group-focus:shadow-extreme-dark',+ // this will never actually be used+ EVENT:+ 'hover:shadow-extreme group-focus:shadow-extreme dark:hover:shadow-extreme-dark dark:group-focus:shadow-extreme-dark',};function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {diff --git a/apps/web/src/app/[locale]/explore/_components/explore-section.tsx b/apps/web/src/app/[locale]/explore/_components/explore-section.tsxindex 787f266b..1bc72deb 100644--- a/apps/web/src/app/[locale]/explore/_components/explore-section.tsx+++ b/apps/web/src/app/[locale]/explore/_components/explore-section.tsx@@ -25,6 +25,8 @@ const difficultyToNumber = {MEDIUM: 2,HARD: 3,EXTREME: 4,+ // this will never actually be used+ EVENT: 5,} as const;const TITLES_BY_TAG = {@@ -38,6 +40,9 @@ const TITLES_BY_TAG = {HARD: 'bg-clip-text text-transparent select-none bg-gradient-to-r from-red-600 to-red-500 dark:from-red-300 dark:to-red-100',EXTREME:'bg-clip-text text-transparent select-none bg-gradient-to-r from-purple-600 to-purple-500 dark:from-purple-400 dark:to-purple-100',+ // this will never actually be used+ EVENT:+ 'bg-clip-text text-transparent select-none bg-gradient-to-r from-purple-600 to-purple-500 dark:from-purple-400 dark:to-purple-100',};export const COLORS_BY_TAGS = {@@ -48,6 +53,8 @@ export const COLORS_BY_TAGS = {MEDIUM: 'dark:bg-yellow-300 bg-yellow-600/50',HARD: 'dark:bg-red-300 bg-red-600/50',EXTREME: 'dark:bg-purple-300 bg-purple-600/50',+ // this will never actually be used+ EVENT: 'dark:bg-purple-300 bg-purple-600/50',} as const;export async function ExploreSection({ title, tag, redirectRoute }: SectionProps) {diff --git a/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx b/apps/web/src/app/[locale]/explore/_components/view-more-button.tsxindex 47051633..03fedfd0 100644--- a/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx+++ b/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx@@ -17,6 +17,9 @@ export const BUTTON_BY_TAGS = {HARD: 'bg-red-500/10 text-red-700 hover:text-red-700 dark:text-red-300 dark:bg-red-300/10 hover:bg-red-500/20 dark:hover:bg-red-300/20',EXTREME:'bg-purple-500/10 text-purple-700 hover:text-purple-700 dark:text-purple-300 dark:bg-purple-300/10 hover:bg-purple-500/20 dark:hover:bg-purple-300/20',+ // this will never actually be used+ EVENT:+ 'bg-purple-500/10 text-purple-700 hover:text-purple-700 dark:text-purple-300 dark:bg-purple-300/10 hover:bg-purple-500/20 dark:hover:bg-purple-300/20',} as const;interface ViewMoreButtonProps {diff --git a/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx b/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsxindex 87abc5ab..4426a41b 100644--- a/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx+++ b/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx@@ -28,6 +28,8 @@ const BGS_BY_DIFFICULTY = {MEDIUM: 'to-difficulty-medium/20 dark:to-difficulty-medium-dark/20',HARD: 'to-difficulty-hard/20 dark:to-difficulty-hard-dark/20',EXTREME: 'to-difficulty-extreme/20 dark:to-difficulty-extreme-dark/20',+ // this will never actually be used+ EVENT: 'to-difficulty-extreme/20 dark:to-difficulty-extreme-dark/20',} as const;// million-ignorediff --git a/apps/web/src/app/metadata.ts b/apps/web/src/app/metadata.tsindex 54e35774..fef49f8c 100644--- a/apps/web/src/app/metadata.ts+++ b/apps/web/src/app/metadata.ts@@ -51,7 +51,7 @@ interface MetaParamsForChallenge {title: string;description: string;username: string;- difficulty: 'BEGINNER' | 'EASY' | 'EXTREME' | 'HARD' | 'MEDIUM';+ difficulty: 'BEGINNER' | 'EASY' | 'EVENT' | 'EXTREME' | 'HARD' | 'MEDIUM';date: string;}diff --git a/packages/db/schema.prisma b/packages/db/schema.prismaindex deefe1b0..ab2788f0 100644--- a/packages/db/schema.prisma+++ b/packages/db/schema.prisma@@ -22,6 +22,7 @@ enum Difficulty {MEDIUMHARDEXTREME+ EVENT}enum RoleTypes {diff --git a/packages/ui/src/components/difficulty-badge.tsx b/packages/ui/src/components/difficulty-badge.tsxindex e0f69884..ceb84293 100644--- a/packages/ui/src/components/difficulty-badge.tsx+++ b/packages/ui/src/components/difficulty-badge.tsx@@ -13,6 +13,8 @@ const COLORS_BY_DIFFICULTY = {MEDIUM: 'dark:bg-difficulty-medium-dark bg-difficulty-medium',HARD: 'dark:bg-difficulty-hard-dark bg-difficulty-hard',EXTREME: 'dark:bg-difficulty-extreme-dark bg-difficulty-extreme',+ // this will never actually be used+ EVENT: 'dark:bg-difficulty-extreme-dark bg-difficulty-extreme',};export function DifficultyBadge({ className, difficulty }: Props) {