From 206b9cdda5f5b92f2fa02b292e7a4fce6e5a1c8c Mon Sep 17 00:00:00 2001 From: andrzej Date: Sun, 6 Oct 2024 23:46:47 +0200 Subject: [PATCH] solidify styling --- src/App.tsx | 42 ++++++++++++++++++++--------------- src/objects/HamburgerMenu.tsx | 4 ++-- src/objects/movie-wall.tsx | 2 +- src/objects/sidebar.tsx | 15 ++++++++----- src/objects/whereToWatch.tsx | 30 +++++++++++++------------ tailwind.config.js | 6 ++++- 6 files changed, 57 insertions(+), 42 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 3d825a1..105384b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -61,9 +61,10 @@ function App() { tmdb.getSimilar(config, chosenMovie, setMoviesHandler, setSimilarMoviesAvailable) }, [config]) const crossfadeImageStyles = { - width: "2560px", - minHeight: "100%", - aspectRatio: "16/9" + width: "100vw", + height: "100vh", + aspectRatio: "16/9", + objectFit: "clip" } const { width } = useWindowDimensions() @@ -84,22 +85,27 @@ function App() { return ( <> -
- + +
+
+ +
+
+ +
+
+ + +
+
- -
- WIDTH: {width} - - -
) } diff --git a/src/objects/HamburgerMenu.tsx b/src/objects/HamburgerMenu.tsx index 983afc6..c0f8711 100644 --- a/src/objects/HamburgerMenu.tsx +++ b/src/objects/HamburgerMenu.tsx @@ -3,7 +3,7 @@ export interface HamburgerMenuProps extends React.ComponentPropsWithRef<"div"> { setConfig: Function; } -export function HamburgerMenu({ setConfig }: HamburgerMenuProps) { +export function HamburgerMenu({ setConfig, className }: HamburgerMenuProps) { const languages = [ { value: "es", @@ -41,7 +41,7 @@ export function HamburgerMenu({ setConfig }: HamburgerMenuProps) { // } // }) // } - return
+ return
diff --git a/src/objects/movie-wall.tsx b/src/objects/movie-wall.tsx index a204128..dfe4539 100644 --- a/src/objects/movie-wall.tsx +++ b/src/objects/movie-wall.tsx @@ -45,7 +45,7 @@ export function MovieWall({ movies, setMovies, config, setChosenMovie, setSimila const movie = movies[i] const isHighlighted = movie.vote_average ? movie.vote_average > 6 : false posters.push( - -

{movie?.title ?? "loading"}

- - +

{movie?.title ?? "loading"}

+
+ {similarMoviesAvailable ? "" : "No hay data suficiente para darte pelílculas relacionadas."} -

{movie.overview === null ? "Loading" +

{movie.overview === null ? "Loading" : movie.overview === "" ? apology : movie.overview}

- -
+ +
} diff --git a/src/objects/whereToWatch.tsx b/src/objects/whereToWatch.tsx index e0dbd10..a438eae 100644 --- a/src/objects/whereToWatch.tsx +++ b/src/objects/whereToWatch.tsx @@ -63,12 +63,12 @@ interface ProviderIconsProps extends React.ComponentPropsWithRef<"div"> { } function ProviderIcons({ providerList, link }: ProviderIconsProps) { const list = providerList.map((e: any, i: number) => { - return
+ return }) - return
+ return
{list}
} @@ -76,17 +76,19 @@ function watchProvidersExist(watchProviders: any) { return watchProviders?.link } -export function WhereToWatch({ watchProviders, config }: WhereToWatchProps) { - if (!watchProvidersExist(watchProviders)) { - return

{config.language == "es" ? "Por el momento no hay opciónes streaming." : config.language == "en" ? "There are no online viewing options right now." : ""}

- } - return <>
-
- {watchProviders?.flatrate?.length > 0 ?

Streaming:

: ""} - {watchProviders?.rent?.length > 0 ?

{config.language == "es" ? "Alquiler:" : config.language == "en" ? "To Rent:" : ""}

: ""} - {watchProviders?.buy?.length > 0 ?

{config.language == "es" ? "Comprar:" : config.language == "en" ? "To Buy:" : ""}

: ""} -
-

Powered by Just Watch.

-
+export function WhereToWatch({ watchProviders, config, className }: WhereToWatchProps) { + return <> } diff --git a/tailwind.config.js b/tailwind.config.js index 3cf7e4c..e79504c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,11 @@ export default { content: ["./dist/index.html", "./src/**/*.{js,ts,jsx,tsx}"], theme: { - extend: {}, + extend: { + aspectRatio: { + poster: "2 / 3", + }, + }, }, plugins: [], };