From 1427aedbbfd1f17cf40cc9b167d5a5d9f348aa90 Mon Sep 17 00:00:00 2001 From: andrzej Date: Tue, 8 Oct 2024 10:54:50 +0200 Subject: [PATCH] more responsivity improvements --- package-lock.json | 12 +++++++++++- package.json | 3 ++- src/App.tsx | 6 +++--- src/objects/movie-wall.tsx | 12 ++++++++++-- src/objects/sidebar.tsx | 8 ++++---- src/objects/whereToWatch.tsx | 4 ++-- tailwind.config.js | 4 ++++ 7 files changed, 36 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0df3c6..38d3378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "axios": "^1.6.8", "react": "^18.2.0", "react-crossfade-image": "^1.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "tailwind-merge": "^2.5.3" }, "devDependencies": { "@types/react": "*", @@ -3999,6 +4000,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tailwind-merge": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.3.tgz", + "integrity": "sha512-d9ZolCAIzom1nf/5p4LdD5zvjmgSxY0BGgdSvmXIoMYAiPdAW/dSpP7joCDYFY7r/HkEa2qmPtkgsu0xjQeQtw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "3.4.13", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.13.tgz", diff --git a/package.json b/package.json index 26fa333..a77840b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "axios": "^1.6.8", "react": "^18.2.0", "react-crossfade-image": "^1.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "tailwind-merge": "^2.5.3" }, "devDependencies": { "@types/react": "*", diff --git a/src/App.tsx b/src/App.tsx index f7d204f..c180b66 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -94,10 +94,10 @@ function App() {
-
- +
+ 6 : false - + const widths = [ + " ", + "w-16", + "largeMobile:w-20", + "sm:w-32", + "md:w-36", + "lg:w-40" + ] const borderColor = isHighlighted ? "border-orange-300" : "border-gray-300" posters.push( // TODO: tailwind merge so that these break points actually work -

{movie?.title ?? "loading"}

-
- +
+ {similarMoviesAvailable ? "" : "No hay data suficiente para darte pelĂ­lculas relacionadas."} -
+
{/* TODO: make the apology vertically centered */} {movie.overview === null ?

Loading...

@@ -43,7 +43,7 @@ export function Sidebar({ movie, similarMoviesAvailable, watchProviders, config, }
- +
diff --git a/src/objects/whereToWatch.tsx b/src/objects/whereToWatch.tsx index d60d604..895155c 100644 --- a/src/objects/whereToWatch.tsx +++ b/src/objects/whereToWatch.tsx @@ -69,7 +69,7 @@ function ProviderIcons({ providerList, link }: ProviderIconsProps) {
}) - return
+ return
{list}
} @@ -82,7 +82,7 @@ export function WhereToWatch({ watchProviders, config, className }: WhereToWatch {watchProvidersExist(watchProviders) ? <>
- {watchProviders?.flatrate?.length > 0 ?

Streaming:

: ""} + {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:" : ""}

: ""}
diff --git a/tailwind.config.js b/tailwind.config.js index d33c8da..3d30f4a 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,6 +4,10 @@ export default { theme: { screens: { largeMobile: "390px", + sm: "640px", + md: "767px", + lg: "1023px", + xl: "1280px", }, extend: { aspectRatio: {