From d6b0f9f769513733308ffe9e928dd58acb665680 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 9 May 2024 14:18:52 +0300 Subject: [PATCH] Remove "hosted on sendou ink" tag and add ranked/unranked tags --- .../calendar/CalendarRepository.server.ts | 6 +++++- app/features/calendar/calendar-constants.ts | 3 --- app/features/calendar/components/Tags.tsx | 8 ++++++++ .../calendar/loaders/calendar.new.server.ts | 4 +--- app/features/calendar/routes/calendar.new.tsx | 3 +-- app/features/calendar/routes/calendar.tsx | 18 +++++++++++++++--- app/styles/common.css | 11 +++++++++++ locales/da/calendar.json | 3 +-- locales/da/common.json | 1 - locales/en/calendar.json | 3 +-- locales/en/common.json | 1 - locales/fr/calendar.json | 3 +-- locales/fr/common.json | 1 - locales/he/calendar.json | 3 +-- locales/he/common.json | 1 - locales/ja/calendar.json | 3 +-- locales/ja/common.json | 1 - locales/ko/common.json | 1 - locales/pt-BR/calendar.json | 3 +-- locales/pt-BR/common.json | 1 - locales/ru/calendar.json | 3 +-- locales/ru/common.json | 1 - locales/zh/calendar.json | 3 +-- locales/zh/common.json | 1 - 24 files changed, 49 insertions(+), 37 deletions(-) diff --git a/app/features/calendar/CalendarRepository.server.ts b/app/features/calendar/CalendarRepository.server.ts index ddd8bec97..b87bd3bd6 100644 --- a/app/features/calendar/CalendarRepository.server.ts +++ b/app/features/calendar/CalendarRepository.server.ts @@ -153,6 +153,11 @@ export async function findAllBetweenTwoTimestamps({ "User.discordName", "User.discordDiscriminator", "CalendarEventRanks.nthAppearance", + eb + .selectFrom("Tournament") + .select("Tournament.settings") + .whereRef("Tournament.id", "=", "CalendarEvent.tournamentId") + .as("tournamentSettings"), hasBadge, jsonArrayFrom( eb @@ -227,7 +232,6 @@ function tagsArray(args: { ) as Array; if (args.hasBadge) tags.unshift("BADGE"); - if (args.tournamentId) tags.unshift("FULL_TOURNAMENT"); return tags; } diff --git a/app/features/calendar/calendar-constants.ts b/app/features/calendar/calendar-constants.ts index 9f4b4a860..ed69d8de3 100644 --- a/app/features/calendar/calendar-constants.ts +++ b/app/features/calendar/calendar-constants.ts @@ -47,9 +47,6 @@ export const tags = { CARDS: { color: "#E4D00A", }, - FULL_TOURNAMENT: { - color: "#FFC0CB", - }, }; export const REG_CLOSES_AT_OPTIONS = [ diff --git a/app/features/calendar/components/Tags.tsx b/app/features/calendar/components/Tags.tsx index 47f5a4f13..0aab426d4 100644 --- a/app/features/calendar/components/Tags.tsx +++ b/app/features/calendar/components/Tags.tsx @@ -12,9 +12,11 @@ export function Tags({ tags, badges, onDelete, + tournamentRankedStatus, }: { tags: Array; badges?: CalendarRepository.FindAllBetweenTwoTimestampsItem["badgePrizes"]; + tournamentRankedStatus?: "RANKED" | "UNRANKED"; /** Called when tag delete button clicked. If undefined delete buttons won't be shown. */ onDelete?: (tag: CalendarEventTag) => void; @@ -25,6 +27,12 @@ export function Tags({ return (