fixed a bug

This commit is contained in:
Rohithk 2023-09-27 20:09:35 +05:30
commit f542b1be2d
5 changed files with 40 additions and 32 deletions

View file

@ -60,7 +60,7 @@ export default function Collection({}) {
className={
'mb-6 md:mb-10'
}>
<Heading title={"Continue Watching"} href={""} isHomePage media_type={"all"}/>
<Heading title={"Continue Watching"} href={""} isHomePage media_type={"all"} iscontinue_watching={true}/>
<section
className={
' w-[100%] gap-5 overflow-x-scroll p-5 '

View file

@ -1,34 +1,40 @@
import Link from 'next/link'
export default function Heading({
href,
isHomePage,
isTrending, // TODO: Do we need this here?
media_type,
title,
}) {
return (
<div className='mb-4 flex items-end justify-between sm:mb-6'>
{isHomePage ? (
<div className='flex items-end'>
<h2 className='section-title py-px sm:py-0 text-app-dark-blue dark:text-app-pure-white'>{title}</h2>
{media_type&& <p
className={
media_type === 'movie'
? 'ml-2 rounded-md border-2 py-px px-2 text-[8px] font-light border-app-dark-blue dark:border-app-pure-white uppercase tracking-wider text-app-dark-blue dark:text-app-pure-white sm:ml-4 sm:text-[10px]'
: 'ml-2 rounded-md border-2 border-app-dark-blue dark:border-app-pure-white dark:bg-app-dark-blue bg-light-white py-px px-2 text-[8px] font-light uppercase tracking-wider dark:text-app-pure-white text-app-dark-blue sm:ml-4 sm:text-[10px] '
}>
{ media_type}
</p>}
href,
isHomePage,
isTrending, // TODO: Do we need this here?
media_type,
iscontinue_watching,
title,
}) {
return (
<div className='mb-4 flex items-end justify-between sm:mb-6'>
{isHomePage ? (
<div className='flex items-end'>
<h2 className='section-title py-px sm:py-0 text-app-dark-blue dark:text-app-pure-white'>{title}</h2>
{media_type && <p
className={
media_type === 'movie'
? 'ml-2 rounded-md border-2 py-px px-2 text-[8px] font-light border-app-dark-blue dark:border-app-pure-white uppercase tracking-wider text-app-dark-blue dark:text-app-pure-white sm:ml-4 sm:text-[10px]'
: 'ml-2 rounded-md border-2 border-app-dark-blue dark:border-app-pure-white dark:bg-app-dark-blue bg-light-white py-px px-2 text-[8px] font-light uppercase tracking-wider dark:text-app-pure-white text-app-dark-blue sm:ml-4 sm:text-[10px] '
}>
{media_type}
</p>}
</div>
) : (
<h2 className='section-title'>{title}</h2>
)}
{iscontinue_watching &&
<a className='cursor-pointer text-xs font-medium uppercase tracking-wide text-app-greyish-blue hover:underline'>
Clear history
</a>
}
{href && <Link href={href} as={href} passHref>
<a className='cursor-pointer text-xs font-medium uppercase tracking-wide text-app-greyish-blue hover:underline'>
See more
</a>
</Link>}
</div>
) : (
<h2 className='section-title'>{title}</h2>
)}
{ href&& <Link href={href} as={href} passHref>
<a className='cursor-pointer text-xs font-medium uppercase tracking-wide text-app-greyish-blue hover:underline'>
See more
</a>
</Link>}
</div>
)
)
}

View file

@ -4,7 +4,8 @@ import Collection from '../components/Collection'
import SearchBar from '../components/SearchBar'
import {pathToSearchAll} from '../utils'
import CollectionContinueWatching from "../components/CollectionContinueWatching";
import {ThemeToggler} from "../components/ThemeToggler";
import {useTheme} from "next-themes";
export default function Home() {
const limitNormal = 6
const limitTrending = 10

View file

@ -29,7 +29,7 @@ const Movies = () => {
const to = tmdb ? `${tmdb}` : `${id}`
const [videoServer, setVideoServer] = useState('')
const {data, error} = useSWR(`/api/movie/${id}`, fetcher)
const [MovieDetailsHidden, setMovieDetailsHidden] = useState(false)
const [MovieDetailsHidden, setMovieDetailsHidden] = useState(true)
useEffect(() => {
if (localStorage.getItem("userWatched")) {
let data = JSON.parse(localStorage.getItem("userWatched"))

View file

@ -800,6 +800,7 @@ td {
width: 10px;
height: 7px;
}
::-webkit-scrollbar-track{
background-color: #3b3b3b;
}