-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
218 changed files
with
23,330 additions
and
10,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { dirname, join } from 'path'; | ||
|
||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
const config: StorybookConfig = { | ||
stories: [ | ||
'../stories/**/*.mdx', | ||
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-onboarding'), | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@chromatic-com/storybook'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
], | ||
framework: { | ||
name: getAbsolutePath('@storybook/nextjs'), | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
staticDirs: ['../public'], | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.1.1.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
app/(pages)/(content)/anime/(animeList)/components/anime-list-navbar/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AnimeListNavbar from './anime-list-navbar'; | ||
|
||
export default AnimeListNavbar; |
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
app/(pages)/(content)/anime/(animeList)/components/anime-list/anime-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
|
||
import AnimeCard from '@/app/(pages)/(content)/components/anime-card'; | ||
import FiltersNotFound from '@/components/filters/components/filters-not-found'; | ||
import LoadMoreButton from '@/components/load-more-button'; | ||
import Block from '@/components/ui/block'; | ||
import Pagination from '@/components/ui/pagination'; | ||
import Stack from '@/components/ui/stack'; | ||
import useAnimeCatalog from '@/services/hooks/anime/useAnimeCatalog'; | ||
import useAuth from '@/services/hooks/auth/useAuth'; | ||
|
||
import { useNextPage, useUpdatePage } from './anime-list.hooks'; | ||
import AnimeListSkeleton from './components/anime-list-skeleton'; | ||
|
||
interface Props { | ||
searchParams: Record<string, string>; | ||
} | ||
|
||
const AnimeList = ({ searchParams }: Props) => { | ||
const { auth } = useAuth(); | ||
|
||
const page = searchParams.page; | ||
const iPage = searchParams.iPage; | ||
|
||
const dataKeys = { | ||
page: Number(page), | ||
iPage: Number(iPage), | ||
auth, | ||
}; | ||
|
||
const { | ||
fetchNextPage, | ||
isFetchingNextPage, | ||
isLoading, | ||
hasNextPage, | ||
list, | ||
pagination, | ||
} = useAnimeCatalog(dataKeys); | ||
|
||
const updatePage = useUpdatePage(dataKeys); | ||
const nextPage = useNextPage({ fetchNextPage, pagination }); | ||
|
||
if (isLoading && !isFetchingNextPage) { | ||
return <AnimeListSkeleton />; | ||
} | ||
|
||
if (list === undefined || list.length === 0) { | ||
return <FiltersNotFound />; | ||
} | ||
|
||
return ( | ||
<Block> | ||
<Stack extended={true} size={5} extendedSize={5}> | ||
{list.map((anime: API.Anime) => { | ||
return <AnimeCard key={anime.slug} anime={anime} />; | ||
})} | ||
</Stack> | ||
{hasNextPage && ( | ||
<LoadMoreButton | ||
isFetchingNextPage={isFetchingNextPage} | ||
fetchNextPage={nextPage} | ||
/> | ||
)} | ||
{list && pagination && pagination.pages > 1 && ( | ||
<div className="sticky bottom-2 z-10 flex items-center justify-center"> | ||
<div className="w-fit rounded-lg border border-secondary/60 bg-background p-2 shadow"> | ||
<Pagination | ||
page={Number(iPage)} | ||
pages={pagination.pages} | ||
setPage={updatePage} | ||
/> | ||
</div> | ||
</div> | ||
)} | ||
</Block> | ||
); | ||
}; | ||
|
||
export default AnimeList; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
...[slug]/(animeDetails)/characters/page.tsx → ...[slug]/(animeDetails)/characters/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.../[slug]/(animeDetails)/franchise/page.tsx → .../[slug]/(animeDetails)/franchise/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...nime/[slug]/(animeDetails)/links/page.tsx → ...nime/[slug]/(animeDetails)/links/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...nime/[slug]/(animeDetails)/media/page.tsx → ...nime/[slug]/(animeDetails)/media/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...nime/[slug]/(animeDetails)/staff/page.tsx → ...nime/[slug]/(animeDetails)/staff/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
...ime/[slug]/components/actions/actions.tsx → ...ime/[slug]/components/actions/actions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
app/(pages)/(content)/anime/[slug]/components/characters/characters.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
|
||
import { useParams } from 'next/navigation'; | ||
|
||
import LoadMoreButton from '@/components/load-more-button'; | ||
import useCharacters from '@/services/hooks/anime/useCharacters'; | ||
|
||
import MainCharacters from './components/main-characters'; | ||
import OtherCharacters from './components/other-characters'; | ||
|
||
interface Props { | ||
extended?: boolean; | ||
} | ||
|
||
const Characters = ({ extended }: Props) => { | ||
const params = useParams(); | ||
const { fetchNextPage, hasNextPage, isFetchingNextPage, ref } = | ||
useCharacters({ slug: String(params.slug) }); | ||
|
||
return ( | ||
<div className="flex flex-col gap-12"> | ||
<MainCharacters extended={extended} /> | ||
{extended && <OtherCharacters extended={extended} />} | ||
{extended && hasNextPage && ( | ||
<LoadMoreButton | ||
isFetchingNextPage={isFetchingNextPage} | ||
fetchNextPage={fetchNextPage} | ||
ref={ref} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Characters; |
Oops, something went wrong.