diff --git a/src/App.css b/src/App.css index cd72c42..410a4e1 100644 --- a/src/App.css +++ b/src/App.css @@ -48,30 +48,45 @@ main { #sidebar { - flex-basis: calc(var(--poster-width)*2); + flex-basis: 20%; + max-height: 100%; + min-height: 100%; font-size: 1.6rem; + text-align: center; background-color: rgba(0, 0, 0, 0.5); - min-height: 100%; - display: flex; + display: grid; - flex-direction: column; - justify-content: space-evenly; - align-content: stretch; + grid-template-rows: 1fr 2fr 2fr 1fr; + ; h1 { font-size: 2em; - margin: 0; - /* line-height: 0.8em; */ + margin: 1rem 0 0 0; font-family: RobotoBold; padding: 0.1em 0.2em 0.1em 0.2em; - align-self: flex-start; + grid-row: 1/ span 1; + overflow: hidden; + } + + figure { + width: 100%; + margin: 0; + grid-row: 2/ span 1; + place-self: center; + + .chosen-movie-poster { + aspect-ratio: 2/3; + max-width: 100%; + max-height: 100%; + } + } #summary { overflow: scroll; - flex-grow: 2; max-height: 24rem; + grid-row: 3/ span 1; } p { @@ -80,14 +95,8 @@ main { margin: 0.1em 0.2em 0.1em 0.2em; } - figure { - width: 100%; - margin: 0; - - img { - aspect-ratio: 2/3; - - } + footer { + grid-row: 4/ span 1; } } @@ -160,20 +169,36 @@ main { filter: blur(1rem) brightness(0.4); } -#watch-providers { +#watch-providers-container { + max-width: 100%; display: flex; + gap: 0.2rem; + justify-content: space-around; + + .watch-providers { + text-align: center; + border: 1rem white; + + h1 { + font-size: 1.6rem; + } - h1 { - font-size: 1.6rem; } .watch-logos-container { display: flex; + flex-wrap: nowrap; gap: 0.4rem; + justify-content: center; + .watch-logo { - width: 30px; aspect-ratio: 1/1; + max-height: 2rem; + + img { + width: 100%; + } } } diff --git a/src/objects/sidebar.tsx b/src/objects/sidebar.tsx index 105ee3c..dccb556 100644 --- a/src/objects/sidebar.tsx +++ b/src/objects/sidebar.tsx @@ -2,6 +2,7 @@ import React from "react"; import { Movie } from "./movie-wall"; import tmdb from "./tmdb"; import { WhereToWatch } from "./whereToWatch"; +import CrossfadeImage from 'react-crossfade-image' export interface SidebarProps extends React.ComponentPropsWithRef<"div"> { movie: Movie; similarMoviesAvailable: boolean; @@ -12,7 +13,7 @@ export function Sidebar({ movie, similarMoviesAvailable, watchProviders }: Sideb

{movie?.title ?? "loading"}

- +
{similarMoviesAvailable ? "" : "No hay data suficiente para darte pelílculas relacionadas."} diff --git a/src/objects/tmdb.tsx b/src/objects/tmdb.tsx index 9085f7b..87a2956 100644 --- a/src/objects/tmdb.tsx +++ b/src/objects/tmdb.tsx @@ -25,7 +25,6 @@ export default { page } }) - console.log(res) if (res.status === 200) { res = res.data.results callback(res) @@ -44,7 +43,6 @@ export default { page } }) - console.log(res) if (res.status === 200) { const array: Array = res.data.results .filter((e: Movie) => { diff --git a/src/objects/whereToWatch.tsx b/src/objects/whereToWatch.tsx index 61eae19..4f328f0 100644 --- a/src/objects/whereToWatch.tsx +++ b/src/objects/whereToWatch.tsx @@ -61,26 +61,35 @@ interface ProviderIconsProps extends React.ComponentPropsWithRef<"div"> { } function ProviderIcons({ providerList, link }: ProviderIconsProps) { const list = providerList.map((e: any, i: number) => { - return + return
+ + +
}) return
{list}
} +function watchProvidersExist(watchProviders: any) { + return watchProviders?.link +} export function WhereToWatch({ watchProviders }: WhereToWatchProps) { - if (!watchProviders?.link) { + console.log("Watch providers exist?" + watchProvidersExist(watchProviders)) + if (!watchProvidersExist(watchProviders)) { console.group() console.log("Watch providers (WhereToWatch)") console.log(watchProviders) console.groupEnd() - return
+ return

Por el momento no hay opciónes streaming.

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

Streaming:

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

Alquiler:

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

Comprar:

: ""} -
+ return <> }