diff --git a/src/components/RecorderChip.tsx b/src/components/RecorderChip.tsx index 9ebd20a..cf82c0e 100644 --- a/src/components/RecorderChip.tsx +++ b/src/components/RecorderChip.tsx @@ -21,9 +21,8 @@ export default function RecorderChip(props: Props): JSX.Element { {recorder.avatar?.data?.attributes && ( )}
diff --git a/src/pages/archives/videos/c/[uid].tsx b/src/pages/archives/videos/c/[uid].tsx index 9987256..abeb2b7 100644 --- a/src/pages/archives/videos/c/[uid].tsx +++ b/src/pages/archives/videos/c/[uid].tsx @@ -7,7 +7,8 @@ import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import SubPanel from "components/Panels/SubPanel"; -import VideoPreview from "components/Videos/VideoPreview"; +import Switch from "components/Switch"; +import ThumbnailPreview from "components/ThumbnailPreview"; import { GetVideoChannelQuery } from "graphql/generated"; import { getReadySdk } from "graphql/sdk"; import { @@ -16,6 +17,8 @@ import { GetStaticPropsContext, } from "next"; import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; +import { getVideoThumbnailURL } from "queries/helpers"; +import { useState } from "react"; interface Props extends AppStaticProps { channel: Exclude< @@ -26,6 +29,8 @@ interface Props extends AppStaticProps { export default function Channel(props: Props): JSX.Element { const { langui, channel } = props; + const [keepInfoVisible, setKeepInfoVisible] = useState(true); + const subPanel = ( + +
+

{"Always show info"}:

+ +
); @@ -52,7 +62,28 @@ export default function Channel(props: Props): JSX.Element {
{channel?.videos?.data.map((video) => ( - <>{video.attributes && } + <> + {video.attributes && ( + + )} + ))}
diff --git a/src/pages/archives/videos/index.tsx b/src/pages/archives/videos/index.tsx index 044da27..156e79a 100644 --- a/src/pages/archives/videos/index.tsx +++ b/src/pages/archives/videos/index.tsx @@ -8,12 +8,13 @@ import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import SubPanel from "components/Panels/SubPanel"; -import VideoPreview from "components/Videos/VideoPreview"; +import Switch from "components/Switch"; +import ThumbnailPreview from "components/ThumbnailPreview"; import { GetVideosPreviewQuery } from "graphql/generated"; import { getReadySdk } from "graphql/sdk"; import { GetStaticPropsContext } from "next"; import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; -import { prettyDate } from "queries/helpers"; +import { getVideoThumbnailURL, prettyDate } from "queries/helpers"; import { useState } from "react"; interface Props extends AppStaticProps { @@ -44,6 +45,7 @@ export default function Videos(props: Props): JSX.Element { } const [page, setPage] = useState(0); + const [keepInfoVisible, setKeepInfoVisible] = useState(true); const subPanel = ( @@ -60,6 +62,11 @@ export default function Videos(props: Props): JSX.Element { title="Videos" description={langui.archives_description} /> + +
+

{"Always show info"}:

+ +
); @@ -76,7 +83,24 @@ export default function Videos(props: Props): JSX.Element { {paginatedVideos[page].map((video) => ( <> {video.attributes && ( - + )} ))} diff --git a/src/pages/contents/[slug]/index.tsx b/src/pages/contents/[slug]/index.tsx index 68d90b4..3ed79e5 100644 --- a/src/pages/contents/[slug]/index.tsx +++ b/src/pages/contents/[slug]/index.tsx @@ -1,7 +1,7 @@ import AppLayout from "components/AppLayout"; import Button from "components/Button"; import Chip from "components/Chip"; -import ThumbnailHeader from "components/Content/ThumbnailHeader"; +import ThumbnailHeader from "components/ThumbnailHeader"; import HorizontalLine from "components/HorizontalLine"; import LanguageSwitcher from "components/LanguageSwitcher"; import Markdawn from "components/Markdown/Markdawn"; diff --git a/src/pages/contents/index.tsx b/src/pages/contents/index.tsx index 2630d4b..dd95b0b 100644 --- a/src/pages/contents/index.tsx +++ b/src/pages/contents/index.tsx @@ -1,12 +1,13 @@ import AppLayout from "components/AppLayout"; import Chip from "components/Chip"; -import LibraryContentPreview from "components/Library/LibraryContentPreview"; import PanelHeader from "components/PanelComponents/PanelHeader"; import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import SubPanel from "components/Panels/SubPanel"; import Select from "components/Select"; +import Switch from "components/Switch"; +import ThumbnailPreview from "components/ThumbnailPreview"; import { GetContentsQuery } from "graphql/generated"; import { getReadySdk } from "graphql/sdk"; import { GetStaticPropsContext } from "next"; @@ -24,6 +25,7 @@ export default function Contents(props: Props): JSX.Element { const { langui, contents } = props; const [groupingMethod, setGroupingMethod] = useState(-1); + const [keepInfoVisible, setKeepInfoVisible] = useState(false); const [groups, setGroups] = useState( getGroups(langui, groupingMethod, contents) @@ -51,6 +53,11 @@ export default function Contents(props: Props): JSX.Element { allowEmpty /> + +
+

{"Always show info"}:

+ +
); const contentPanel = ( @@ -79,9 +86,33 @@ export default function Contents(props: Props): JSX.Element { {items.map((item) => ( <> {item.attributes && ( - category.attributes?.short ?? "" + )} + keepInfoVisible={keepInfoVisible} /> )} diff --git a/src/pages/library/[slug]/index.tsx b/src/pages/library/[slug]/index.tsx index f4b6c13..b840117 100644 --- a/src/pages/library/[slug]/index.tsx +++ b/src/pages/library/[slug]/index.tsx @@ -3,8 +3,7 @@ import Button from "components/Button"; import Chip from "components/Chip"; import Img, { getAssetURL, ImageQuality } from "components/Img"; import InsetBox from "components/InsetBox"; -import ContentTOCLine from "components/Library/ContentTOCLine"; -import LibraryItemsPreview from "components/Library/LibraryItemsPreview"; +import ContentLine from "components/Library/ContentLine"; import LightBox from "components/LightBox"; import NavOption from "components/PanelComponents/NavOption"; import ReturnButton, { @@ -14,6 +13,8 @@ import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import SubPanel from "components/Panels/SubPanel"; +import Switch from "components/Switch"; +import ThumbnailPreview from "components/ThumbnailPreview"; import { useAppLayout } from "contexts/AppLayoutContext"; import { Enum_Componentmetadatabooks_Binding_Type, @@ -68,6 +69,8 @@ export default function LibrarySlug(props: Props): JSX.Element { const [lightboxImages, setLightboxImages] = useState([""]); const [lightboxIndex, setLightboxIndex] = useState(0); + const [keepInfoVisible, setKeepInfoVisible] = useState(false); + let displayOpenScans = false; if (item?.contents?.data) for (const content of item.contents.data) { @@ -424,13 +427,42 @@ export default function LibrarySlug(props: Props): JSX.Element {

{isVariantSet ? langui.variants : langui.subitems}

+ +
+

{"Always show info"}:

+ +
{item.subitems.data.map((subitem) => ( - + <> + {subitem.attributes && ( + 0 && + subitem.attributes.metadata[0] + ? [prettyItemSubType(subitem.attributes.metadata[0])] + : [] + } + bottomChips={subitem.attributes.categories?.data.map( + (category) => category.attributes?.short ?? "" + )} + metadata={{ + currencies: currencies, + release_date: subitem.attributes.release_date, + price: subitem.attributes.price, + position: "Bottom", + }} + /> + )} + ))}
@@ -446,7 +478,7 @@ export default function LibrarySlug(props: Props): JSX.Element { )}
{item.contents.data.map((content) => ( - (false); const [sortingMethod, setSortingMethod] = useState(0); const [groupingMethod, setGroupingMethod] = useState(-1); + const [keepInfoVisible, setKeepInfoVisible] = useState(false); const [filteredItems, setFilteredItems] = useState( filterItems( @@ -120,6 +126,11 @@ export default function Library(props: Props): JSX.Element {

{langui.show_secondary_items}:

+ +
+

{"Always show info"}:

+ +
); const contentPanel = ( @@ -146,11 +157,35 @@ export default function Library(props: Props): JSX.Element { className="grid gap-8 items-end mobile:grid-cols-2 desktop:grid-cols-[repeat(auto-fill,_minmax(13rem,1fr))] pb-12 border-b-[3px] border-dotted last-of-type:border-0" > {items.map((item) => ( - + <> + {item.attributes && ( + 0 && + item.attributes.metadata[0] + ? [prettyItemSubType(item.attributes.metadata[0])] + : [] + } + bottomChips={item.attributes.categories?.data.map( + (category) => category.attributes?.short ?? "" + )} + metadata={{ + currencies: currencies, + release_date: item.attributes.release_date, + price: item.attributes.price, + position: "Bottom", + }} + /> + )} + ))} diff --git a/src/pages/news/index.tsx b/src/pages/news/index.tsx index cb4faf5..c0f60c8 100644 --- a/src/pages/news/index.tsx +++ b/src/pages/news/index.tsx @@ -1,15 +1,17 @@ import AppLayout from "components/AppLayout"; -import PostsPreview from "components/News/PostsPreview"; import PanelHeader from "components/PanelComponents/PanelHeader"; import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import SubPanel from "components/Panels/SubPanel"; +import Switch from "components/Switch"; +import ThumbnailPreview from "components/ThumbnailPreview"; import { GetPostsPreviewQuery } from "graphql/generated"; import { getReadySdk } from "graphql/sdk"; import { GetStaticPropsContext } from "next"; import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; -import { prettyDate } from "queries/helpers"; +import { prettyDate, prettySlug } from "queries/helpers"; +import { useState } from "react"; interface Props extends AppStaticProps { posts: Exclude["data"]; @@ -18,6 +20,8 @@ interface Props extends AppStaticProps { export default function News(props: Props): JSX.Element { const { langui, posts } = props; + const [keepInfoVisible, setKeepInfoVisible] = useState(true); + posts .sort((a, b) => { const dateA = a.attributes?.date ? prettyDate(a.attributes.date) : "9999"; @@ -33,6 +37,11 @@ export default function News(props: Props): JSX.Element { title={langui.news} description={langui.news_description} /> + +
+

{"Always show info"}:

+ +
); @@ -40,7 +49,29 @@ export default function News(props: Props): JSX.Element {
{posts.map((post) => ( - + <> + {post.attributes && ( + category.attributes?.short ?? "" + )} + thumbnailAspectRatio="3/2" + keepInfoVisible={keepInfoVisible} + metadata={{ + release_date: post.attributes.date, + position: "Top", + }} + /> + )} + ))}