Skip to content

Commit

Permalink
Merge pull request #27 from hikka-io/feat/new-structure
Browse files Browse the repository at this point in the history
Feat/new structure
  • Loading branch information
olexh authored May 21, 2024
2 parents 1360c03 + 0ebd873 commit f3b2d04
Show file tree
Hide file tree
Showing 351 changed files with 1,026 additions and 1,066 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,6 @@ fabric.properties
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

*.code-workspace
8 changes: 4 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrder": [
"react[^-/]",
"^next/(.*)$",
"@[^/](.*)$",
"@/(.*)$",
"<THIRD_PARTY_MODULES>",
"^@/components/(.*)$",
"^@/features/(.*)$",
"^@/(.*)$",
"^[./]"
]
}
3 changes: 1 addition & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { dirname, join } from 'path';

import type { StorybookConfig } from '@storybook/nextjs';
import { dirname, join } from 'path';

/**
* This function is used to resolve the absolute path of a package.
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.snippetSuggestions": "top",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions app/(pages)/(content)/anime/(animeList)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FC, ReactNode } from 'react';

import Filters from '@/components/filters/anime-filters';
import Block from '@/components/ui/block';
import Card from '@/components/ui/card';

import NavBar from './components/anime-list-navbar';
import NavBar from '@/features/anime/anime-list-navbar/anime-list-navbar';
import Filters from '@/features/filters/anime-filters';

interface Props {
children: ReactNode;
Expand Down
5 changes: 2 additions & 3 deletions app/(pages)/(content)/anime/(animeList)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FC } from 'react';

import { redirect } from 'next/navigation';
import { FC } from 'react';

import AnimeList from './components/anime-list';
import AnimeList from '@/features/anime/anime-list/anime-list';

interface Props {
searchParams: Record<string, 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 _generateMetadata from '@/utils/generateMetadata';

import Characters from '../../components/characters/characters';
import Characters from '../../../../../../../features/anime/anime-view/characters/characters';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HydrationBoundary, dehydrate } from '@tanstack/react-query';
import { Metadata, ResolvingMetadata } from 'next';

import { HydrationBoundary, dehydrate } from '@tanstack/react-query';
import Comments from '@/features/comments/comment-list/comment-list';

import Comments from '@/components/comments/comments';
import getComments from '@/services/api/comments/getComments';
import _generateMetadata from '@/utils/generateMetadata';
import getQueryClient from '@/utils/getQueryClient';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Metadata, ResolvingMetadata } from 'next';

import _generateMetadata from '@/utils/generateMetadata';

import Franchise from '../../components/franchise';
import Franchise from '../../../../../../../features/anime/anime-view/franchise';

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 _generateMetadata from '@/utils/generateMetadata';

import Links from '../../components/links';
import Links from '../../../../../../../features/anime/anime-view/links';

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 _generateMetadata from '@/utils/generateMetadata';

import Media from '../../components/media/media';
import Media from '../../../../../../../features/anime/anime-view/media/media';

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 _generateMetadata from '@/utils/generateMetadata';

import Staff from '../../components/staff';
import Staff from '../../../../../../../features/anime/anime-view/staff';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions app/(pages)/(content)/anime/[slug]/layout.metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import parseTextFromMarkDown from '@/utils/parseTextFromMarkDown';
import truncateText from '@/utils/truncateText';

export interface MetadataProps {
params: { slug: string }
searchParams: { [key: string]: string | string[] | undefined }
params: { slug: string };
searchParams: { [key: string]: string | string[] | undefined };
}

export default async function generateMetadata({
Expand Down
16 changes: 8 additions & 8 deletions app/(pages)/(content)/anime/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import { FC, PropsWithChildren } from 'react';

import Link from 'next/link';
import { redirect } from 'next/navigation';

import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { FC, PropsWithChildren } from 'react';

import Breadcrumbs from '@/components/navigation/nav-breadcrumbs';
import NavMenu from '@/components/navigation/nav-dropdown';
import InternalNavBar from '@/components/navigation/nav-tabs';
import SubBar from '@/components/navigation/sub-nav';

import Actions from '@/features/anime/anime-view/actions/actions';
import Cover from '@/features/anime/anime-view/cover';
import Title from '@/features/anime/anime-view/title';

import getAnimeInfo from '@/services/api/anime/getAnimeInfo';
import { ANIME_NAV_ROUTES, RELEASE_STATUS } from '@/utils/constants';
import getQueryClient from '@/utils/getQueryClient';

import Actions from './components/actions';
import Cover from './components/cover';
import Title from './components/title';
import _generateMetadata, { MetadataProps } from './layout.metadata';
import prefetchQueries from './layout.queries';

Expand Down
21 changes: 11 additions & 10 deletions app/(pages)/(content)/anime/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import React, { FC } from 'react';
import { FC } from 'react';

import Characters from '@/features/anime/anime-view/characters/characters';
import Description from '@/features/anime/anime-view/description';
import Details from '@/features/anime/anime-view/details/details';
import Followings from '@/features/anime/anime-view/followings/followings';
import Franchise from '@/features/anime/anime-view/franchise';
import Links from '@/features/anime/anime-view/links';
import Media from '@/features/anime/anime-view/media/media';
import Staff from '@/features/anime/anime-view/staff';
import WatchStats from '@/features/anime/anime-view/watch-stats/watch-stats';

import getAnimeInfo, {
Response as AnimeResponse,
} from '@/services/api/anime/getAnimeInfo';

import jsonSchema from './anime.schema';
import Characters from './components/characters/characters';
import Description from './components/description';
import Details from './components/details/details';
import Followings from './components/followings/followings';
import Franchise from './components/franchise';
import Links from './components/links';
import Media from './components/media/media';
import Staff from './components/staff';
import WatchStats from './components/watch-stats/watch-stats';

interface Props {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata, ResolvingMetadata } from 'next';

import Anime from '../../components/anime';
import Anime from '../../../../../../../features/characters/character-view/anime';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata, ResolvingMetadata } from 'next';

import Voices from '../../components/voices';
import Voices from '../../../../../../../features/characters/character-view/voices';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down
14 changes: 7 additions & 7 deletions app/(pages)/(content)/characters/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { Metadata, ResolvingMetadata } from 'next';
import { FC, PropsWithChildren } from 'react';

import Link from 'next/link';
import { redirect } from 'next/navigation';

import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { FC, PropsWithChildren } from 'react';

import Breadcrumbs from '@/components/navigation/nav-breadcrumbs';
import NavMenu from '@/components/navigation/nav-dropdown';
import InternalNavBar from '@/components/navigation/nav-tabs';
import SubBar from '@/components/navigation/sub-nav';

import Cover from '@/features/characters/character-view/cover';
import Title from '@/features/characters/character-view/title';

import getCharacterInfo from '@/services/api/characters/getCharacterInfo';
import { CHARACTER_NAV_ROUTES } from '@/utils/constants';
import getQueryClient from '@/utils/getQueryClient';

import Cover from './components/cover';
import Title from './components/title';
import _generateMetadata, { MetadataProps } from './layout.metadata';
import prefetchQueries from './layout.queries';

Expand Down
8 changes: 3 additions & 5 deletions app/(pages)/(content)/characters/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

import Anime from './components/anime';
import Description from './components/description';
import Voices from './components/voices';
import Anime from '@/features/characters/character-view/anime';
import Description from '@/features/characters/character-view/description';
import Voices from '@/features/characters/character-view/voices';

const CharacterPage = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata, ResolvingMetadata } from 'next';

import Anime from '../../components/anime';
import Anime from '../../../../../../../features/people/person-view/anime';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata, ResolvingMetadata } from 'next';

import Characters from '@/app/(pages)/(content)/people/[slug]/components/characters';
import Characters from '@/features/people/person-view/characters';

export async function generateMetadata(
{ params }: { params: { slug: string } },
Expand Down
14 changes: 7 additions & 7 deletions app/(pages)/(content)/people/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { Metadata, ResolvingMetadata } from 'next';
import { FC, PropsWithChildren } from 'react';

import Link from 'next/link';
import { redirect } from 'next/navigation';

import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { FC, PropsWithChildren } from 'react';

import Breadcrumbs from '@/components/navigation/nav-breadcrumbs';
import NavMenu from '@/components/navigation/nav-dropdown';
import InternalNavBar from '@/components/navigation/nav-tabs';
import SubBar from '@/components/navigation/sub-nav';

import Cover from '@/features/people/person-view/cover';
import Title from '@/features/people/person-view/title';

import getPersonInfo from '@/services/api/people/getPersonInfo';
import { PERSON_NAV_ROUTES } from '@/utils/constants';
import getQueryClient from '@/utils/getQueryClient';

import Cover from './components/cover';
import Title from './components/title';
import _generateMetadata, { MetadataProps } from './layout.metadata';
import prefetchQueries from './layout.queries';

Expand Down
6 changes: 2 additions & 4 deletions app/(pages)/(content)/people/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';

import Anime from './components/anime';
import Characters from './components/characters';
import Anime from '@/features/people/person-view/anime';
import Characters from '@/features/people/person-view/characters';

const PersonPage = () => {
return (
Expand Down
File renamed without changes.
17 changes: 9 additions & 8 deletions app/(pages)/(root)/page.tsx → app/(pages)/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';

import Ongoings from '@/app/(pages)/(root)/components/ongoings';
import prefetchQueries from '@/app/(pages)/(root)/page.queries';
import UserCover from '@/components/user-cover';

import Collections from '@/features/home/collections';
import Comments from '@/features/home/comments';
import History from '@/features/home/history';
import Ongoings from '@/features/home/ongoings';
import Profile from '@/features/home/profile';
import Schedule from '@/features/home/schedule/schedule';

import prefetchQueries from '@/app/(pages)/(home)/page.queries';
import getLoggedUserInfo from '@/services/api/user/getLoggedUserInfo';
import getQueryClient from '@/utils/getQueryClient';

import Collections from './components/collections';
import Comments from './components/comments';
import History from './components/history';
import Profile from './components/profile';
import Schedule from './components/schedule/schedule';

const Page = async () => {
const queryClient = await getQueryClient();

Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions app/(pages)/(user)/u/[username]/components/history/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion app/(pages)/(user)/u/[username]/favorites/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Metadata, ResolvingMetadata } from 'next';

import Favorites from '@/app/(pages)/(user)/u/[username]/components/favorites/favorites';
import Favorites from '@/features/users/user-profile/favorites/favorites';

import _generateMetadata from '@/utils/generateMetadata';

export async function generateMetadata(
Expand Down
7 changes: 3 additions & 4 deletions app/(pages)/(user)/u/[username]/history/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import { FC } from 'react';

import { dehydrate } from '@tanstack/query-core';
import { HydrationBoundary } from '@tanstack/react-query';
import History from '@/features/users/user-history/user-history';

import getFollowingHistory from '@/services/api/history/getFollowingHistory';
import { getCookie } from '@/utils/cookies';
import _generateMetadata from '@/utils/generateMetadata';
import getQueryClient from '@/utils/getQueryClient';

import History from './components/history/history';

export const metadata: Metadata = _generateMetadata({
title: 'Активність',
});
Expand Down
Loading

0 comments on commit f3b2d04

Please sign in to comment.