From ff221e0b235a01077172eb24144f12c3f08e29d5 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 20 Feb 2021 17:56:34 +0200 Subject: [PATCH] remove utils folder --- components/plus/PlusVotingHistoryPage.tsx | 4 ++-- {utils => lib}/plus.ts | 0 {utils => lib}/prisma.ts | 0 services/plusService.ts | 4 ++-- utils/strings.ts | 5 ----- 5 files changed, 4 insertions(+), 9 deletions(-) rename {utils => lib}/plus.ts (100%) rename {utils => lib}/prisma.ts (100%) delete mode 100644 utils/strings.ts diff --git a/components/plus/PlusVotingHistoryPage.tsx b/components/plus/PlusVotingHistoryPage.tsx index aafceed76..b86b45f1e 100644 --- a/components/plus/PlusVotingHistoryPage.tsx +++ b/components/plus/PlusVotingHistoryPage.tsx @@ -11,7 +11,7 @@ import { } from "components/common/Table"; import UserAvatar from "components/common/UserAvatar"; import { FiCheck } from "react-icons/fi"; -import { formatUsername } from "utils/strings"; +import { getFullUsername } from "lib/strings"; import { GetVotingSummariesByMonthAndTierData } from "../../services/plusService"; export interface PlusVotingHistoryPageProps { @@ -62,7 +62,7 @@ const PlusVotingHistoryPage: React.FC = ({ - {formatUsername(summary.user)} + {getFullUsername(summary.user)} = 50 ? "green.500" : "red.500"} > diff --git a/utils/plus.ts b/lib/plus.ts similarity index 100% rename from utils/plus.ts rename to lib/plus.ts diff --git a/utils/prisma.ts b/lib/prisma.ts similarity index 100% rename from utils/prisma.ts rename to lib/prisma.ts diff --git a/services/plusService.ts b/services/plusService.ts index d60dc9e34..bcb961a9b 100644 --- a/services/plusService.ts +++ b/services/plusService.ts @@ -1,7 +1,7 @@ import { PlusRegion, Prisma } from "@prisma/client"; import prisma from "prisma/client"; -import { getPercentageFromCounts } from "utils/plus"; -import { userBasicSelection } from "utils/prisma"; +import { getPercentageFromCounts } from "lib/plus"; +import { userBasicSelection } from "lib/prisma"; export type GetVotingSummariesByMonthAndTierData = Prisma.PromiseReturnType< typeof getVotingSummariesByMonthAndTier diff --git a/utils/strings.ts b/utils/strings.ts deleted file mode 100644 index c18cdbf5b..000000000 --- a/utils/strings.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { User } from "@prisma/client"; - -export const formatUsername = ( - user: Pick -) => `${user.username}#${user.discriminator}`;