diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx
index a295b3f..51eab74 100644
--- a/src/components/AppLayout.tsx
+++ b/src/components/AppLayout.tsx
@@ -199,7 +199,7 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element {
{/* Sub panel */}
- {subPanel ? (
+ {subPanel && (
{subPanel}
- ) : (
- ""
)}
{/* Main panel */}
diff --git a/src/components/Chronology/ChronologyItemComponent.tsx b/src/components/Chronology/ChronologyItemComponent.tsx
index 090fb92..3864c27 100644
--- a/src/components/Chronology/ChronologyItemComponent.tsx
+++ b/src/components/Chronology/ChronologyItemComponent.tsx
@@ -64,15 +64,13 @@ export default function ChronologyItemComponent(
props.item.attributes.day
)}
>
- {props.displayYear ? (
+ {props.displayYear && (
{generateYear(
props.item.attributes.displayed_date,
props.item.attributes.year
)}
- ) : (
- ""
)}
@@ -108,7 +106,7 @@ export default function ChronologyItemComponent(
{translation.title ?
{translation.title}
: ""}
- {translation.description ? (
+ {translation.description && (
1
@@ -118,8 +116,6 @@ export default function ChronologyItemComponent(
>
{translation.description}
- ) : (
- ""
)}
{translation.note ? (
{"Notes: " + translation.note}
diff --git a/src/components/Content/ThumbnailHeader.tsx b/src/components/Content/ThumbnailHeader.tsx
index 2b8ec2a..5ae6da6 100644
--- a/src/components/Content/ThumbnailHeader.tsx
+++ b/src/components/Content/ThumbnailHeader.tsx
@@ -53,7 +53,7 @@ export default function ThumbnailHeader(
- {content.type ? (
+ {content.type && (
{langui.type}
- ) : (
- ""
)}
- {content.categories.data.length > 0 ? (
+ {content.categories.data.length > 0 && (
{langui.categories}
{content.categories.data.map((category) => (
))}
- ) : (
- ""
)}
{content.titles.length > 0 && content.titles[0].description && (
diff --git a/src/components/Library/ContentTOCLine.tsx b/src/components/Library/ContentTOCLine.tsx
index 9001184..4ac55e1 100644
--- a/src/components/Library/ContentTOCLine.tsx
+++ b/src/components/Library/ContentTOCLine.tsx
@@ -54,7 +54,7 @@ export default function ContentTOCLine(
? content.attributes.range[0].starting_page
: ""}
- {content.attributes.content.data ? (
+ {content.attributes.content.data && (
{content.attributes.content.data.attributes.type.data.attributes
.titles.length > 0
@@ -65,8 +65,6 @@ export default function ContentTOCLine(
.attributes.slug
)}
- ) : (
- ""
)}
- {content.attributes.scan_set.length > 0 ? (
+ {content.attributes.scan_set.length > 0 && (
- ) : (
- ""
)}
- {content.attributes.content.data ? (
+ {content.attributes.content.data && (
- ) : (
- ""
)}
{content.attributes.scan_set.length === 0 &&
diff --git a/src/components/Library/LibraryContentPreview.tsx b/src/components/Library/LibraryContentPreview.tsx
index bcebbce..8017528 100644
--- a/src/components/Library/LibraryContentPreview.tsx
+++ b/src/components/Library/LibraryContentPreview.tsx
@@ -33,14 +33,12 @@ export default function LibraryContentPreview(
)}
- {item.type.data ? (
+ {item.type.data && (
{item.type.data.attributes.titles.length > 0
? item.type.data.attributes.titles[0].title
: prettySlug(item.type.data.attributes.slug)}
- ) : (
- ""
)}
diff --git a/src/components/Library/LibraryItemsPreview.tsx b/src/components/Library/LibraryItemsPreview.tsx
index a8cc035..392a3fc 100644
--- a/src/components/Library/LibraryItemsPreview.tsx
+++ b/src/components/Library/LibraryItemsPreview.tsx
@@ -44,12 +44,10 @@ export default function LibraryItemsPreview(
)}
- {item.metadata && item.metadata.length > 0 ? (
+ {item.metadata && item.metadata.length > 0 && (
{prettyItemSubType(item.metadata[0])}
- ) : (
- ""
)}
@@ -65,36 +63,31 @@ export default function LibraryItemsPreview(
))}
- {item.release_date || item.price ? (
-
- {item.release_date ? (
-
-
- event
-
- {prettyDate(item.release_date)}
-
- ) : (
- ""
- )}
- {item.price && props.currencies ? (
-
-
- shopping_cart
-
- {prettyPrice(
- item.price,
- props.currencies,
- appLayout.currency
- )}
-
- ) : (
- ""
- )}
-
- ) : (
- ""
- )}
+ {item.release_date ||
+ (item.price && (
+
+ {item.release_date && (
+
+
+ event
+
+ {prettyDate(item.release_date)}
+
+ )}
+ {item.price && props.currencies && (
+
+
+ shopping_cart
+
+ {prettyPrice(
+ item.price,
+ props.currencies,
+ appLayout.currency
+ )}
+
+ )}
+
+ ))}
diff --git a/src/components/PanelComponents/PanelHeader.tsx b/src/components/PanelComponents/PanelHeader.tsx
index 94e32b3..925d46d 100644
--- a/src/components/PanelComponents/PanelHeader.tsx
+++ b/src/components/PanelComponents/PanelHeader.tsx
@@ -10,10 +10,8 @@ export default function PanelHeader(props: PanelHeaderProps): JSX.Element {
return (
<>
- {props.icon ? (
+ {props.icon && (
{props.icon}
- ) : (
- ""
)}
{props.title}
{props.description ?
{props.description}
: ""}
diff --git a/src/components/Panels/MainPanel.tsx b/src/components/Panels/MainPanel.tsx
index 0390ccf..f1928fa 100644
--- a/src/components/Panels/MainPanel.tsx
+++ b/src/components/Panels/MainPanel.tsx
@@ -192,10 +192,8 @@ export default function MainPanel(props: MainPanelProps): JSX.Element {
}`}
>
- {langui.licensing_notice ? (
+ {langui.licensing_notice && (
{langui.licensing_notice}
- ) : (
- ""
)}
- {langui.copyright_notice ? (
+ {langui.copyright_notice && (
{langui.copyright_notice}
- ) : (
- ""
)}
diff --git a/src/pages/contents/[slug]/index.tsx b/src/pages/contents/[slug]/index.tsx
index 1c9726d..e3799bb 100644
--- a/src/pages/contents/[slug]/index.tsx
+++ b/src/pages/contents/[slug]/index.tsx
@@ -44,28 +44,22 @@ export default function ContentIndex(props: ContentIndexProps): JSX.Element {
- {content.text_set.length > 0 ? (
+ {content.text_set.length > 0 && (
- ) : (
- ""
)}
- {content.audio_set.length > 0 ? (
+ {content.audio_set.length > 0 && (
- ) : (
- ""
)}
- {content.video_set.length > 0 ? (
+ {content.video_set.length > 0 && (
- ) : (
- ""
)}
diff --git a/src/pages/contents/[slug]/read.tsx b/src/pages/contents/[slug]/read.tsx
index 8dc58cb..8a6fc0b 100644
--- a/src/pages/contents/[slug]/read.tsx
+++ b/src/pages/contents/[slug]/read.tsx
@@ -47,7 +47,7 @@ export default function ContentRead(props: ContentReadProps): JSX.Element {
horizontalLine
/>
- {content.text_set.length > 0 ? (
+ {content.text_set.length > 0 && (
{content.text_set[0].source_language.data.attributes.code ===
@@ -140,8 +140,6 @@ export default function ContentRead(props: ContentReadProps): JSX.Element {
)}
- ) : (
- ""
)}
);
@@ -159,10 +157,8 @@ export default function ContentRead(props: ContentReadProps): JSX.Element {
- {content.text_set.length > 0 ? (
+ {content.text_set.length > 0 && (
- ) : (
- ""
)}
diff --git a/src/pages/library/[slug].tsx b/src/pages/library/[slug].tsx
index 7df9fca..f4fdba3 100644
--- a/src/pages/library/[slug].tsx
+++ b/src/pages/library/[slug].tsx
@@ -70,15 +70,13 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
onClick={() => appLayout.setSubPanelOpen(false)}
/>
- {item.gallery.data.length > 0 ? (
+ {item.gallery.data.length > 0 && (
appLayout.setSubPanelOpen(false)}
/>
- ) : (
- ""
)}
appLayout.setSubPanelOpen(false)}
/>
- {item.subitems.data.length > 0 ? (
+ {item.subitems.data.length > 0 && (
appLayout.setSubPanelOpen(false)}
/>
- ) : (
- ""
)}
- {item.contents.data.length > 0 ? (
+ {item.contents.data.length > 0 && (
- ) : (
- ""
)}
@@ -134,7 +128,7 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
- {item.subitem_of.data.length > 0 ? (
+ {item.subitem_of.data.length > 0 && (
- ) : (
- ""
)}
{item.title}
- {item.subtitle ? (
- {item.subtitle}
- ) : (
- ""
- )}
+ {item.subtitle && {item.subtitle}
}
- {item.descriptions.length > 0 ? (
+ {item.descriptions.length > 0 && (
{item.descriptions[0].description}
- ) : (
- ""
)}
- {item.gallery.data.length > 0 ? (
+ {item.gallery.data.length > 0 && (
{langui.gallery}
@@ -186,15 +172,13 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
))}
- ) : (
- ""
)}
{langui.details}
- {item.metadata.length > 0 ? (
+ {item.metadata.length > 0 && (
{langui.type}
@@ -203,20 +187,16 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
{prettyItemSubType(item.metadata[0])}
- ) : (
- ""
)}
- {item.release_date ? (
+ {item.release_date && (
{langui.release_date}
{prettyDate(item.release_date)}
- ) : (
- ""
)}
- {item.price ? (
+ {item.price && (
{langui.price}
@@ -234,11 +214,9 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
)}
- ) : (
- ""
)}
- {item.size ? (
+ {item.size && (
<>
{langui.size}
@@ -256,7 +234,7 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
{convertMmToInch(item.size.height)} in
- {item.size.thickness ? (
+ {item.size.thickness && (
{langui.thickness}:
@@ -264,84 +242,68 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
{convertMmToInch(item.size.thickness)} in
- ) : (
- ""
)}
>
- ) : (
- ""
)}
{item.metadata.length > 0 &&
- item.metadata[0].__typename !== "ComponentMetadataGroup" &&
- item.metadata[0].__typename !== "ComponentMetadataOther" ? (
- <>
- {langui.type_information}
-
- {item.metadata[0].__typename === "ComponentMetadataBooks" ? (
- <>
-
-
{langui.pages}:
-
{item.metadata[0].page_count}
-
+ item.metadata[0].__typename !== "ComponentMetadataGroup" &&
+ item.metadata[0].__typename !== "ComponentMetadataOther" && (
+ <>
+
{langui.type_information}
+
+ {item.metadata[0].__typename ===
+ "ComponentMetadataBooks" && (
+ <>
+
+
{langui.pages}:
+
{item.metadata[0].page_count}
+
-
-
{langui.binding}:
-
- {item.metadata[0].binding_type ===
- Enum_Componentmetadatabooks_Binding_Type.Paperback
- ? langui.paperback
- : item.metadata[0].binding_type ===
- Enum_Componentmetadatabooks_Binding_Type.Hardcover
- ? langui.hardcover
- : ""}
-
-
-
-
-
{langui.page_order}:
-
- {item.metadata[0].page_order ===
- Enum_Componentmetadatabooks_Page_Order.LeftToRight
- ? langui.left_to_right
- : item.metadata[0].page_order ===
- Enum_Componentmetadatabooks_Page_Order.RightToLeft
- ? langui.right_to_left
- : ""}
-
-
-
-
-
{langui.languages}:
- {item.metadata[0].languages.data.map((lang) => (
-
- {lang.attributes.name}
+
+
{langui.binding}:
+
+ {item.metadata[0].binding_type ===
+ Enum_Componentmetadatabooks_Binding_Type.Paperback
+ ? langui.paperback
+ : item.metadata[0].binding_type ===
+ Enum_Componentmetadatabooks_Binding_Type.Hardcover
+ ? langui.hardcover
+ : ""}
- ))}
-
- >
- ) : item.metadata[0].__typename ===
- "ComponentMetadataAudio" ? (
- <>>
- ) : item.metadata[0].__typename ===
- "ComponentMetadataVideo" ? (
- <>>
- ) : item.metadata[0].__typename ===
- "ComponentMetadataGame" ? (
- <>>
- ) : (
- ""
- )}
-
- >
- ) : (
- ""
- )}
+
+
+
+
{langui.page_order}:
+
+ {item.metadata[0].page_order ===
+ Enum_Componentmetadatabooks_Page_Order.LeftToRight
+ ? langui.left_to_right
+ : item.metadata[0].page_order ===
+ Enum_Componentmetadatabooks_Page_Order.RightToLeft
+ ? langui.right_to_left
+ : ""}
+
+
+
+
+
{langui.languages}:
+ {item.metadata[0].languages.data.map((lang) => (
+
+ {lang.attributes.name}
+
+ ))}
+
+ >
+ )}
+
+ >
+ )}
- {item.subitems.data.length > 0 ? (
+ {item.subitems.data.length > 0 && (
- ) : (
- ""
)}
- {item.contents.data.length > 0 ? (
+ {item.contents.data.length > 0 && (
{langui.contents}
@@ -376,8 +336,6 @@ export default function LibrarySlug(props: LibrarySlugProps): JSX.Element {
))}
- ) : (
- ""
)}