Connect, collaborate, and grow with a community of TypeScript developers
chore: remove christmas explore cards
bautistaaafcc5fa5860ca
diff --git a/apps/web/src/app/[locale]/explore/_components/aot-2023-explore-card.tsx b/apps/web/src/app/[locale]/explore/_components/aot-2023-explore-card.tsxdeleted file mode 100644index 06f37b7a..00000000--- a/apps/web/src/app/[locale]/explore/_components/aot-2023-explore-card.tsx+++ /dev/null@@ -1,82 +0,0 @@-//TODO: Delete after aot-2023-import { cn } from '@repo/ui/cn';-import { Circle, RectangleVertical, Triangle } from '@repo/ui/icons';--const HOLIDAY_COLORS_BY_DIFFICULTY = {- BEGINNER: 'group-hover/card:text-difficulty-beginner',- EASY: 'group-hover/card:text-yellow-300',- MEDIUM: 'group-hover/card:text-difficulty-medium',- HARD: 'group-hover/card:text-difficulty-hard',- EXTREME: 'group-hover/card:text-difficulty-extreme',-} as Record<string, string>;--const BALLS_POSITION_BY_DIFFICULTY = {- BEGINNER: [- { right: '78', top: '45' },- { right: '32', top: '120' },- ],- EASY: [- { right: '40', top: '20' },- { right: '79', top: '75' },- { right: '32', top: '105' },- ],- MEDIUM: [- { right: '40', top: '15' },- { right: '24', top: '56' },- { right: '65', top: '80' },- { right: '38', top: '140' },- ],- HARD: [- { right: '40', top: '15' },- { right: '24', top: '56' },- { right: '70', top: '80' },- { right: '32', top: '120' },- ],- EXTREME: [- { right: '40', top: '15' },- { right: '24', top: '56' },- { right: '70', top: '80' },- { right: '32', top: '120' },- { right: '70', top: '140' },- ],-} as Record<string, { right: string; top: string }[]>;--function HolidayChristmasBall({- right,- top,- className,-}: {- right: string;- top: string;- className?: string;-}) {- return (- <Circle- className={cn(- 'absolute z-40 h-4 w-4 animate-pulse fill-current stroke-[0.5] text-black/10 opacity-0 blur-sm delay-300 duration-1000 group-hover/card:text-red-500 group-hover/card:opacity-100',- className,- )}- style={{- top,- right,- }}- />- );-}--export function HolidayChristmasTree({ difficulty }: { difficulty: string }) {- const className = HOLIDAY_COLORS_BY_DIFFICULTY[difficulty];- const balls = BALLS_POSITION_BY_DIFFICULTY[difficulty];-- return (- <>- <Triangle className="absolute -right-5 -top-5 h-16 w-16 rotate-0 stroke-[0.75] text-black/10 opacity-10 duration-500 group-hover/card:-translate-x-[56px] group-hover/card:translate-y-32 group-hover/card:rotate-12 group-hover/card:scale-[2] group-hover/card:text-green-600/50 group-hover/card:opacity-100 dark:text-white " />- <Triangle className="absolute -right-14 -top-16 h-32 w-32 rotate-12 stroke-[0.4] text-black/10 opacity-10 duration-300 group-hover/card:-translate-x-10 group-hover/card:translate-y-8 group-hover/card:stroke-[0.66] group-hover/card:text-green-600/50 group-hover/card:opacity-100 dark:text-white" />- <Triangle className="absolute -right-20 h-32 w-32 rotate-12 stroke-[0.4] text-black/10 opacity-10 duration-300 group-hover/card:-translate-x-[72px] group-hover/card:translate-y-6 group-hover/card:stroke-[0.66] group-hover/card:text-green-600/50 group-hover/card:opacity-100 dark:text-white " />- <RectangleVertical className="absolute -bottom-10 right-0 h-16 w-16 text-black/10 opacity-0 duration-300 group-hover/card:-translate-x-[48px] group-hover/card:-translate-y-10 group-hover/card:rotate-12 group-hover/card:text-yellow-950/50 group-hover/card:opacity-100 dark:text-white" />- {balls?.map((ball, idx) => (- <HolidayChristmasBall key={idx} right={ball.right} top={ball.top} className={className} />- ))}- </>- );-}diff --git a/apps/web/src/app/[locale]/explore/_components/explore-card.tsx b/apps/web/src/app/[locale]/explore/_components/explore-card.tsxindex d26d756d..11292cbb 100644--- a/apps/web/src/app/[locale]/explore/_components/explore-card.tsx+++ b/apps/web/src/app/[locale]/explore/_components/explore-card.tsx@@ -19,7 +19,6 @@ import {} from '@repo/ui/icons';import dynamic from 'next/dynamic';import type { ExploreChallengeData } from './explore.action';-import { HolidayChristmasTree } from './aot-2023-explore-card';const RelativeTime = dynamic(() => import('./relative-time'), {ssr: false,@@ -27,8 +26,6 @@ const RelativeTime = dynamic(() => import('./relative-time'), {interface ExploreCardProps {challenge: Awaited<ExploreChallengeData>[0];- //TODO: Delete after aot-2023- isHolidayEvent?: boolean;}const BORDERS_BY_DIFFICULTY = {@@ -71,8 +68,8 @@ function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {case 'EASY':return (<>+ <Diamond className="group-hover/card:text-difficulty-easy dark:group-hover/card:text-difficulty-easy-dark absolute -right-5 -top-10 h-24 w-24 origin-top-right stroke-[0.66] text-black/10 duration-300 group-hover/card:rotate-6 group-hover/card:scale-90 dark:text-white/10" /><Diamond className="group-hover/card:text-difficulty-easy dark:group-hover/card:text-difficulty-easy-dark absolute -right-6 -top-12 h-36 w-36 rotate-12 stroke-[0.44] text-black/10 duration-500 group-hover/card:-translate-y-2 group-hover/card:translate-x-3 group-hover/card:rotate-6 group-hover/card:scale-90 dark:text-white/10" />- <Diamond className="group-hover/card:text-difficulty-easy dark:group-hover/card:text-difficulty-easy-dark group-hover/card:r0 absolute -right-6 -top-12 h-36 w-36 rotate-12 stroke-[0.44] text-black/10 duration-500 group-hover/card:-translate-y-2 group-hover/card:translate-x-3" /></>);case 'MEDIUM':@@ -101,7 +98,7 @@ function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {}}-export async function ExploreCard({ challenge, isHolidayEvent = false }: ExploreCardProps) {+export async function ExploreCard({ challenge }: ExploreCardProps) {const hasBeenSolved = challenge.submission.length > 0;return (@@ -111,13 +108,7 @@ export async function ExploreCard({ challenge, isHolidayEvent = false }: Explore${BORDERS_BY_DIFFICULTY[challenge.difficulty]}`}>- <>- {isHolidayEvent ? (- <HolidayChristmasTree difficulty={challenge.difficulty} />- ) : (- <ChallengeDifficultyIcon difficulty={challenge.difficulty} />- )}- </>+ <ChallengeDifficultyIcon difficulty={challenge.difficulty} /><CardHeader className="relative flex flex-col items-start gap-1 py-5"><CardTitle className="max-w-[75%] truncate text-2xl duration-300">{challenge.name}diff --git a/apps/web/src/app/[locale]/explore/_components/explore-section.tsx b/apps/web/src/app/[locale]/explore/_components/explore-section.tsxindex 33ba4fb1..f9ae9838 100644--- a/apps/web/src/app/[locale]/explore/_components/explore-section.tsx+++ b/apps/web/src/app/[locale]/explore/_components/explore-section.tsx@@ -3,7 +3,6 @@ import type { Difficulty, Tags } from '@repo/db/types';import Link from 'next/link';import { ExploreChallengesProgression } from '~/app/[locale]/explore/_components/explore-challenges-progress';import { Carousel } from '~/components/carousel';-import { getAllFlags } from '~/utils/feature-flags';import { ExploreCard } from './explore-card';import {getChallengesByTagOrDifficulty,@@ -64,7 +63,6 @@ export const COLORS_BY_TAGS = {export async function ExploreSection({ title, tag, redirectRoute }: SectionProps) {const session = await auth();- const { enableHolidayEvent } = await getAllFlags();const challenges = await getChallengesByTagOrDifficulty(tag.trim().toUpperCase());const challengesLength = await getExploreChallengesLengthByTagOrDifficulty(tag.trim().toUpperCase(),@@ -123,11 +121,7 @@ export async function ExploreSection({ title, tag, redirectRoute }: SectionPropshref={`/challenge/${challenge.slug}`}key={challenge.id}>- <ExploreCard- challenge={challenge}- key={`challenge-${challenge.id}`}- isHolidayEvent={Boolean(enableHolidayEvent)}- />+ <ExploreCard challenge={challenge} key={`challenge-${challenge.id}`} /></Link>))}</Carousel>