From 3176a9f01e13e0e219cf94f334e016b444f36708 Mon Sep 17 00:00:00 2001 From: Kwon Seo Jin <97675977+B0XERCAT@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:06:27 +0900 Subject: [PATCH] refactor(fe): add hide spin button util style (#2109) * refactor(fe): add hide spin button util style, delete hide scroll bar plugin * fix(fe): fix pnpm lock file * chore(fe): add import type declaration --- .../@tabs/_components/RegisterButton.tsx | 2 +- .../app/admin/_components/SwitchField.tsx | 6 +- .../contest/[id]/_components/Columns.tsx | 6 +- .../problem/_components/TestcaseItem.tsx | 3 +- .../auth/ResetPasswordEmailVerify.tsx | 2 +- .../components/auth/SignUpEmailVerify.tsx | 2 +- apps/frontend/package.json | 1 - apps/frontend/tailwind.config.ts | 19 ++- pnpm-lock.yaml | 108 +++++++++++++----- 9 files changed, 105 insertions(+), 44 deletions(-) diff --git a/apps/frontend/app/(main)/contest/[contestId]/@tabs/_components/RegisterButton.tsx b/apps/frontend/app/(main)/contest/[contestId]/@tabs/_components/RegisterButton.tsx index 1dcdd4636a..6187dead6e 100644 --- a/apps/frontend/app/(main)/contest/[contestId]/@tabs/_components/RegisterButton.tsx +++ b/apps/frontend/app/(main)/contest/[contestId]/@tabs/_components/RegisterButton.tsx @@ -181,7 +181,7 @@ export default function RegisterButton({ })} type="number" className={cn( - 'h-12 w-full [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', + 'hide-spin-button h-12 w-full', errors.invitationCode && 'border-red-500 focus-visible:ring-red-500' )} diff --git a/apps/frontend/app/admin/_components/SwitchField.tsx b/apps/frontend/app/admin/_components/SwitchField.tsx index d6b229b2a6..53e67d2083 100644 --- a/apps/frontend/app/admin/_components/SwitchField.tsx +++ b/apps/frontend/app/admin/_components/SwitchField.tsx @@ -61,11 +61,7 @@ export default function SwitchField({ id={name} type={type} placeholder={placeholder} - className={cn( - inputStyle, - 'h-[36px] w-[380px]', - '[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none' - )} + className={cn(inputStyle, 'hide-spin-button h-[36px] w-[380px]')} {...register(name, { onChange: () => trigger(name) })} diff --git a/apps/frontend/app/admin/contest/[id]/_components/Columns.tsx b/apps/frontend/app/admin/contest/[id]/_components/Columns.tsx index a34faf9c11..dc88eaa3f5 100644 --- a/apps/frontend/app/admin/contest/[id]/_components/Columns.tsx +++ b/apps/frontend/app/admin/contest/[id]/_components/Columns.tsx @@ -5,7 +5,6 @@ import OptionSelect from '@/components/OptionSelect' import { Badge } from '@/components/ui/badge' import { Input } from '@/components/ui/input' import { GET_BELONGED_CONTESTS } from '@/graphql/contest/queries' -import { cn } from '@/lib/utils' import type { Level } from '@/types/type' import { useQuery } from '@apollo/client' import type { ColumnDef, Row } from '@tanstack/react-table' @@ -72,10 +71,7 @@ export const columns = (
{ diff --git a/apps/frontend/app/admin/problem/_components/TestcaseItem.tsx b/apps/frontend/app/admin/problem/_components/TestcaseItem.tsx index 303eb63fec..062f2eeea9 100644 --- a/apps/frontend/app/admin/problem/_components/TestcaseItem.tsx +++ b/apps/frontend/app/admin/problem/_components/TestcaseItem.tsx @@ -86,8 +86,7 @@ export default function TestcaseItem({ type="number" min={0} className={cn( - 'h-5 w-8 rounded-sm border text-center text-xs', - '[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', + 'hide-spin-button h-5 w-8 rounded-sm border text-center text-xs', isInvalid(getValues('testcases')[index].scoreWeight) ? 'border-red-500' : 'border-gray-300' diff --git a/apps/frontend/components/auth/ResetPasswordEmailVerify.tsx b/apps/frontend/components/auth/ResetPasswordEmailVerify.tsx index 4988e20925..4f78f13864 100644 --- a/apps/frontend/components/auth/ResetPasswordEmailVerify.tsx +++ b/apps/frontend/components/auth/ResetPasswordEmailVerify.tsx @@ -140,7 +140,7 @@ export default function ResetPasswordEmailVerify() {