From 2ac59e5a2b064a52d56a67cf461bb8654f021238 Mon Sep 17 00:00:00 2001 From: olexh Date: Sat, 25 May 2024 03:40:32 +0300 Subject: [PATCH] refactor: fix namings of utils to kebab case --- .../[slug]/(animeDetails)/characters/page.tsx | 2 +- .../[slug]/(animeDetails)/comments/page.tsx | 4 +- .../[slug]/(animeDetails)/franchise/page.tsx | 2 +- .../[slug]/(animeDetails)/links/page.tsx | 2 +- .../[slug]/(animeDetails)/media/page.tsx | 2 +- .../[slug]/(animeDetails)/staff/page.tsx | 2 +- .../(content)/anime/[slug]/anime.schema.ts | 2 +- .../(content)/anime/[slug]/layout.metadata.ts | 6 +- app/(pages)/(content)/anime/[slug]/layout.tsx | 2 +- .../(content)/characters/[slug]/layout.tsx | 2 +- .../(content)/people/[slug]/layout.tsx | 2 +- app/(pages)/(home)/page.queries.ts | 2 +- app/(pages)/(home)/page.tsx | 2 +- .../(user)/u/[username]/favorites/page.tsx | 2 +- .../(user)/u/[username]/history/page.tsx | 4 +- .../(user)/u/[username]/layout.metadata.ts | 2 +- app/(pages)/(user)/u/[username]/layout.tsx | 2 +- app/(pages)/(user)/u/[username]/list/page.tsx | 2 +- app/(pages)/(user)/u/[username]/page.tsx | 2 +- .../collections/(collections)/page.tsx | 4 +- app/(pages)/collections/[reference]/page.tsx | 4 +- app/(pages)/collections/new/page.tsx | 2 +- .../[slug]/[[...comment_reference]]/page.tsx | 4 +- app/(pages)/comments/latest/page.tsx | 4 +- app/(pages)/edit/[editId]/layout.tsx | 4 +- app/(pages)/edit/content/page.tsx | 4 +- app/(pages)/edit/layout.tsx | 4 +- app/(pages)/edit/new/page.tsx | 2 +- app/(pages)/edit/page.tsx | 2 +- app/(pages)/schedule/page.tsx | 6 +- app/layout.tsx | 2 +- components/comments-button.tsx | 4 +- components/history-item.tsx | 3 +- components/page-pagination.tsx | 3 +- features/anime/anime-list-navbar/search.tsx | 2 +- features/anime/anime-list/anime-list.hooks.ts | 2 +- .../collection-list/collection-sort.tsx | 3 +- features/comments/comment-list/comment.tsx | 2 +- .../notifications-menu.component.tsx | 2 +- features/common/providers.component.tsx | 4 +- features/common/session-manager.component.tsx | 2 +- .../edit-forms/edit-create-form.component.tsx | 2 +- features/edit/edit-forms/edit-group.tsx | 2 +- .../edit-forms/edit-view-form.component.tsx | 2 +- features/filters/anime-filters.component.tsx | 2 +- features/filters/edit-filters.component.tsx | 2 +- .../filters/schedule-filters.component.tsx | 4 +- features/home/schedule/schedule-item.tsx | 2 +- .../modals/search-modal/useAnimeSearchList.ts | 2 +- .../schedule/schedule-list/schedule-item.tsx | 2 +- .../activity-stats/activity-item.tsx | 4 +- .../activity-stats/activity-stats.tsx | 2 +- .../status-combobox.component.tsx | 2 +- .../view-combobox.component.tsx | 2 +- .../user-watchlist/watchlist/table-view.tsx | 2 +- next.config.mjs | 3 +- services/hooks/anime/use-anime-catalog.ts | 2 +- services/hooks/anime/use-anime-info.ts | 2 +- services/hooks/anime/use-franchise.ts | 2 +- .../hooks/characters/use-character-anime.ts | 2 +- .../hooks/characters/use-character-voices.ts | 2 +- services/hooks/edit/todo/use-todo-anime.ts | 2 +- services/hooks/edit/use-edit-list.ts | 2 +- services/hooks/favorite/use-favorites.ts | 2 +- .../hooks/history/use-following-history.ts | 2 +- services/hooks/people/use-person-anime.ts | 2 +- .../hooks/people/use-person-characters.ts | 2 +- services/hooks/stats/use-anime-schedule.ts | 4 +- services/hooks/user/use-user-history.ts | 2 +- services/hooks/watch/use-watch-list.ts | 2 +- utils/{animeAdapter.ts => anime-adapter.ts} | 0 ...vityStats.ts => convert-activity-stats.ts} | 0 .../convert-favorite-activity.tsx} | 0 .../convert-import-activity.tsx} | 0 .../convert-watch-activity.tsx} | 2 +- .../index.ts | 6 +- ...ification.tsx => convert-notification.tsx} | 0 utils/convertRomaji.ts | 181 ------------------ ...eQueryString.ts => create-query-string.ts} | 0 ...{editParamUtils.ts => edit-param-utils.ts} | 0 ...nerateMetadata.ts => generate-metadata.ts} | 0 ...rorMessage.ts => get-api-error-message.ts} | 0 ...CurrentSeason.ts => get-current-season.ts} | 0 ...clensionWord.ts => get-declension-word.ts} | 0 ...{getQueryClient.ts => get-query-client.ts} | 0 ...leDuration.ts => get-schedule-duration.ts} | 0 ...arkDown.ts => parse-text-from-markdown.ts} | 0 utils/{truncateText.ts => truncate-text.ts} | 0 88 files changed, 92 insertions(+), 277 deletions(-) rename utils/{animeAdapter.ts => anime-adapter.ts} (100%) rename utils/{convertActivityStats.ts => convert-activity-stats.ts} (100%) rename utils/{convertActivity/convertFavoriteActivity.tsx => convert-activity/convert-favorite-activity.tsx} (100%) rename utils/{convertActivity/convertImportActivity.tsx => convert-activity/convert-import-activity.tsx} (100%) rename utils/{convertActivity/convertWatchActivity.tsx => convert-activity/convert-watch-activity.tsx} (98%) rename utils/{convertActivity => convert-activity}/index.ts (71%) rename utils/{convertNotification.tsx => convert-notification.tsx} (100%) delete mode 100644 utils/convertRomaji.ts rename utils/{createQueryString.ts => create-query-string.ts} (100%) rename utils/{editParamUtils.ts => edit-param-utils.ts} (100%) rename utils/{generateMetadata.ts => generate-metadata.ts} (100%) rename utils/{getApiErrorMessage.ts => get-api-error-message.ts} (100%) rename utils/{getCurrentSeason.ts => get-current-season.ts} (100%) rename utils/{getDeclensionWord.ts => get-declension-word.ts} (100%) rename utils/{getQueryClient.ts => get-query-client.ts} (100%) rename utils/{getScheduleDuration.ts => get-schedule-duration.ts} (100%) rename utils/{parseTextFromMarkDown.ts => parse-text-from-markdown.ts} (100%) rename utils/{truncateText.ts => truncate-text.ts} (100%) diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/characters/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/characters/page.tsx index e4425026..da44ee51 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/characters/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/characters/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Characters from '@/features/anime/anime-view/characters/characters.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/comments/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/comments/page.tsx index ee07d9ce..dcb17f25 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/comments/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/comments/page.tsx @@ -4,8 +4,8 @@ import { Metadata, ResolvingMetadata } from 'next'; import Comments from '@/features/comments/comment-list/comment-list.component'; import getComments from '@/services/api/comments/getComments'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/franchise/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/franchise/page.tsx index 9a0d8c91..a8bd5582 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/franchise/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/franchise/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Franchise from '@/features/anime/anime-view/franchise.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/links/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/links/page.tsx index 7c96a6aa..7e56fc2b 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/links/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/links/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Links from '@/features/anime/anime-view/links.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/media/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/media/page.tsx index c427dea7..fd277fb9 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/media/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/media/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Media from '@/features/anime/anime-view/media/media.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/(animeDetails)/staff/page.tsx b/app/(pages)/(content)/anime/[slug]/(animeDetails)/staff/page.tsx index 009732ce..2b90830b 100644 --- a/app/(pages)/(content)/anime/[slug]/(animeDetails)/staff/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/(animeDetails)/staff/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Staff from '@/features/anime/anime-view/staff.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { slug: string } }, diff --git a/app/(pages)/(content)/anime/[slug]/anime.schema.ts b/app/(pages)/(content)/anime/[slug]/anime.schema.ts index 5bff45b4..1d59732b 100644 --- a/app/(pages)/(content)/anime/[slug]/anime.schema.ts +++ b/app/(pages)/(content)/anime/[slug]/anime.schema.ts @@ -1,4 +1,4 @@ -import parseTextFromMarkDown from '@/utils/parseTextFromMarkDown'; +import parseTextFromMarkDown from '@/utils/parse-text-from-markdown'; const jsonSchema = ({ anime }: { anime: API.AnimeInfo }) => ({ '@context': 'http://schema.org', diff --git a/app/(pages)/(content)/anime/[slug]/layout.metadata.ts b/app/(pages)/(content)/anime/[slug]/layout.metadata.ts index 772c746e..8cc4553e 100644 --- a/app/(pages)/(content)/anime/[slug]/layout.metadata.ts +++ b/app/(pages)/(content)/anime/[slug]/layout.metadata.ts @@ -3,9 +3,9 @@ import { Metadata } from 'next'; import getAnimeInfo, { Response as AnimeResponse, } from '@/services/api/anime/getAnimeInfo'; -import _generateMetadata from '@/utils/generateMetadata'; -import parseTextFromMarkDown from '@/utils/parseTextFromMarkDown'; -import truncateText from '@/utils/truncateText'; +import _generateMetadata from '@/utils/generate-metadata'; +import parseTextFromMarkDown from '@/utils/parse-text-from-markdown'; +import truncateText from '@/utils/truncate-text'; export interface MetadataProps { params: { slug: string }; diff --git a/app/(pages)/(content)/anime/[slug]/layout.tsx b/app/(pages)/(content)/anime/[slug]/layout.tsx index 78a09915..f3ba1fd7 100644 --- a/app/(pages)/(content)/anime/[slug]/layout.tsx +++ b/app/(pages)/(content)/anime/[slug]/layout.tsx @@ -16,7 +16,7 @@ import Title from '@/features/anime/anime-view/title.component'; import getAnimeInfo from '@/services/api/anime/getAnimeInfo'; import { ANIME_NAV_ROUTES, RELEASE_STATUS } from '@/utils/constants'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; import _generateMetadata, { MetadataProps } from './layout.metadata'; import prefetchQueries from './layout.queries'; diff --git a/app/(pages)/(content)/characters/[slug]/layout.tsx b/app/(pages)/(content)/characters/[slug]/layout.tsx index 333766c5..b1a8a28f 100644 --- a/app/(pages)/(content)/characters/[slug]/layout.tsx +++ b/app/(pages)/(content)/characters/[slug]/layout.tsx @@ -15,7 +15,7 @@ import Title from '@/features/characters/character-view/title.component'; import getCharacterInfo from '@/services/api/characters/getCharacterInfo'; import { CHARACTER_NAV_ROUTES } from '@/utils/constants'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; import _generateMetadata, { MetadataProps } from './layout.metadata'; import prefetchQueries from './layout.queries'; diff --git a/app/(pages)/(content)/people/[slug]/layout.tsx b/app/(pages)/(content)/people/[slug]/layout.tsx index 64039e3b..7d8a70b4 100644 --- a/app/(pages)/(content)/people/[slug]/layout.tsx +++ b/app/(pages)/(content)/people/[slug]/layout.tsx @@ -15,7 +15,7 @@ import Title from '@/features/people/person-view/title.component'; import getPersonInfo from '@/services/api/people/getPersonInfo'; import { PERSON_NAV_ROUTES } from '@/utils/constants'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; import _generateMetadata, { MetadataProps } from './layout.metadata'; import prefetchQueries from './layout.queries'; diff --git a/app/(pages)/(home)/page.queries.ts b/app/(pages)/(home)/page.queries.ts index d655f9bf..2fbcb840 100644 --- a/app/(pages)/(home)/page.queries.ts +++ b/app/(pages)/(home)/page.queries.ts @@ -5,7 +5,7 @@ import getLatestComments from '@/services/api/comments/getLatestComments'; import getFollowingHistory from '@/services/api/history/getFollowingHistory'; import getAnimeSchedule from '@/services/api/stats/getAnimeSchedule'; import getWatchList from '@/services/api/watch/getWatchList'; -import getCurrentSeason from '@/utils/getCurrentSeason'; +import getCurrentSeason from '@/utils/get-current-season'; interface Props { queryClient: QueryClient; diff --git a/app/(pages)/(home)/page.tsx b/app/(pages)/(home)/page.tsx index 9a8a2695..9a134621 100644 --- a/app/(pages)/(home)/page.tsx +++ b/app/(pages)/(home)/page.tsx @@ -12,7 +12,7 @@ import Schedule from '@/features/home/schedule/schedule.component'; import prefetchQueries from '@/app/(pages)/(home)/page.queries'; import getLoggedUserInfo from '@/services/api/user/getLoggedUserInfo'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; const Page = async () => { const queryClient = await getQueryClient(); diff --git a/app/(pages)/(user)/u/[username]/favorites/page.tsx b/app/(pages)/(user)/u/[username]/favorites/page.tsx index 98ec6e29..92fd6ab7 100644 --- a/app/(pages)/(user)/u/[username]/favorites/page.tsx +++ b/app/(pages)/(user)/u/[username]/favorites/page.tsx @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import Favorites from '@/features/users/user-profile/user-favorites/user-favorites.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { username: string } }, diff --git a/app/(pages)/(user)/u/[username]/history/page.tsx b/app/(pages)/(user)/u/[username]/history/page.tsx index 7578fbb1..83e34151 100644 --- a/app/(pages)/(user)/u/[username]/history/page.tsx +++ b/app/(pages)/(user)/u/[username]/history/page.tsx @@ -7,8 +7,8 @@ import History from '@/features/users/user-history/user-history.component'; import getFollowingHistory from '@/services/api/history/getFollowingHistory'; import { getCookie } from '@/utils/cookies'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export const metadata: Metadata = _generateMetadata({ title: 'Активність', diff --git a/app/(pages)/(user)/u/[username]/layout.metadata.ts b/app/(pages)/(user)/u/[username]/layout.metadata.ts index ee0997ee..03e7a3f9 100644 --- a/app/(pages)/(user)/u/[username]/layout.metadata.ts +++ b/app/(pages)/(user)/u/[username]/layout.metadata.ts @@ -3,7 +3,7 @@ import { Metadata, ResolvingMetadata } from 'next'; import getUserInfo, { Response as UserResponse, } from '@/services/api/user/getUserInfo'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export interface MetadataProps { params: { diff --git a/app/(pages)/(user)/u/[username]/layout.tsx b/app/(pages)/(user)/u/[username]/layout.tsx index 665fdd28..25e3c1ee 100644 --- a/app/(pages)/(user)/u/[username]/layout.tsx +++ b/app/(pages)/(user)/u/[username]/layout.tsx @@ -19,7 +19,7 @@ import ListStats from '@/features/users/user-profile/list-stats.component'; import UserTitle from '@/features/users/user-title.component'; import { USER_NAV_ROUTES } from '@/utils/constants'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; import _generateMetadata, { MetadataProps } from './layout.metadata'; import prefetchQueries from './layout.queries'; diff --git a/app/(pages)/(user)/u/[username]/list/page.tsx b/app/(pages)/(user)/u/[username]/list/page.tsx index d285b47c..f2dd154c 100644 --- a/app/(pages)/(user)/u/[username]/list/page.tsx +++ b/app/(pages)/(user)/u/[username]/list/page.tsx @@ -10,7 +10,7 @@ import ToolsCombobox from '@/features/users/user-watchlist/tools-combobox.compon import ViewCombobox from '@/features/users/user-watchlist/view-combobox.component'; import List from '@/features/users/user-watchlist/watchlist/watchlist.component'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata( { params }: { params: { username: string } }, diff --git a/app/(pages)/(user)/u/[username]/page.tsx b/app/(pages)/(user)/u/[username]/page.tsx index d69673ff..e715d82f 100644 --- a/app/(pages)/(user)/u/[username]/page.tsx +++ b/app/(pages)/(user)/u/[username]/page.tsx @@ -10,7 +10,7 @@ import Statistics from '@/features/users/user-profile/user-statistics/user-stati import getFavouriteList from '@/services/api/favourite/getFavouriteList'; import getUserActivity from '@/services/api/user/getUserActivity'; import getUserHistory from '@/services/api/user/getUserHistory'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; interface Props { params: { diff --git a/app/(pages)/collections/(collections)/page.tsx b/app/(pages)/collections/(collections)/page.tsx index 592d80af..6cae1902 100644 --- a/app/(pages)/collections/(collections)/page.tsx +++ b/app/(pages)/collections/(collections)/page.tsx @@ -16,8 +16,8 @@ import CollectionSort from '@/features/collections/collection-list/collection-so import getCollections from '@/services/api/collections/getCollections'; import { getCookie } from '@/utils/cookies'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export async function generateMetadata(): Promise { return _generateMetadata({ diff --git a/app/(pages)/collections/[reference]/page.tsx b/app/(pages)/collections/[reference]/page.tsx index 35263774..fcde70cd 100644 --- a/app/(pages)/collections/[reference]/page.tsx +++ b/app/(pages)/collections/[reference]/page.tsx @@ -13,8 +13,8 @@ import CollectionTitle from '@/features/collections/collection-view/collection-t import getCollection from '@/services/api/collections/getCollection'; import CollectionProvider from '@/services/providers/collection-provider'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export async function generateMetadata({ params: { reference }, diff --git a/app/(pages)/collections/new/page.tsx b/app/(pages)/collections/new/page.tsx index d678d396..197e3f5b 100644 --- a/app/(pages)/collections/new/page.tsx +++ b/app/(pages)/collections/new/page.tsx @@ -10,7 +10,7 @@ import CollectionSettings from '@/features/collections/collection-edit/collectio import CollectionTitle from '@/features/collections/collection-edit/collection-title.component'; import CollectionProvider from '@/services/providers/collection-provider'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; export async function generateMetadata(): Promise { return _generateMetadata({ diff --git a/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx b/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx index 84fcae00..9ca177d8 100644 --- a/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx +++ b/app/(pages)/comments/[content_type]/[slug]/[[...comment_reference]]/page.tsx @@ -10,8 +10,8 @@ import { getContent } from '@/features/comments/useContent'; import getCommentThread from '@/services/api/comments/getCommentThread'; import getComments from '@/services/api/comments/getComments'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export async function generateMetadata(): Promise { return _generateMetadata({ diff --git a/app/(pages)/comments/latest/page.tsx b/app/(pages)/comments/latest/page.tsx index 00c2e6db..79fc603b 100644 --- a/app/(pages)/comments/latest/page.tsx +++ b/app/(pages)/comments/latest/page.tsx @@ -6,8 +6,8 @@ import { FC } from 'react'; import Comments from '@/features/comments/latest-comments.component'; import getGlobalComments from '@/services/api/comments/getGlobalComments'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export const metadata: Metadata = _generateMetadata({ title: 'Останні коментарі', diff --git a/app/(pages)/edit/[editId]/layout.tsx b/app/(pages)/edit/[editId]/layout.tsx index 607c50b8..4261fba3 100644 --- a/app/(pages)/edit/[editId]/layout.tsx +++ b/app/(pages)/edit/[editId]/layout.tsx @@ -20,8 +20,8 @@ import EditStatus from '@/features/edit/edit-status.component'; import getComments from '@/services/api/comments/getComments'; import getEdit from '@/services/api/edit/getEdit'; import { EDIT_NAV_ROUTES } from '@/utils/constants'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; interface Props { params: { editId: string }; diff --git a/app/(pages)/edit/content/page.tsx b/app/(pages)/edit/content/page.tsx index 0266e4b1..eab88e4c 100644 --- a/app/(pages)/edit/content/page.tsx +++ b/app/(pages)/edit/content/page.tsx @@ -8,8 +8,8 @@ import NavMenu from '@/components/navigation/nav-dropdown'; import ContentList from '@/features/edit/edit-content-list.component'; import { EDIT_NAV_ROUTES } from '@/utils/constants'; -import _generateMetadata from '@/utils/generateMetadata'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getQueryClient from '@/utils/get-query-client'; export async function generateMetadata(): Promise { return _generateMetadata({ diff --git a/app/(pages)/edit/layout.tsx b/app/(pages)/edit/layout.tsx index ebb1a0e8..63795d5a 100644 --- a/app/(pages)/edit/layout.tsx +++ b/app/(pages)/edit/layout.tsx @@ -1,11 +1,11 @@ import { Metadata } from 'next'; -import React, { FC, PropsWithChildren } from 'react'; +import { FC, PropsWithChildren } from 'react'; import InternalNavBar from '@/components/navigation/nav-tabs'; import SubBar from '@/components/navigation/sub-nav'; import { EDIT_NAV_ROUTES } from '@/utils/constants'; -import _generateMetadata from '@/utils/generateMetadata'; +import _generateMetadata from '@/utils/generate-metadata'; interface Props extends PropsWithChildren {} diff --git a/app/(pages)/edit/new/page.tsx b/app/(pages)/edit/new/page.tsx index d976f27c..2d65def1 100644 --- a/app/(pages)/edit/new/page.tsx +++ b/app/(pages)/edit/new/page.tsx @@ -13,7 +13,7 @@ import RulesAlert from '@/features/edit/edit-rules-alert.component'; import getAnimeInfo from '@/services/api/anime/getAnimeInfo'; import getCharacterInfo from '@/services/api/characters/getCharacterInfo'; import getPersonInfo from '@/services/api/people/getPersonInfo'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; interface Props { searchParams: { [key: string]: string | string[] | undefined }; diff --git a/app/(pages)/edit/page.tsx b/app/(pages)/edit/page.tsx index ab6b6c40..f299a446 100644 --- a/app/(pages)/edit/page.tsx +++ b/app/(pages)/edit/page.tsx @@ -18,7 +18,7 @@ import EditFiltersModal from '@/features/modals/edit-filters-modal'; import getEditList from '@/services/api/edit/getEditList'; import getEditTop from '@/services/api/stats/edit/getEditTop'; import { EDIT_NAV_ROUTES } from '@/utils/constants'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; const EditListPage = async ({ searchParams: { page, content_type, order, sort, edit_status }, diff --git a/app/(pages)/schedule/page.tsx b/app/(pages)/schedule/page.tsx index a6177ece..6e57ca51 100644 --- a/app/(pages)/schedule/page.tsx +++ b/app/(pages)/schedule/page.tsx @@ -14,9 +14,9 @@ import ScheduleFiltersModal from '@/features/modals/schedule-filters-modal'; import ScheduleList from '@/features/schedule/schedule-list/schedule-list.component'; import getAnimeSchedule from '@/services/api/stats/getAnimeSchedule'; -import _generateMetadata from '@/utils/generateMetadata'; -import getCurrentSeason from '@/utils/getCurrentSeason'; -import getQueryClient from '@/utils/getQueryClient'; +import _generateMetadata from '@/utils/generate-metadata'; +import getCurrentSeason from '@/utils/get-current-season'; +import getQueryClient from '@/utils/get-query-client'; export const metadata: Metadata = _generateMetadata({ title: { diff --git a/app/layout.tsx b/app/layout.tsx index cc040cd1..8ec0ff49 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,7 +9,7 @@ import { TailwindIndicator } from '@/components/tailwind-indicator'; import Providers from '@/features/common/providers.component'; -import generateMetadata from '@/utils/generateMetadata'; +import generateMetadata from '@/utils/generate-metadata'; import './globals.css'; diff --git a/components/comments-button.tsx b/components/comments-button.tsx index 97bd7c58..a07c06f7 100644 --- a/components/comments-button.tsx +++ b/components/comments-button.tsx @@ -1,12 +1,12 @@ 'use client'; import Link from 'next/link'; -import React, { FC } from 'react'; +import { FC } from 'react'; import IconamoonCommentFill from '~icons/iconamoon/comment-fill'; import { Button } from '@/components/ui/button'; -import getDeclensionWord from '@/utils/getDeclensionWord'; +import getDeclensionWord from '@/utils/get-declension-word'; const COMMENT_DECLENSIONS: [string, string, string] = [ 'коментар', diff --git a/components/history-item.tsx b/components/history-item.tsx index 5351e3bd..16a5c676 100644 --- a/components/history-item.tsx +++ b/components/history-item.tsx @@ -1,5 +1,4 @@ import Link from 'next/link'; -import * as React from 'react'; import { FC, Fragment, memo } from 'react'; import MaterialSymbolsInfoRounded from '~icons/material-symbols/info-rounded'; @@ -11,7 +10,7 @@ import { TooltipTrigger, } from '@/components/ui/tooltip'; -import { convertActivity } from '@/utils/convertActivity'; +import { convertActivity } from '@/utils/convert-activity'; interface Props { data: API.History; diff --git a/components/page-pagination.tsx b/components/page-pagination.tsx index c047d26d..a4d58cf9 100644 --- a/components/page-pagination.tsx +++ b/components/page-pagination.tsx @@ -1,11 +1,10 @@ 'use client'; import { usePathname, useRouter, useSearchParams } from 'next/navigation'; -import * as React from 'react'; import Pagination from '@/components/ui/pagination'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; interface Props { pagination: API.Pagination; diff --git a/features/anime/anime-list-navbar/search.tsx b/features/anime/anime-list-navbar/search.tsx index 29dfbaac..22889966 100644 --- a/features/anime/anime-list-navbar/search.tsx +++ b/features/anime/anime-list-navbar/search.tsx @@ -5,7 +5,7 @@ import { useState } from 'react'; import { Input } from '@/components/ui/input'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; const Search = () => { const router = useRouter(); diff --git a/features/anime/anime-list/anime-list.hooks.ts b/features/anime/anime-list/anime-list.hooks.ts index 16be5932..2c69b91a 100644 --- a/features/anime/anime-list/anime-list.hooks.ts +++ b/features/anime/anime-list/anime-list.hooks.ts @@ -4,7 +4,7 @@ import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import useAnimeCatalog, { Props, } from '@/services/hooks/anime/use-anime-catalog'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; export const useUpdatePage = ({ page, iPage }: Props) => { const queryClient = useQueryClient(); diff --git a/features/collections/collection-list/collection-sort.tsx b/features/collections/collection-list/collection-sort.tsx index 1edd4d07..9dd57b38 100644 --- a/features/collections/collection-list/collection-sort.tsx +++ b/features/collections/collection-list/collection-sort.tsx @@ -1,11 +1,10 @@ 'use client'; import { useRouter, useSearchParams } from 'next/navigation'; -import * as React from 'react'; import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; const CollectionSort = () => { const router = useRouter(); diff --git a/features/comments/comment-list/comment.tsx b/features/comments/comment-list/comment.tsx index 5ba6571e..805edb41 100644 --- a/features/comments/comment-list/comment.tsx +++ b/features/comments/comment-list/comment.tsx @@ -18,7 +18,7 @@ import CommentMenu from '@/features/comments/comment-list/comment-menu'; import CommentVote from '@/features/comments/comment-list/comment-vote'; import { useCommentsContext } from '@/services/providers/comments-provider'; -import getDeclensionWord from '@/utils/getDeclensionWord'; +import getDeclensionWord from '@/utils/get-declension-word'; import Comments from './comments'; diff --git a/features/common/navbar/notifications-menu/notifications-menu.component.tsx b/features/common/navbar/notifications-menu/notifications-menu.component.tsx index a3f24da5..63b09c23 100644 --- a/features/common/navbar/notifications-menu/notifications-menu.component.tsx +++ b/features/common/navbar/notifications-menu/notifications-menu.component.tsx @@ -16,7 +16,7 @@ import { import useNotifications from '@/services/hooks/notifications/use-notifications'; import useNotificationsCount from '@/services/hooks/notifications/use-notifications-count'; import useSeenNotification from '@/services/hooks/notifications/use-seen-notification'; -import { convertNotification } from '@/utils/convertNotification'; +import { convertNotification } from '@/utils/convert-notification'; import NotFoundNotifications from './not-found-notifications'; import NotificationItem from './notification-item'; diff --git a/features/common/providers.component.tsx b/features/common/providers.component.tsx index b5d9731e..b65aff44 100644 --- a/features/common/providers.component.tsx +++ b/features/common/providers.component.tsx @@ -6,7 +6,7 @@ import { uk } from 'date-fns/locale'; import setDefaultOptions from 'date-fns/setDefaultOptions'; import { AppProgressBar as ProgressBar } from 'next-nprogress-bar'; import { SnackbarProvider, enqueueSnackbar } from 'notistack'; -import React, { FC, PropsWithChildren, useState } from 'react'; +import { FC, PropsWithChildren, useState } from 'react'; import SnackbarItem from '@/components/snackbar-item'; import { TooltipProvider } from '@/components/ui/tooltip'; @@ -14,7 +14,7 @@ import { TooltipProvider } from '@/components/ui/tooltip'; import ModalProvider from '@/services/providers/modal-provider'; import SettingsProvider from '@/services/providers/settings-provider'; import ThemeProvider from '@/services/providers/theme-provider'; -import { createQueryClient } from '@/utils/getQueryClient'; +import { createQueryClient } from '@/utils/get-query-client'; import { SnackbarUtilsConfigurator } from '@/utils/snackbar-utils'; interface Props extends PropsWithChildren {} diff --git a/features/common/session-manager.component.tsx b/features/common/session-manager.component.tsx index 037dad1a..65dd76b8 100644 --- a/features/common/session-manager.component.tsx +++ b/features/common/session-manager.component.tsx @@ -4,7 +4,7 @@ import { PropsWithChildren } from 'react'; import getLoggedUserInfo from '@/services/api/user/getLoggedUserInfo'; import { getCookie } from '@/utils/cookies'; -import getQueryClient from '@/utils/getQueryClient'; +import getQueryClient from '@/utils/get-query-client'; interface Props extends PropsWithChildren {} diff --git a/features/edit/edit-forms/edit-create-form.component.tsx b/features/edit/edit-forms/edit-create-form.component.tsx index 4f44dd7c..d9a481ec 100644 --- a/features/edit/edit-forms/edit-create-form.component.tsx +++ b/features/edit/edit-forms/edit-create-form.component.tsx @@ -17,7 +17,7 @@ import { getEditParamSlugs, getEditParams, getFilteredEditParams, -} from '@/utils/editParamUtils'; +} from '@/utils/edit-param-utils'; import EditDescription from './edit-description'; diff --git a/features/edit/edit-forms/edit-group.tsx b/features/edit/edit-forms/edit-group.tsx index c3e3d03b..a1b83ad4 100644 --- a/features/edit/edit-forms/edit-group.tsx +++ b/features/edit/edit-forms/edit-group.tsx @@ -12,7 +12,7 @@ import { CollapsibleTrigger, } from '@/components/ui/collapsible'; -import { getEditParamComponent } from '@/utils/editParamUtils'; +import { getEditParamComponent } from '@/utils/edit-param-utils'; interface Props { title: string; diff --git a/features/edit/edit-forms/edit-view-form.component.tsx b/features/edit/edit-forms/edit-view-form.component.tsx index 36d8369d..25d29d4e 100644 --- a/features/edit/edit-forms/edit-view-form.component.tsx +++ b/features/edit/edit-forms/edit-view-form.component.tsx @@ -19,7 +19,7 @@ import { getEditParamSlugs, getEditParams, getFilteredEditParams, -} from '@/utils/editParamUtils'; +} from '@/utils/edit-param-utils'; type FormValues = Record & { description: string; diff --git a/features/filters/anime-filters.component.tsx b/features/filters/anime-filters.component.tsx index 06a9b7c7..c49d620e 100644 --- a/features/filters/anime-filters.component.tsx +++ b/features/filters/anime-filters.component.tsx @@ -35,7 +35,7 @@ import { RELEASE_STATUS, SEASON, } from '@/utils/constants'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; import { cn } from '@/utils/utils'; import BadgeFilter from './badge-filter'; diff --git a/features/filters/edit-filters.component.tsx b/features/filters/edit-filters.component.tsx index 0898c6bd..7382dd7c 100644 --- a/features/filters/edit-filters.component.tsx +++ b/features/filters/edit-filters.component.tsx @@ -24,7 +24,7 @@ import { import useUsers from '@/services/hooks/user/use-users'; import { EDIT_STATUSES } from '@/utils/constants'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; import { cn } from '@/utils/utils'; interface Props { diff --git a/features/filters/schedule-filters.component.tsx b/features/filters/schedule-filters.component.tsx index e479ba5b..ba8ad128 100644 --- a/features/filters/schedule-filters.component.tsx +++ b/features/filters/schedule-filters.component.tsx @@ -21,8 +21,8 @@ import { Switch } from '@/components/ui/switch'; import useSession from '@/services/hooks/auth/use-session'; import { RELEASE_STATUS, SEASON } from '@/utils/constants'; -import createQueryString from '@/utils/createQueryString'; -import getCurrentSeason from '@/utils/getCurrentSeason'; +import createQueryString from '@/utils/create-query-string'; +import getCurrentSeason from '@/utils/get-current-season'; import { cn } from '@/utils/utils'; const YEARS = range(2023, new Date().getFullYear() + 1).reverse(); diff --git a/features/home/schedule/schedule-item.tsx b/features/home/schedule/schedule-item.tsx index 4f274e2d..cdfacdfd 100644 --- a/features/home/schedule/schedule-item.tsx +++ b/features/home/schedule/schedule-item.tsx @@ -6,7 +6,7 @@ import H5 from '@/components/typography/h5'; import P from '@/components/typography/p'; import HorizontalContentCard from '@/components/ui/horizontal-content-card'; -import getScheduleDuration from '@/utils/getScheduleDuration'; +import getScheduleDuration from '@/utils/get-schedule-duration'; import { cn } from '@/utils/utils'; interface Props { diff --git a/features/modals/search-modal/useAnimeSearchList.ts b/features/modals/search-modal/useAnimeSearchList.ts index 426d6872..f761a31f 100644 --- a/features/modals/search-modal/useAnimeSearchList.ts +++ b/features/modals/search-modal/useAnimeSearchList.ts @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import getAnimeCatalog from '@/services/api/anime/getAnimeCatalog'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnimeList } from '@/utils/animeAdapter'; +import { convertAnimeList } from '@/utils/anime-adapter'; interface Props { value?: string; diff --git a/features/schedule/schedule-list/schedule-item.tsx b/features/schedule/schedule-list/schedule-item.tsx index 94ae8b57..8fb4492c 100644 --- a/features/schedule/schedule-list/schedule-item.tsx +++ b/features/schedule/schedule-list/schedule-item.tsx @@ -10,7 +10,7 @@ import HorizontalContentCard, { import ScheduleWatchButton from '@/features/schedule/schedule-list/schedule-watch-button'; -import getScheduleDuration from '@/utils/getScheduleDuration'; +import getScheduleDuration from '@/utils/get-schedule-duration'; import { cn } from '@/utils/utils'; interface Props extends Omit { diff --git a/features/users/user-profile/user-statistics/activity-stats/activity-item.tsx b/features/users/user-profile/user-statistics/activity-stats/activity-item.tsx index 8be37411..1b28b615 100644 --- a/features/users/user-profile/user-statistics/activity-stats/activity-item.tsx +++ b/features/users/user-profile/user-statistics/activity-stats/activity-item.tsx @@ -1,6 +1,6 @@ import format from 'date-fns/format'; import toDate from 'date-fns/toDate'; -import React, { FC } from 'react'; +import { FC } from 'react'; import P from '@/components/typography/p'; import { Label } from '@/components/ui/label'; @@ -10,7 +10,7 @@ import { TooltipTrigger, } from '@/components/ui/tooltip'; -import getDeclensionWord from '@/utils/getDeclensionWord'; +import getDeclensionWord from '@/utils/get-declension-word'; interface Props { item: API.Activity; diff --git a/features/users/user-profile/user-statistics/activity-stats/activity-stats.tsx b/features/users/user-profile/user-statistics/activity-stats/activity-stats.tsx index 8fd4b2a5..dd53af22 100644 --- a/features/users/user-profile/user-statistics/activity-stats/activity-stats.tsx +++ b/features/users/user-profile/user-statistics/activity-stats/activity-stats.tsx @@ -6,7 +6,7 @@ import MaterialSymbolsBarChartRounded from '~icons/material-symbols/bar-chart-ro import { Label } from '@/components/ui/label'; import useUserActivity from '@/services/hooks/user/use-user-activity'; -import { convertToDays } from '@/utils/convertActivityStats'; +import { convertToDays } from '@/utils/convert-activity-stats'; import ActivityItem from './activity-item'; diff --git a/features/users/user-watchlist/status-combobox.component.tsx b/features/users/user-watchlist/status-combobox.component.tsx index 79477848..f88061e6 100644 --- a/features/users/user-watchlist/status-combobox.component.tsx +++ b/features/users/user-watchlist/status-combobox.component.tsx @@ -22,7 +22,7 @@ import { import useWatchList from '@/services/hooks/watch/use-watch-list'; import { WATCH_STATUS } from '@/utils/constants'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; const StatusCombobox = () => { const searchParams = useSearchParams(); diff --git a/features/users/user-watchlist/view-combobox.component.tsx b/features/users/user-watchlist/view-combobox.component.tsx index 3090a863..77d18140 100644 --- a/features/users/user-watchlist/view-combobox.component.tsx +++ b/features/users/user-watchlist/view-combobox.component.tsx @@ -14,7 +14,7 @@ import { SelectTrigger, } from '@/components/ui/select'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; type View = 'table' | 'grid'; diff --git a/features/users/user-watchlist/watchlist/table-view.tsx b/features/users/user-watchlist/watchlist/table-view.tsx index d4a362b0..5d7d9c68 100644 --- a/features/users/user-watchlist/watchlist/table-view.tsx +++ b/features/users/user-watchlist/watchlist/table-view.tsx @@ -11,7 +11,7 @@ import { TableRow, } from '@/components/ui/table'; -import createQueryString from '@/utils/createQueryString'; +import createQueryString from '@/utils/create-query-string'; import { cn } from '@/utils/utils'; import DetailsCell from './details-cell'; diff --git a/next.config.mjs b/next.config.mjs index 265529c4..71f360ea 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,5 @@ -import Icons from 'unplugin-icons/webpack'; - import bundleAnalyzer from '@next/bundle-analyzer'; +import Icons from 'unplugin-icons/webpack'; /** @type {import('next').NextConfig} */ const nextConfig = { diff --git a/services/hooks/anime/use-anime-catalog.ts b/services/hooks/anime/use-anime-catalog.ts index d875dc5b..b8315b32 100644 --- a/services/hooks/anime/use-anime-catalog.ts +++ b/services/hooks/anime/use-anime-catalog.ts @@ -6,7 +6,7 @@ import getAnimeCatalog, { Response as AnimeCatalogResponse, } from '@/services/api/anime/getAnimeCatalog'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnimeList } from '@/utils/animeAdapter'; +import { convertAnimeList } from '@/utils/anime-adapter'; export interface Props extends AnimeCatalogParams { page: number; diff --git a/services/hooks/anime/use-anime-info.ts b/services/hooks/anime/use-anime-info.ts index 55a42ba0..226085f7 100644 --- a/services/hooks/anime/use-anime-info.ts +++ b/services/hooks/anime/use-anime-info.ts @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import getAnimeInfo, { Params } from '@/services/api/anime/getAnimeInfo'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useAnimeInfo = ({ slug }: Params, options?: Hikka.QueryOptions) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/anime/use-franchise.ts b/services/hooks/anime/use-franchise.ts index d4519c3e..b8a00061 100644 --- a/services/hooks/anime/use-franchise.ts +++ b/services/hooks/anime/use-franchise.ts @@ -3,7 +3,7 @@ import getAnimeFranchise, { } from '@/services/api/anime/getAnimeFranchise'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnimeList } from '@/utils/animeAdapter'; +import { convertAnimeList } from '@/utils/anime-adapter'; const useFranchise = ({ slug }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/characters/use-character-anime.ts b/services/hooks/characters/use-character-anime.ts index 3d30485f..afd8912e 100644 --- a/services/hooks/characters/use-character-anime.ts +++ b/services/hooks/characters/use-character-anime.ts @@ -3,7 +3,7 @@ import getCharacterAnime, { } from '@/services/api/characters/getCharacterAnime'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useCharacterAnime = ({ slug }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/characters/use-character-voices.ts b/services/hooks/characters/use-character-voices.ts index 86fc2ac7..282dc6ba 100644 --- a/services/hooks/characters/use-character-voices.ts +++ b/services/hooks/characters/use-character-voices.ts @@ -3,7 +3,7 @@ import getCharacterVoices, { } from '@/services/api/characters/getCharacterVoices'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const usePersonCharacters = ({ slug }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/edit/todo/use-todo-anime.ts b/services/hooks/edit/todo/use-todo-anime.ts index ff636019..f412cc9d 100644 --- a/services/hooks/edit/todo/use-todo-anime.ts +++ b/services/hooks/edit/todo/use-todo-anime.ts @@ -1,7 +1,7 @@ import getTodoAnime, { Params } from '@/services/api/edit/todo/getTodoAnime'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnimeList } from '@/utils/animeAdapter'; +import { convertAnimeList } from '@/utils/anime-adapter'; const useTodoAnime = ({ param }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/edit/use-edit-list.ts b/services/hooks/edit/use-edit-list.ts index 2d45706b..4f758d8d 100644 --- a/services/hooks/edit/use-edit-list.ts +++ b/services/hooks/edit/use-edit-list.ts @@ -3,7 +3,7 @@ import { useSearchParams } from 'next/navigation'; import getEditList, { Params } from '@/services/api/edit/getEditList'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useEditList = ({ page }: Params, options?: Hikka.QueryOptions) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/favorite/use-favorites.ts b/services/hooks/favorite/use-favorites.ts index 9b1427a6..fa835673 100644 --- a/services/hooks/favorite/use-favorites.ts +++ b/services/hooks/favorite/use-favorites.ts @@ -3,7 +3,7 @@ import getFavouriteList, { } from '@/services/api/favourite/getFavouriteList'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useFavorites = ({ username, diff --git a/services/hooks/history/use-following-history.ts b/services/hooks/history/use-following-history.ts index 4167032c..ffb1a0d4 100644 --- a/services/hooks/history/use-following-history.ts +++ b/services/hooks/history/use-following-history.ts @@ -1,7 +1,7 @@ import getFollowingHistory from '@/services/api/history/getFollowingHistory'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useUserHistory = () => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/people/use-person-anime.ts b/services/hooks/people/use-person-anime.ts index 90caaf81..41051cad 100644 --- a/services/hooks/people/use-person-anime.ts +++ b/services/hooks/people/use-person-anime.ts @@ -1,7 +1,7 @@ import getPersonAnime, { Params } from '@/services/api/people/getPersonAnime'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const usePersonAnime = ({ slug }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/people/use-person-characters.ts b/services/hooks/people/use-person-characters.ts index ca58e7fc..980deabc 100644 --- a/services/hooks/people/use-person-characters.ts +++ b/services/hooks/people/use-person-characters.ts @@ -3,7 +3,7 @@ import getPersonCharacters, { } from '@/services/api/people/getPersonCharacters'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const usePersonCharacters = ({ slug }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/stats/use-anime-schedule.ts b/services/hooks/stats/use-anime-schedule.ts index 58eda7f9..580bc197 100644 --- a/services/hooks/stats/use-anime-schedule.ts +++ b/services/hooks/stats/use-anime-schedule.ts @@ -3,8 +3,8 @@ import { useSearchParams } from 'next/navigation'; import getAnimeSchedule from '@/services/api/stats/getAnimeSchedule'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; -import getCurrentSeason from '@/utils/getCurrentSeason'; +import { convertAnime } from '@/utils/anime-adapter'; +import getCurrentSeason from '@/utils/get-current-season'; const useAnimeSchedule = () => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/user/use-user-history.ts b/services/hooks/user/use-user-history.ts index c0a9fd0d..e90f1ffd 100644 --- a/services/hooks/user/use-user-history.ts +++ b/services/hooks/user/use-user-history.ts @@ -1,7 +1,7 @@ import getUserHistory, { Params } from '@/services/api/user/getUserHistory'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useUserHistory = ({ username }: Params) => { const { titleLanguage } = useSettingsContext(); diff --git a/services/hooks/watch/use-watch-list.ts b/services/hooks/watch/use-watch-list.ts index 0ae2c45a..f9fb936d 100644 --- a/services/hooks/watch/use-watch-list.ts +++ b/services/hooks/watch/use-watch-list.ts @@ -3,7 +3,7 @@ import { useSearchParams } from 'next/navigation'; import getWatchList from '@/services/api/watch/getWatchList'; import useInfiniteList from '@/services/hooks/use-infinite-list'; import { useSettingsContext } from '@/services/providers/settings-provider'; -import { convertAnime } from '@/utils/animeAdapter'; +import { convertAnime } from '@/utils/anime-adapter'; const useWatchList = ({ username, diff --git a/utils/animeAdapter.ts b/utils/anime-adapter.ts similarity index 100% rename from utils/animeAdapter.ts rename to utils/anime-adapter.ts diff --git a/utils/convertActivityStats.ts b/utils/convert-activity-stats.ts similarity index 100% rename from utils/convertActivityStats.ts rename to utils/convert-activity-stats.ts diff --git a/utils/convertActivity/convertFavoriteActivity.tsx b/utils/convert-activity/convert-favorite-activity.tsx similarity index 100% rename from utils/convertActivity/convertFavoriteActivity.tsx rename to utils/convert-activity/convert-favorite-activity.tsx diff --git a/utils/convertActivity/convertImportActivity.tsx b/utils/convert-activity/convert-import-activity.tsx similarity index 100% rename from utils/convertActivity/convertImportActivity.tsx rename to utils/convert-activity/convert-import-activity.tsx diff --git a/utils/convertActivity/convertWatchActivity.tsx b/utils/convert-activity/convert-watch-activity.tsx similarity index 98% rename from utils/convertActivity/convertWatchActivity.tsx rename to utils/convert-activity/convert-watch-activity.tsx index 8adf69f4..38ef0ca6 100644 --- a/utils/convertActivity/convertWatchActivity.tsx +++ b/utils/convert-activity/convert-watch-activity.tsx @@ -1,5 +1,5 @@ import { WATCH_STATUS } from '@/utils/constants'; -import getDeclensionWord from '@/utils/getDeclensionWord'; +import getDeclensionWord from '@/utils/get-declension-word'; const EPISODES_DECLENSION: [string, string, string] = [ 'епізод', diff --git a/utils/convertActivity/index.ts b/utils/convert-activity/index.ts similarity index 71% rename from utils/convertActivity/index.ts rename to utils/convert-activity/index.ts index f36950bf..7afa6ed8 100644 --- a/utils/convertActivity/index.ts +++ b/utils/convert-activity/index.ts @@ -1,6 +1,6 @@ -import { createFavoriteEvents } from '@/utils/convertActivity/convertFavoriteActivity'; -import { createImportEvents } from '@/utils/convertActivity/convertImportActivity'; -import { createWatchEvents } from '@/utils/convertActivity/convertWatchActivity'; +import { createFavoriteEvents } from './convert-favorite-activity'; +import { createImportEvents } from './convert-import-activity'; +import { createWatchEvents } from './convert-watch-activity'; export const convertActivity = ( history: API.History< diff --git a/utils/convertNotification.tsx b/utils/convert-notification.tsx similarity index 100% rename from utils/convertNotification.tsx rename to utils/convert-notification.tsx diff --git a/utils/convertRomaji.ts b/utils/convertRomaji.ts deleted file mode 100644 index f52335ec..00000000 --- a/utils/convertRomaji.ts +++ /dev/null @@ -1,181 +0,0 @@ -const ALPHABET: Record = { - a: 'а', - i: 'і', - u: 'у', - e: 'е', - o: 'о', - ka: 'ка', - ki: 'кі', - ku: 'ку', - ke: 'ке', - ko: 'ко', - ga: 'ґа', - gi: 'ґі', - gu: 'ґу', - ge: 'ґе', - go: 'ґо', - sa: 'са', - shi: 'ші', - su: 'су', - se: 'се', - so: 'со', - za: 'дза', - ji: 'джі', - zu: 'дзу', - ze: 'дзе', - zo: 'дзо', - ta: 'та', - chi: 'чі', - tsu: 'цу', - te: 'те', - to: 'то', - da: 'да', - de: 'де', - do: 'до', - na: 'на', - ni: 'ні', - nu: 'ну', - ne: 'не', - no: 'но', - ha: 'ха', - hi: 'хі', - fu: 'фу', - he: 'хе', - ho: 'хо', - ba: 'ба', - bi: 'бі', - bu: 'бу', - be: 'бе', - bo: 'бо', - pa: 'па', - pi: 'пі', - pu: 'пу', - pe: 'пе', - po: 'по', - ma: 'ма', - mi: 'мі', - mu: 'му', - me: 'ме', - mo: 'мо', - ya: 'я', - yu: 'ю', - yo: 'йо', - ra: 'ра', - ri: 'рі', - ru: 'ру', - re: 'ре', - ro: 'ро', - wa: 'ва', - wo: 'о', - n: 'н', - kya: 'кя', - kyu: 'кю', - kyo: 'кьо', - gya: 'ґя', - gyu: 'ґю', - gyo: 'ґьо', - sha: 'ся', - shu: 'сю', - sho: 'сьо', - ja: 'дзя', - ju: 'дзю', - jo: 'дзьо', - cha: 'чя', - chu: 'чю', - cho: 'чьо', - nya: 'ня', - nyu: 'ню', - nyo: 'ньо', - hya: 'хя', - hyu: 'хю', - hyo: 'хьо', - bya: 'бя', - byu: 'бю', - byo: 'бьо', - pya: 'пя', - pyu: 'пю', - pyo: 'пьо', - mya: 'мя', - myu: 'мю', - myo: 'мьо', - rya: 'ря', - ryu: 'рю', - ryo: 'рьо', -}; - -export function romajiToKovalenko(romaji: string): string { - const lowerRomaji = romaji.toLowerCase(); - let translated: string = ''; - let i: number = 0; - - while (i < lowerRomaji.length) { - if (lowerRomaji[i] === ' ') { - translated += ' '; - i++; - } else { - let checkLen: number = Math.min(3, lowerRomaji.length - i); - - while (checkLen > 0) { - const checkStr: string = lowerRomaji.slice(i, i + checkLen); - - if (ALPHABET[checkStr]) { - if ( - ['a', 'u', 'i', 'o', 'e'].includes( - lowerRomaji.slice(i - 1, i), - ) && - checkStr === 'i' - ) { - if (lowerRomaji.slice(i + 1, i + 2) === ' ') { - translated += 'й'; - } else { - translated += 'ї'; - } - } else if ( - checkStr === 'e' && - lowerRomaji.slice(i - 1, i) === 'i' - ) { - translated += 'є'; - } else if ( - checkStr === 'n' && - ['m', 'b', 'p'].includes( - lowerRomaji.slice(i + 1, i + 2), - ) - ) { - translated += 'м'; - } else { - translated += ALPHABET[checkStr]; - } - - i += checkLen; - - if (i < lowerRomaji.length) { - if ( - lowerRomaji[i] === 'o' && - lowerRomaji.slice(i - 1, i) === 'o' - ) { - translated += ALPHABET['u']; - i++; - } else if ( - lowerRomaji[i] === 'e' && - lowerRomaji.slice(i - 1, i) === 'e' - ) { - translated += ALPHABET['i']; - i++; - } - } - - break; - } - - checkLen--; - } - - if (checkLen === 0) { - translated += romaji[i]; - i++; - } - } - } - - return translated; -} diff --git a/utils/createQueryString.ts b/utils/create-query-string.ts similarity index 100% rename from utils/createQueryString.ts rename to utils/create-query-string.ts diff --git a/utils/editParamUtils.ts b/utils/edit-param-utils.ts similarity index 100% rename from utils/editParamUtils.ts rename to utils/edit-param-utils.ts diff --git a/utils/generateMetadata.ts b/utils/generate-metadata.ts similarity index 100% rename from utils/generateMetadata.ts rename to utils/generate-metadata.ts diff --git a/utils/getApiErrorMessage.ts b/utils/get-api-error-message.ts similarity index 100% rename from utils/getApiErrorMessage.ts rename to utils/get-api-error-message.ts diff --git a/utils/getCurrentSeason.ts b/utils/get-current-season.ts similarity index 100% rename from utils/getCurrentSeason.ts rename to utils/get-current-season.ts diff --git a/utils/getDeclensionWord.ts b/utils/get-declension-word.ts similarity index 100% rename from utils/getDeclensionWord.ts rename to utils/get-declension-word.ts diff --git a/utils/getQueryClient.ts b/utils/get-query-client.ts similarity index 100% rename from utils/getQueryClient.ts rename to utils/get-query-client.ts diff --git a/utils/getScheduleDuration.ts b/utils/get-schedule-duration.ts similarity index 100% rename from utils/getScheduleDuration.ts rename to utils/get-schedule-duration.ts diff --git a/utils/parseTextFromMarkDown.ts b/utils/parse-text-from-markdown.ts similarity index 100% rename from utils/parseTextFromMarkDown.ts rename to utils/parse-text-from-markdown.ts diff --git a/utils/truncateText.ts b/utils/truncate-text.ts similarity index 100% rename from utils/truncateText.ts rename to utils/truncate-text.ts