Skip to content

Commit

Permalink
refactor: fix namings of utils to kebab case
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed May 25, 2024
1 parent 5f35440 commit 2ac59e5
Show file tree
Hide file tree
Showing 88 changed files with 92 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(content)/anime/[slug]/anime.schema.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 3 additions & 3 deletions app/(pages)/(content)/anime/[slug]/layout.metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(content)/anime/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(content)/characters/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(content)/people/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(home)/page.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(user)/u/[username]/favorites/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/(user)/u/[username]/history/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'Активність',
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(user)/u/[username]/layout.metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(user)/u/[username]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(user)/u/[username]/list/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(user)/u/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/collections/(collections)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Metadata> {
return _generateMetadata({
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/collections/[reference]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/collections/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Metadata> {
return _generateMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Metadata> {
return _generateMetadata({
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/comments/latest/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'Останні коментарі',
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/edit/[editId]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/edit/content/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Metadata> {
return _generateMetadata({
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/edit/layout.tsx
Original file line number Diff line number Diff line change
@@ -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 {}

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/edit/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
6 changes: 3 additions & 3 deletions app/(pages)/schedule/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
4 changes: 2 additions & 2 deletions components/comments-button.tsx
Original file line number Diff line number Diff line change
@@ -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] = [
'коментар',
Expand Down
3 changes: 1 addition & 2 deletions components/history-item.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions components/page-pagination.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion features/anime/anime-list-navbar/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion features/anime/anime-list/anime-list.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions features/collections/collection-list/collection-sort.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion features/comments/comment-list/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading

0 comments on commit 2ac59e5

Please sign in to comment.