Skip to content

Commit

Permalink
refactor(fe): lib folder structure refactoring (#2214)
Browse files Browse the repository at this point in the history
* feat(fe): change lib to libs

* feat(fe): change pagination to usePagination

* feat(fe): change useInfiniteScroll path

* feat(fe): change unchanged lib to libs

* feat(fe): fix buld error
  • Loading branch information
Kimhyojung0810 authored Nov 16, 2024
1 parent 452f739 commit 321c5bf
Show file tree
Hide file tree
Showing 149 changed files with 150 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TooltipProvider,
TooltipTrigger
} from '@/components/shadcn/tooltip'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import copyBlueIcon from '@/public/icons/copy-blue.svg'
import { LazyMotion, m, domAnimation } from 'framer-motion'
import Image from 'next/image'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
DialogTitle,
DialogTrigger
} from '@/components/shadcn/dialog'
import { convertToLetter } from '@/lib/utils'
import { convertToLetter } from '@/libs/utils'
import compileIcon from '@/public/icons/compile-version.svg'
import type { ContestProblem, ProblemDetail } from '@/types/type'
import type { Level } from '@/types/type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
SelectTrigger,
SelectValue
} from '@/components/shadcn/select'
import { auth } from '@/lib/auth'
import { fetcherWithAuth } from '@/lib/utils'
import { auth } from '@/libs/auth'
import { fetcherWithAuth } from '@/libs/utils'
import submitIcon from '@/public/icons/submit.svg'
import useAuthModalStore from '@/stores/authModal'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, type ButtonProps } from '@/components/shadcn/button'
import { isHttpError, safeFetcherWithAuth } from '@/lib/utils'
import { isHttpError, safeFetcherWithAuth } from '@/libs/utils'
import useAuthModalStore from '@/stores/authModal'
import { useCodeStore } from '@/stores/editor'
import type { TestcaseItem } from '@/types/type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from '@/components/shadcn/dropdown-menu'
import { auth } from '@/lib/auth'
import { cn, convertToLetter, fetcher, fetcherWithAuth } from '@/lib/utils'
import { auth } from '@/libs/auth'
import { cn, convertToLetter, fetcher, fetcherWithAuth } from '@/libs/utils'
import checkIcon from '@/public/icons/check-green.svg'
import codedangLogo from '@/public/logos/codedang-editor.svg'
import type { Contest, ContestProblem, ProblemDetail } from '@/types/type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@/components/shadcn/dialog'
import { ScrollArea, ScrollBar } from '@/components/shadcn/scroll-area'
import { Textarea } from '@/components/shadcn/textarea'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import { AlertTriangle, X } from 'lucide-react'
import { useState } from 'react'
import { CiSquarePlus } from 'react-icons/ci'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { ScrollArea, ScrollBar } from '@/components/shadcn/scroll-area'
import { cn, getResultColor } from '@/lib/utils'
import { cn, getResultColor } from '@/libs/utils'
import type { TestResultDetail } from '@/types/type'
import { useState, type ReactNode } from 'react'
import { IoMdClose } from 'react-icons/io'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { cn, getResultColor } from '@/lib/utils'
import { cn, getResultColor } from '@/libs/utils'
import type { TestResultDetail } from '@/types/type'
import { WhitespaceVisualizer } from '../WhitespaceVisualizer'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { safeFetcherWithAuth } from '@/lib/utils'
import { safeFetcherWithAuth } from '@/libs/utils'
import type { TestResult } from '@/types/type'
import { useQueries } from '@tanstack/react-query'
import { useEffect, useRef } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import { sanitize } from 'isomorphic-dompurify'

