Skip to content

Commit

Permalink
fix few mobile bugs, add image optimization, add expand text feature,…
Browse files Browse the repository at this point in the history
… improve watch list, improve dynamic grid
  • Loading branch information
olexh committed Apr 8, 2024
1 parent 1f1e01d commit 0002b61
Show file tree
Hide file tree
Showing 37 changed files with 263 additions and 200 deletions.
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/components/characters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Characters = ({ extended }: Props) => {
className={clsx(
'grid grid-cols-3 gap-4 md:grid-cols-5 lg:gap-8',
extended && 'md:grid-cols-6',
!extended && 'grid-flow-col grid-cols-scroll-5 overflow-x-auto no-scrollbar -mx-4 px-4'
!extended && 'grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto no-scrollbar -mx-4 px-4'
)}
>
{(extended ? main : main.slice(0, 5)).map((ch) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/components/cover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Cover = ({ anime }: Props) => {

return (
<div className="flex items-center px-16 md:px-48 lg:px-0">
<EntryCard poster={anime.poster}>
<EntryCard posterProps={{ priority: true }} poster={anime.poster}>
<div className="absolute bottom-2 right-2 z-[1]">
<FavoriteButton slug={anime.slug} content_type="anime" />
</div>
Expand Down
13 changes: 10 additions & 3 deletions app/(pages)/anime/[slug]/components/description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

import { useState } from 'react';



import { useParams } from 'next/navigation';



import MDViewer from '@/components/markdown/viewer/MD-viewer';
import SubHeader from '@/components/sub-header';
import TextExpand from '@/components/text-expand';
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
import useAnimeInfo from '@/services/hooks/anime/useAnimeInfo';

Expand Down Expand Up @@ -51,9 +56,11 @@ const Description = () => {
)}
</ToggleGroup>
</SubHeader>
<MDViewer>
{data[active] || data.synopsis_ua || data.synopsis_en}
</MDViewer>
<TextExpand>
<MDViewer>
{data[active] || data.synopsis_ua || data.synopsis_en}
</MDViewer>
</TextExpand>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/components/franchise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Franchise = ({ extended }: Props) => {
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-4 lg:gap-8',
extended && 'md:grid-cols-5',
!extended && 'no-scrollbar grid-min-10 -mx-4 grid-flow-col grid-cols-scroll-4 overflow-x-auto px-4',
!extended && 'no-scrollbar grid-min-10 -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}/*repeat(2, minmax(0, 1fr))*/
>
{filteredData.map((anime) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/components/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Links = ({ extended }: Props) => {
className={cn(
'grid gap-4 md:grid-cols-3 lg:gap-8',
!extended &&
'no-scrollbar grid-min-14 -mx-4 grid-flow-col grid-cols-scroll-3 overflow-x-auto px-4',
'no-scrollbar grid-min-14 -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}
>
{active === 'general' &&
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/anime/[slug]/components/media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ const Media = ({ extended }: Props) => {
'grid-cols-3 md:grid-cols-6',
active === 'music' &&
!extended &&
'grid-cols-scroll-4 md:grid-cols-4',
'grid-cols-scroll auto-cols-scroll md:grid-cols-4',
active === 'video' &&
extended &&
'grid-cols-2 md:grid-cols-4',
active === 'video' &&
!extended &&
'grid-min-10 grid-cols-scroll-3 md:grid-cols-3',
'grid-min-10 grid-cols-scroll auto-cols-scroll md:grid-cols-3',
)}
>
{active === 'music' &&
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/components/staff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Staff = ({ extended }: Props) => {
className={clsx(
'grid grid-cols-3 gap-4 md:grid-cols-4 lg:gap-8',
extended && 'md:grid-cols-6',
!extended && 'grid-flow-col grid-cols-scroll-4 overflow-x-auto no-scrollbar -mx-4 px-4'
!extended && 'grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto no-scrollbar -mx-4 px-4'
)}
>
{filteredData.map((staff) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/anime/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const AnimeLayout = async ({ params: { slug }, children }: Props) => {
urlPrefix={'/anime/' + slug}
/>
</Breadcrumbs>
<SubBar mobileOnly>
<SubBar>
<InternalNavBar
routes={ANIME_NAV_ROUTES}
urlPrefix={'/anime/' + slug}
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/characters/[slug]/components/anime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Anime = ({ extended }: Props) => {
<div
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-5 lg:gap-8',
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-5 overflow-x-auto px-4'
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4'
)}
>
{(extended ? list : list.slice(0, 5)).map((ch) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/characters/[slug]/components/voices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Voices = ({ extended }: Props) => {
<div
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-5 lg:gap-8',
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-5 overflow-x-auto px-4'
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4'
)}
>
{(extended ? list : list.slice(0, 5)).map((ch) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/characters/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const CharacterLayout = async ({ params: { slug }, children }: Props) => {
urlPrefix={'/characters/' + slug}
/>
</Breadcrumbs>
<SubBar mobileOnly>
<SubBar>
<InternalNavBar
routes={CHARACTER_NAV_ROUTES}
urlPrefix={'/characters/' + slug}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const CollectionItem = ({ collection }: Props) => {
<div
className={cn(
'grid flex-nowrap gap-4 md:grid-cols-5 lg:grid-cols-7 lg:gap-8',
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-7 overflow-x-auto px-4',
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}
>
{collection.collection.map((item) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';

import MDViewer from '@/components/markdown/viewer/MD-viewer';
import SubHeader from '@/components/sub-header';
import TextExpand from '@/components/text-expand';
import { useCollectionContext } from '@/services/providers/collection-provider';

const CollectionTitle = () => {
Expand All @@ -13,9 +14,9 @@ const CollectionTitle = () => {
<div className="flex flex-col gap-2">
<SubHeader title={title || 'Нова колекція'} />
{description && (
<MDViewer className="text-muted-foreground">
{description}
</MDViewer>
<TextExpand>
<MDViewer>{description}</MDViewer>
</TextExpand>
)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const EditRow = ({ edit }: Props) => {
return (
<TableRow
key={edit.edit_id}
className={clsx('hover:cursor-pointer hover:bg-secondary/60')}
className={clsx('hover:cursor-pointer')}
onClick={() => router.push(`/edit/${edit.edit_id}`)}
>
<TableCell className="w-8">
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/edit/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const EditListLayout = ({ children }: Props) => {
<Breadcrumbs>
<NavMenu routes={EDIT_NAV_ROUTES} urlPrefix="/edit" />
</Breadcrumbs>
<SubBar mobileOnly>
<SubBar>
<InternalNavBar routes={EDIT_NAV_ROUTES} urlPrefix="/edit" />
</SubBar>
{children}
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/people/[slug]/components/anime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Anime = ({ extended }: Props) => {
<div
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-5 lg:gap-8',
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-5 overflow-x-auto px-4'
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4'
)}
>
{(extended ? list : list.slice(0, 5)).map((ch) => (
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/people/[slug]/components/characters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Characters = ({ extended }: Props) => {
<div
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-5 lg:gap-8',
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-5 overflow-x-auto px-4'
!extended && 'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4'

)}
>
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/people/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const PersonLayout = async ({ params: { slug }, children }: Props) => {
urlPrefix={'/people/' + slug}
/>
</Breadcrumbs>
<SubBar mobileOnly>
<SubBar>
<InternalNavBar
routes={PERSON_NAV_ROUTES}
urlPrefix={'/people/' + slug}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Component = ({ extended }: Props) => {
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-6 lg:gap-8',
!extended &&
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-6 overflow-x-auto px-4',
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}
>
{filteredData.map((res) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Component = ({ extended }: Props) => {
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-6 lg:gap-8',
!extended &&
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-6 overflow-x-auto px-4',
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}
>
{filteredData.map((res) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Component = ({ extended }: Props) => {
className={cn(
'grid grid-cols-2 gap-4 md:grid-cols-6 lg:gap-8',
!extended &&
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll-6 overflow-x-auto px-4',
'grid-min-10 no-scrollbar -mx-4 grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto px-4',
)}
>
{filteredData.map((res) => (
Expand Down
6 changes: 3 additions & 3 deletions app/(pages)/u/[username]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ const Component = async ({ params: { username }, children }: Props) => {
src={user.cover}
className="relative size-full object-cover"
alt="cover"
width={1500}
height={500}
fill
priority
/>
</div>
)}
Expand All @@ -118,7 +118,7 @@ const Component = async ({ params: { username }, children }: Props) => {
urlPrefix={'/u/' + username}
/>
</Breadcrumbs>
<SubBar mobileOnly>
<SubBar>
<InternalNavBar
routes={USER_NAV_ROUTES}
urlPrefix={'/u/' + username}
Expand Down
Loading

0 comments on commit 0002b61

Please sign in to comment.