Normalize to double quotes across all files with Prettier
This commit is contained in:
1 parent
73bff72cec
commit
a5659cf4c8
190 files changed
+9523
-8859
No files matched your search
@@ -1,10 +1,17 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useCreateEntry } from '@/hooks/useEntries';
|
||||
import { useLibraryStore } from '@/stores/useLibraryStore';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Star, Plus, Play, Search, ChevronLeft, ChevronRight } from 'lucide-react';
|
||||
import type { TmdbEntry } from '@/types';
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { useCreateEntry } from "@/hooks/useEntries";
|
||||
import { useLibraryStore } from "@/stores/useLibraryStore";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Star,
|
||||
Plus,
|
||||
Play,
|
||||
Search,
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
} from "lucide-react";
|
||||
import type { TmdbEntry } from "@/types";
|
||||
|
||||
interface HeroSliderProps {
|
||||
entries: TmdbEntry[];
|
||||
@@ -13,7 +20,7 @@ interface HeroSliderProps {
|
||||
export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
const navigate = useNavigate();
|
||||
const [activeIndex, setActiveIndex] = useState(0);
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [searchInput, setSearchInput] = useState("");
|
||||
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
const createEntry = useCreateEntry();
|
||||
const libraryEntries = useLibraryStore((s) => s.entries);
|
||||
@@ -51,7 +58,7 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
return (
|
||||
<div
|
||||
className="relative w-full overflow-hidden"
|
||||
style={{ aspectRatio: '16/9', maxHeight: '70vh' }}
|
||||
style={{ aspectRatio: "16/9", maxHeight: "70vh" }}
|
||||
>
|
||||
{/* Slide track */}
|
||||
<div
|
||||
@@ -62,11 +69,11 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
}}
|
||||
>
|
||||
{slides.map((entry) => {
|
||||
const title = entry.title || entry.name || 'Untitled';
|
||||
const title = entry.title || entry.name || "Untitled";
|
||||
const backdrop = entry.backdrop_path
|
||||
? `https://image.tmdb.org/t/p/original${entry.backdrop_path}`
|
||||
: null;
|
||||
const isTv = entry.media_type === 'tv' || !!entry.name;
|
||||
const isTv = entry.media_type === "tv" || !!entry.name;
|
||||
const matchedEntry = Array.from(libraryEntries.values()).find(
|
||||
(e) => e.entryIds?.tmdb_id === entry.id,
|
||||
);
|
||||
@@ -91,7 +98,7 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
<div className="absolute bottom-0 left-0 right-0 z-10 space-y-2 px-4 pb-5 md:px-6 md:pb-8">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="rounded-full bg-white/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-widest text-white/60 backdrop-blur-sm">
|
||||
{isTv ? 'Series' : 'Movie'}
|
||||
{isTv ? "Series" : "Movie"}
|
||||
</span>
|
||||
{entry.vote_average > 0 && (
|
||||
<span className="flex items-center gap-1 text-xs text-yellow-400">
|
||||
@@ -111,7 +118,11 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
<div className="flex gap-2 pt-1">
|
||||
{matchedEntry ? (
|
||||
<Link to={`/entry/${matchedEntry.id}`}>
|
||||
<Button size="sm" variant="secondary" className="rounded-full gap-1.5 text-xs">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
className="rounded-full gap-1.5 text-xs"
|
||||
>
|
||||
<Play className="h-3 w-3 fill-current" />
|
||||
Details
|
||||
</Button>
|
||||
@@ -121,7 +132,12 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
className="rounded-full gap-1.5 text-xs"
|
||||
onClick={() => createEntry.mutate({ tmdb_id: entry.id, is_tvserie: isTv })}
|
||||
onClick={() =>
|
||||
createEntry.mutate({
|
||||
tmdb_id: entry.id,
|
||||
is_tvserie: isTv,
|
||||
})
|
||||
}
|
||||
disabled={createEntry.isPending}
|
||||
>
|
||||
<Plus className="h-3 w-3" />
|
||||
@@ -144,7 +160,7 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
placeholder="Search movies, TV shows..."
|
||||
value={searchInput}
|
||||
onChange={(e) => setSearchInput(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleSearch()}
|
||||
onKeyDown={(e) => e.key === "Enter" && handleSearch()}
|
||||
className="w-full rounded-full border border-white/20 bg-black/40 py-2.5 pl-9 pr-4 text-sm text-white backdrop-blur-md placeholder-white/50 transition-colors focus:border-white/50 focus:outline-none"
|
||||
/>
|
||||
</div>
|
||||
@@ -153,7 +169,10 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
{/* Left arrow */}
|
||||
<button
|
||||
className="absolute left-3 top-1/2 z-20 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full border border-white/10 bg-black/30 text-white backdrop-blur-sm transition-colors hover:bg-black/60"
|
||||
onClick={() => { go(activeIndex - 1); startAutoplay(); }}
|
||||
onClick={() => {
|
||||
go(activeIndex - 1);
|
||||
startAutoplay();
|
||||
}}
|
||||
aria-label="Previous"
|
||||
>
|
||||
<ChevronLeft className="h-5 w-5" />
|
||||
@@ -162,7 +181,10 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
{/* Right arrow */}
|
||||
<button
|
||||
className="absolute right-3 top-1/2 z-20 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full border border-white/10 bg-black/30 text-white backdrop-blur-sm transition-colors hover:bg-black/60"
|
||||
onClick={() => { go(activeIndex + 1); startAutoplay(); }}
|
||||
onClick={() => {
|
||||
go(activeIndex + 1);
|
||||
startAutoplay();
|
||||
}}
|
||||
aria-label="Next"
|
||||
>
|
||||
<ChevronRight className="h-5 w-5" />
|
||||
@@ -173,12 +195,15 @@ export function HeroSlider({ entries }: HeroSliderProps) {
|
||||
{slides.map((_, i) => (
|
||||
<button
|
||||
key={i}
|
||||
onClick={() => { go(i); startAutoplay(); }}
|
||||
onClick={() => {
|
||||
go(i);
|
||||
startAutoplay();
|
||||
}}
|
||||
aria-label={`Go to slide ${i + 1}`}
|
||||
className={`rounded-full transition-all duration-300 ${
|
||||
i === activeIndex
|
||||
? 'h-1.5 w-6 bg-white'
|
||||
: 'h-1.5 w-1.5 bg-white/30 hover:bg-white/60'
|
||||
? "h-1.5 w-6 bg-white"
|
||||
: "h-1.5 w-1.5 bg-white/30 hover:bg-white/60"
|
||||
}`}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BackdropScrollCard } from './BackdropCard';
|
||||
import type { TmdbEntry } from '@/types';
|
||||
import { BackdropScrollCard } from "./BackdropCard";
|
||||
import type { TmdbEntry } from "@/types";
|
||||
|
||||
interface PopularBeltProps {
|
||||
movieEntries: TmdbEntry[];
|
||||
@@ -16,17 +16,23 @@ export function PopularBelt({ movieEntries, tvEntries }: PopularBeltProps) {
|
||||
<div
|
||||
className="flex gap-4"
|
||||
style={{
|
||||
animation: 'marquee-left 40s linear infinite',
|
||||
width: 'max-content',
|
||||
animation: "marquee-left 40s linear infinite",
|
||||
width: "max-content",
|
||||
}}
|
||||
onMouseEnter={(e) => ((e.currentTarget as HTMLDivElement).style.animationPlayState = 'paused')}
|
||||
onMouseLeave={(e) => ((e.currentTarget as HTMLDivElement).style.animationPlayState = 'running')}
|
||||
onMouseEnter={(e) =>
|
||||
((e.currentTarget as HTMLDivElement).style.animationPlayState =
|
||||
"paused")
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
((e.currentTarget as HTMLDivElement).style.animationPlayState =
|
||||
"running")
|
||||
}
|
||||
>
|
||||
{/* Original + duplicate for seamless loop */}
|
||||
{[...Array(2)].flatMap((_, pass) =>
|
||||
items.map((item) => (
|
||||
<BackdropScrollCard key={`${pass}-${item.id}`} entry={item} />
|
||||
))
|
||||
)),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
interface SectionHeaderProps {
|
||||
icon: React.ReactNode;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export { HeroSlider } from './HeroSlider';
|
||||
export { BackdropCard, BackdropScrollCard } from './BackdropCard';
|
||||
export { NumberedListItem } from './NumberedListItem';
|
||||
export { MiniPosterCard } from './MiniPosterCard';
|
||||
export { UpcomingCard } from './UpcomingCard';
|
||||
export { SectionHeader } from './SectionHeader';
|
||||
export { PopularBelt } from './PopularBelt';
|
||||
export { HeroSlider } from "./HeroSlider";
|
||||
export { BackdropCard, BackdropScrollCard } from "./BackdropCard";
|
||||
export { NumberedListItem } from "./NumberedListItem";
|
||||
export { MiniPosterCard } from "./MiniPosterCard";
|
||||
export { UpcomingCard } from "./UpcomingCard";
|
||||
export { SectionHeader } from "./SectionHeader";
|
||||
export { PopularBelt } from "./PopularBelt";
|
||||
Reference in new issue
Block a user