export function WhitespaceVisualizer({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from '@/components/shadcn/button'
import { fetcher } from '@/lib/utils'
import { fetcher } from '@/libs/utils'
import exitIcon from '@/public/icons/exit.svg'
import visitIcon from '@/public/icons/visit.svg'
import Image from 'next/image'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditorDescription } from '@/app/(client)/(code-editor)/_components/EditorDescription'
import { fetcherWithAuth } from '@/lib/utils'
import { fetcherWithAuth } from '@/libs/utils'
import type { ContestProblem, ProblemDetail } from '@/types/type'
import { redirect } from 'next/navigation'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { dateFormatter, getResultColor } from '@/lib/utils'
import { dateFormatter, getResultColor } from '@/libs/utils'
import type { SubmissionItem } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { ColumnDef } from '@tanstack/react-table'
import {
flexRender,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { dateFormatter, fetcherWithAuth, getResultColor } from '@/lib/utils'
import { dateFormatter, fetcherWithAuth, getResultColor } from '@/libs/utils'
import type { SubmissionDetail } from '@/types/type'
import { revalidateTag } from 'next/cache'
import { IoIosLock } from 'react-icons/io'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import Paginator from '@/components/Paginator'
import { usePagination } from '@/lib/pagination'
import { usePagination } from '@/libs/hooks/usePagination'
import type { SubmissionItem } from '@/types/type'
import { columns } from './_components/Columns'
import DataTable from './_components/DataTable'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditorDescription } from '@/app/(client)/(code-editor)/_components/EditorDescription'
import { fetcher } from '@/lib/utils'
import { fetcher } from '@/libs/utils'
import type { ProblemDetail } from '@/types/type'

export default async function DescriptionPage({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { dateFormatter, getResultColor } from '@/lib/utils'
import { dateFormatter, getResultColor } from '@/libs/utils'
import type { SubmissionItem } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { ColumnDef } from '@tanstack/react-table'
import {
flexRender,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { dateFormatter, fetcherWithAuth, getResultColor } from '@/lib/utils'
import { dateFormatter, fetcherWithAuth, getResultColor } from '@/libs/utils'
import type { SubmissionDetail } from '@/types/type'
import { revalidateTag } from 'next/cache'
import dataIfError from '../_libs/dataIfError'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import Paginator from '@/components/Paginator'
import { usePagination } from '@/lib/pagination'
import { usePagination } from '@/libs/hooks/usePagination'
import type { SubmissionItem } from '@/types/type'
import { columns } from './_components/Columns'
import DataTable from './_components/DataTable'
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/(client)/(main)/_components/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import React from 'react'

const variants = {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/(client)/(main)/_components/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { Button } from '@/components/shadcn/button'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { Route } from 'next'
import Image from 'next/image'
import Link from 'next/link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import ContestStatusTimeDiff from '@/components/ContestStatusTimeDiff'
import { cn, dateFormatter } from '@/lib/utils'
import { cn, dateFormatter } from '@/libs/utils'
import calendarIcon from '@/public/icons/calendar.svg'
import type { Contest } from '@/types/type'
import Image from 'next/image'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetcher } from '@/lib/utils'
import { fetcher } from '@/libs/utils'
import type { Contest } from '@/types/type'
import type { Route } from 'next'
import Link from 'next/link'
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/(client)/(main)/_components/Cover.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import Image from 'next/image'

interface CoverProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { ColumnDef } from '@tanstack/react-table'
import {
flexRender,
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/(client)/(main)/_components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import HeaderAuthPanel from '@/components/auth/HeaderAuthPanel'
import { auth } from '@/lib/auth'
import { auth } from '@/libs/auth'
import codedangLogo from '@/public/logos/codedang-with-text.svg'
import Image from 'next/image'
import Link from 'next/link'
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/(client)/(main)/_components/NavLink.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { Route } from 'next'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { Skeleton } from '@/components/shadcn/skeleton'
import { fetcher } from '@/lib/utils'
import { fetcher } from '@/libs/utils'
import type { WorkbookProblem } from '@/types/type'
import type { Route } from 'next'
import Link from 'next/link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { Input } from '@/components/shadcn/input'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import { Search } from 'lucide-react'
import type { Route } from 'next'
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import finishedIcon from '@/public/icons/finished.svg'
import ongoingIcon from '@/public/icons/ongoing.svg'
import upcomingIcon from '@/public/icons/upcoming.svg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
DialogTrigger
} from '@/components/shadcn/dialog'
import { Input } from '@/components/shadcn/input'
import { cn, fetcherWithAuth } from '@/lib/utils'
import { cn, fetcherWithAuth } from '@/libs/utils'
import { zodResolver } from '@hookform/resolvers/zod'
import { useRouter } from 'next/navigation'
import { useEffect, useState } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { convertToLetter, dateFormatter } from '@/lib/utils'
import { convertToLetter, dateFormatter } from '@/libs/utils'
import type { ContestAnnouncement } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DataTable from '@/app/(client)/(main)/_components/DataTable'
import { fetcher } from '@/lib/utils'
import { fetcher } from '@/libs/utils'
import type { ContestAnnouncement } from '@/types/type'
import { columns } from './_components/Columns'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import KatexContent from '@/components/KatexContent'
import { auth } from '@/lib/auth'
import { fetcherWithAuth } from '@/lib/utils'
import { auth } from '@/libs/auth'
import { fetcherWithAuth } from '@/libs/utils'
import RegisterButton from './_components/RegisterButton'

interface ContestTop {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { convertToLetter, dateFormatter } from '@/lib/utils'
import { convertToLetter, dateFormatter } from '@/libs/utils'
import type { ContestProblem } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'
import MySubmission from './MySubmission'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TooltipProvider,
TooltipTrigger
} from '@/components/shadcn/tooltip'
import { fetcherWithAuth } from '@/lib/utils'
import { fetcherWithAuth } from '@/libs/utils'
import seeSubmissionIcon from '@/public/icons/see-submission.svg'
import type { SubmissionDetail, Submission, ContestProblem } from '@/types/type'
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { dateFormatter, getResultColor } from '@/lib/utils'
import { dateFormatter, getResultColor } from '@/libs/utils'
import type { ContestProblem, Language, SubmissionDetail } from '@/types/type'

export default function SubmissionDetailContent({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DataTable from '@/app/(client)/(main)/_components/DataTable'
import { fetcherWithAuth } from '@/lib/utils'
import { getStatusWithStartEnd } from '@/lib/utils'
import { dateFormatter } from '@/lib/utils'
import { fetcherWithAuth } from '@/libs/utils'
import { getStatusWithStartEnd } from '@/libs/utils'
import { dateFormatter } from '@/libs/utils'
import type { ContestProblem } from '@/types/type'
import type { Contest } from '@/types/type'
import { columns } from './_components/Columns'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { Standings } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { safeFetcherWithAuth } from '@/lib/utils'
import { safeFetcherWithAuth } from '@/libs/utils'
import type { ContestProblem } from '@/types/type'

interface ContestProblemsApiRes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ContestStatusTimeDiff from '@/components/ContestStatusTimeDiff'
import { auth } from '@/lib/auth'
import { fetcher, fetcherWithAuth, getStatusWithStartEnd } from '@/lib/utils'
import { dateFormatter } from '@/lib/utils'
import { auth } from '@/libs/auth'
import { fetcher, fetcherWithAuth, getStatusWithStartEnd } from '@/libs/utils'
import { dateFormatter } from '@/libs/utils'
import calendarIcon from '@/public/icons/calendar.svg'
import checkIcon from '@/public/icons/check-blue.svg'
import type { Contest } from '@/types/type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CarouselNext,
CarouselPrevious
} from '@/components/shadcn/carousel'
import { cn, fetcher, fetcherWithAuth } from '@/lib/utils'
import { cn, fetcher, fetcherWithAuth } from '@/libs/utils'
import type { Contest } from '@/types/type'
import type { Route } from 'next'
import type { Session } from 'next-auth'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableHeader,
TableRow
} from '@/components/shadcn/table'
import { dateFormatter } from '@/lib/utils'
import { dateFormatter } from '@/libs/utils'
import type { Contest } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { cn } from '@/lib/utils'
import { cn } from '@/libs/utils'
import type { Route } from 'next'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DataTable from '@/app/(client)/(main)/_components/DataTable'
import { fetcher, fetcherWithAuth } from '@/lib/utils'
import { fetcher, fetcherWithAuth } from '@/libs/utils'
import type { Contest } from '@/types/type'
import type { Session } from 'next-auth'
import { columns } from './FinishedTableColumns'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { dateFormatter } from '@/lib/utils'
import { dateFormatter } from '@/libs/utils'
import checkIcon from '@/public/icons/check-gray.svg'
import type { Contest } from '@/types/type'
import type { ColumnDef } from '@tanstack/react-table'
Expand Down
Loading

0 comments on commit 321c5bf

Please sign in to comment.