From a5f9972b284fc90894037979ad005fdf1c825c36 Mon Sep 17 00:00:00 2001 From: andrzej Date: Wed, 22 May 2024 15:05:38 +0200 Subject: [PATCH] watch provider text language dependent --- src/App.css | 7 ++----- src/App.tsx | 3 +-- src/objects/sidebar.tsx | 6 ++++-- src/objects/whereToWatch.tsx | 8 ++++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/App.css b/src/App.css index c6381f4..542a732 100644 --- a/src/App.css +++ b/src/App.css @@ -56,7 +56,7 @@ main { background-color: rgba(0, 0, 0, 0.5); display: grid; - grid-template-rows: 1fr 2fr 2fr 1fr; + grid-template-rows: 1fr 1fr 2fr 1fr; align-items: center; justify-content: center; @@ -73,13 +73,10 @@ main { display: contents; } - margin: 0; - grid-row: 2/ span 1; .chosen-movie-poster { + grid-row: 2/ span 1; object-fit: cover; - height: 100%; - width: 100%; display: flex; justify-content: center; } diff --git a/src/App.tsx b/src/App.tsx index 5b63726..d5ea452 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,6 @@ import tmdb from './objects/tmdb' import { Sidebar } from './objects/sidebar' import { Movie } from './objects/movie-wall' import CrossfadeImage from 'react-crossfade-image' -import { WhereToWatch } from './objects/whereToWatch' export type Config = { language: string, @@ -65,7 +64,7 @@ function App() {
- +
{ movie: Movie; similarMoviesAvailable: boolean; watchProviders: {}; + config: Config; } -export function Sidebar({ movie, similarMoviesAvailable, watchProviders }: SidebarProps) { +export function Sidebar({ movie, similarMoviesAvailable, watchProviders, config }: SidebarProps) { return diff --git a/src/objects/whereToWatch.tsx b/src/objects/whereToWatch.tsx index 4f328f0..6fff32d 100644 --- a/src/objects/whereToWatch.tsx +++ b/src/objects/whereToWatch.tsx @@ -1,5 +1,6 @@ import React from "react" import tmdb from "./tmdb" +import { Config } from "../App" interface WhereToWatchProps extends React.ComponentPropsWithRef<"div"> { watchProviders: { @@ -7,7 +8,6 @@ interface WhereToWatchProps extends React.ComponentPropsWithRef<"div"> { rent: Array<{}>; buy: Array<{}>; link: string; - }; } const sampleData = { @@ -74,7 +74,7 @@ function watchProvidersExist(watchProviders: any) { return watchProviders?.link } -export function WhereToWatch({ watchProviders }: WhereToWatchProps) { +export function WhereToWatch({ watchProviders, config }: WhereToWatchProps) { console.log("Watch providers exist?" + watchProvidersExist(watchProviders)) if (!watchProvidersExist(watchProviders)) { console.group() @@ -86,8 +86,8 @@ export function WhereToWatch({ watchProviders }: WhereToWatchProps) { return <>