From 76579627404119790378eed7c60831f0c78db89e Mon Sep 17 00:00:00 2001 From: DrMint Date: Fri, 18 Feb 2022 01:22:45 +0100 Subject: [PATCH] Improved compatibility on smaller devices --- src/pages/library/items/[slug].tsx | 132 ++++++++++++----------------- tailwind.config.js | 5 +- 2 files changed, 55 insertions(+), 82 deletions(-) diff --git a/src/pages/library/items/[slug].tsx b/src/pages/library/items/[slug].tsx index 6f899eb..c488bab 100644 --- a/src/pages/library/items/[slug].tsx +++ b/src/pages/library/items/[slug].tsx @@ -51,57 +51,57 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
- - - {item.gallery.data.length > 0 ? ( - ) : ( - "" - )} - - - {item.subitems.data.length > 0 ? ( - item.metadata.length > 0 && - item.metadata[0].__typename === "ComponentMetadataOther" && - item.metadata[0].subtype.data.attributes.slug === "variant-set" ? ( + {item.gallery.data.length > 0 ? ( ) : ( - - ) - ) : ( - "" - )} + "" + )} - {item.contents.data.length > 0 ? ( - ) : ( - "" - )} + + {item.subitems.data.length > 0 ? ( + item.metadata.length > 0 && + item.metadata[0].__typename === "ComponentMetadataOther" && + item.metadata[0].subtype.data.attributes.slug === "variant-set" ? ( + + ) : ( + + ) + ) : ( + "" + )} + + {item.contents.data.length > 0 ? ( + + ) : ( + "" + )}
); @@ -109,13 +109,15 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element { const contentPanel = (
-
+
{item.thumbnail.data ? ( {item.thumbnail.data.attributes.alternativeText} ) : (
@@ -131,7 +133,7 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {

{langui.global_subitem_of}

- ) : ( - "" - )} - - {content.attributes.content.data ? ( - - ) : ( - "" - )} - - {content.attributes.scan_set.length === 0 && - !content.attributes.content.data - ? "The content is not available" - : ""} -
))}
diff --git a/tailwind.config.js b/tailwind.config.js index 41be017..ce47d6c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -15,8 +15,9 @@ module.exports = { monospace: ["monospace"], }, screens: { - desktop: { min: "70rem" }, - mobile: { max: "70rem" }, + desktop: { min: "150ch" }, + mobile: { max: "150ch" }, + thin: { max: "50ch" }, coarse: { raw: "(pointer: coarse)" }, fine: { raw: "(pointer: fine)" }, },