diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx
index 9334220..5721da6 100644
--- a/src/components/AppLayout.tsx
+++ b/src/components/AppLayout.tsx
@@ -149,7 +149,7 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element {
{/* Background when navbar is opened */}
@@ -27,7 +29,7 @@ export default function HorizontalLine(
- {(item.release_date ?? item.price) && (
+ {(item.release_date || item.price) && (
{item.release_date && (
diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx
index db37151..3e7d108 100644
--- a/src/components/Markdown/Markdawn.tsx
+++ b/src/components/Markdown/Markdawn.tsx
@@ -5,7 +5,7 @@ import LightBox from "components/LightBox";
import ToolTip from "components/ToolTip";
import { useAppLayout } from "contexts/AppLayoutContext";
import Markdown from "markdown-to-jsx";
-import { NextRouter } from "next/router";
+import { useRouter } from "next/router";
import { slugify } from "queries/helpers";
import React, { useState } from "react";
import ReactDOMServer from "react-dom/server";
@@ -13,14 +13,13 @@ import ReactDOMServer from "react-dom/server";
type MarkdawnProps = {
className?: string;
text: string;
- router: NextRouter;
};
export default function Markdawn(props: MarkdawnProps): JSX.Element {
const appLayout = useAppLayout();
const text = preprocessMarkDawn(props.text);
- const { router } = props;
+ const router = useRouter();
const [lightboxOpen, setLightboxOpen] = useState(false);
const [lightboxImages, setLightboxImages] = useState([""]);
@@ -41,6 +40,21 @@ export default function Markdawn(props: MarkdawnProps): JSX.Element {
options={{
slugify: slugify,
overrides: {
+ a: {
+ component: (compProps: {
+ href: string;
+ children: React.ReactNode;
+ }) => {
+ if (compProps.href.startsWith("/")) {
+ return (
+ router.push(compProps.href)}>
+ {compProps.children}
+
+ );
+ }
+ return {compProps.children};
+ },
+ },
h1: {
component: (compProps: {
id: string;
@@ -313,7 +327,7 @@ export function preprocessMarkDawn(text: string): string {
const visitedSlugs: string[] = [];
const result = text.split("\n").map((line) => {
- if (line === "* * *" ?? line === "---") {
+ if (line === "* * *" || line === "---") {
scenebreakIndex += 1;
return ``;
}
diff --git a/src/components/Markdown/TOC.tsx b/src/components/Markdown/TOC.tsx
index 010702f..430c358 100644
--- a/src/components/Markdown/TOC.tsx
+++ b/src/components/Markdown/TOC.tsx
@@ -1,16 +1,16 @@
-import { NextRouter } from "next/router";
+import { useRouter } from "next/router";
import { slugify } from "queries/helpers";
import { preprocessMarkDawn } from "./Markdawn";
type TOCProps = {
text: string;
title?: string;
- router: NextRouter;
};
export default function TOCComponent(props: TOCProps): JSX.Element {
- const { router, text, title } = props;
+ const { text, title } = props;
const toc = getTocFromMarkdawn(preprocessMarkDawn(text), title);
+ const router = useRouter();
return (
<>
@@ -21,11 +21,7 @@ export default function TOCComponent(props: TOCProps): JSX.Element {
{{toc.title}}
-
+
>
);
@@ -34,11 +30,11 @@ export default function TOCComponent(props: TOCProps): JSX.Element {
type TOCLevelProps = {
tocchildren: TOC[];
parentNumbering: string;
- router: NextRouter;
};
function TOCLevel(props: TOCLevelProps): JSX.Element {
- const { tocchildren, parentNumbering, router } = props;
+ const router = useRouter();
+ const { tocchildren, parentNumbering } = props;
return (
{tocchildren.map((child, childIndex) => (
@@ -57,7 +53,6 @@ function TOCLevel(props: TOCLevelProps): JSX.Element {
>
))}
diff --git a/src/components/PanelComponents/NavOption.tsx b/src/components/PanelComponents/NavOption.tsx
index 2a4377e..c640aa9 100644
--- a/src/components/PanelComponents/NavOption.tsx
+++ b/src/components/PanelComponents/NavOption.tsx
@@ -1,5 +1,4 @@
import ToolTip from "components/ToolTip";
-import Link from "next/link";
import { useRouter } from "next/router";
import { MouseEventHandler } from "react";
@@ -35,27 +34,32 @@ export default function NavOption(props: NavOptionProps): JSX.Element {
className="text-left"
disabled={!props.reduced}
>
-
-
- {props.icon && (
-
{props.icon}
- )}
+
{
+ if (props.onClick) props.onClick(event);
+ if (props.url) {
+ if (props.url.startsWith("#")) {
+ router.replace(props.url);
+ } else {
+ router.push(props.url);
+ }
+ }
+ }}
+ className={`relative grid grid-flow-col grid-cols-[auto] auto-cols-fr justify-center ${
+ props.icon ? "text-left" : "text-center"
+ } ${divCommon}`}
+ >
+ {props.icon && (
+
{props.icon}
+ )}
- {!props.reduced && (
-
-
{props.title}
- {props.subtitle && (
-
{props.subtitle}
- )}
-
- )}
-
-
+ {!props.reduced && (
+
+
{props.title}
+ {props.subtitle &&
{props.subtitle}
}
+
+ )}
+
);
}
diff --git a/src/components/Panels/MainPanel.tsx b/src/components/Panels/MainPanel.tsx
index f80b16d..f95ee31 100644
--- a/src/components/Panels/MainPanel.tsx
+++ b/src/components/Panels/MainPanel.tsx
@@ -109,7 +109,7 @@ export default function MainPanel(props: MainPanelProps): JSX.Element {
)}
- {langui.open_search}}
placement="right"
className="text-left"
@@ -130,7 +130,7 @@ export default function MainPanel(props: MainPanelProps): JSX.Element {
search
-
+ */}
diff --git a/src/graphql/operation.graphql b/src/graphql/operation.graphql
index f4353e7..bf38c35 100644
--- a/src/graphql/operation.graphql
+++ b/src/graphql/operation.graphql
@@ -1011,6 +1011,15 @@ query getContentText($slug: String, $language_code: String) {
}
}
}
+ text_set_languages: text_set {
+ language {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ }
text_set(filters: { language: { code: { eq: $language_code } } }) {
status
text
@@ -1233,6 +1242,15 @@ query getPost($slug: String, $language_code: String) {
}
}
}
+ translations_languages: translations {
+ language {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ }
translations(filters: { language: { code: { eq: $language_code } } }) {
status
title
@@ -1319,24 +1337,6 @@ query getPostsPreview($language_code: String) {
}
}
-query getPostLanguages($slug: String) {
- posts(filters: { slug: { eq: $slug } }) {
- data {
- attributes {
- translations {
- language {
- data {
- attributes {
- code
- }
- }
- }
- }
- }
- }
- }
-}
-
query getContentLanguages($slug: String) {
contents(filters: { slug: { eq: $slug } }) {
data {
@@ -1372,3 +1372,192 @@ query getContentLanguages($slug: String) {
}
}
}
+
+query getLibraryItemScans($slug: String, $language_code: String) {
+ libraryItems(filters: { slug: { eq: $slug } }) {
+ data {
+ id
+ attributes {
+ slug
+ title
+ subtitle
+ thumbnail {
+ data {
+ attributes {
+ name
+ alternativeText
+ caption
+ width
+ height
+ url
+ }
+ }
+ }
+ contents(pagination: { limit: -1 }) {
+ data {
+ id
+ attributes {
+ slug
+ range {
+ __typename
+ ... on ComponentRangePageRange {
+ starting_page
+ ending_page
+ }
+ ... on ComponentRangeTimeRange {
+ starting_time
+ ending_time
+ }
+ }
+ scan_set_languages: scan_set {
+ language {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ }
+ scan_set(
+ filters: {
+ or: [
+ { language: { code: { eq: "xx" } } }
+ { language: { code: { eq: $language_code } } }
+ ]
+ }
+ ) {
+ status
+ source_language {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ scanners {
+ data {
+ id
+ attributes {
+ username
+ anonymize
+ anonymous_code
+ pronouns
+ bio(
+ filters: { language: { code: { eq: $language_code } } }
+ ) {
+ bio
+ }
+ languages {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ avatar {
+ data {
+ attributes {
+ name
+ alternativeText
+ caption
+ width
+ height
+ url
+ }
+ }
+ }
+ }
+ }
+ }
+ cleaners {
+ data {
+ id
+ attributes {
+ username
+ anonymize
+ anonymous_code
+ pronouns
+ bio(
+ filters: { language: { code: { eq: $language_code } } }
+ ) {
+ bio
+ }
+ languages {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ avatar {
+ data {
+ attributes {
+ name
+ alternativeText
+ caption
+ width
+ height
+ url
+ }
+ }
+ }
+ }
+ }
+ }
+ typesetters {
+ data {
+ id
+ attributes {
+ username
+ anonymize
+ anonymous_code
+ pronouns
+ bio(
+ filters: { language: { code: { eq: $language_code } } }
+ ) {
+ bio
+ }
+ languages {
+ data {
+ attributes {
+ code
+ }
+ }
+ }
+ avatar {
+ data {
+ attributes {
+ name
+ alternativeText
+ caption
+ width
+ height
+ url
+ }
+ }
+ }
+ }
+ }
+ }
+ notes
+ pages(pagination: { limit: -1 }) {
+ data {
+ id
+ attributes {
+ name
+ alternativeText
+ caption
+ width
+ height
+ url
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/graphql/operations-types.ts b/src/graphql/operations-types.ts
index 29dad8b..a07b590 100644
--- a/src/graphql/operations-types.ts
+++ b/src/graphql/operations-types.ts
@@ -32,7 +32,7 @@ export type Scalars = {
*
* But to make the type easier to work with, it went through the following transformation:
* - Removed ?
- * - Removed | null
+ * - Removed
* - Replaced any by unknown
*/
@@ -74,6 +74,13 @@ export enum Enum_Componentsetstextset_Status {
Done = "Done",
}
+export enum Enum_Componentsetsscanset_Status {
+ Incomplete = "Incomplete",
+ Draft = "Draft",
+ Review = "Review",
+ Done = "Done",
+}
+
export type StrapiImage = {
__typename: "UploadFile";
name: string;
@@ -1360,6 +1367,19 @@ export type GetContentTextQuery = {
};
}>;
};
+ text_set_languages: Array<{
+ __typename: "ComponentSetsTextSet";
+ language: {
+ __typename: "LanguageEntityResponse";
+ data: {
+ __typename: "LanguageEntity";
+ attributes: {
+ __typename: "Language";
+ code: string;
+ };
+ };
+ };
+ }>;
text_set: Array<{
__typename: "ComponentSetsTextSet";
status: Enum_Componentsetstextset_Status;
@@ -1576,14 +1596,14 @@ export type GetPostQuery = {
attributes: {
__typename: "Post";
slug: string;
- updatedAt: unknown;
+ updatedAt: any;
+ hidden: boolean;
date: {
__typename: "ComponentBasicsDatepicker";
year: number;
month: number;
day: number;
};
- hidden: boolean;
authors: {
__typename: "RecorderRelationResponseCollection";
data: Array<{
@@ -1629,11 +1649,7 @@ export type GetPostQuery = {
data: Array<{
__typename: "CategoryEntity";
id: string;
- attributes: {
- __typename: "Category";
- name: string;
- short: string;
- };
+ attributes: { __typename: "Category"; name: string; short: string };
}>;
};
thumbnail: {
@@ -1651,6 +1667,16 @@ export type GetPostQuery = {
};
};
};
+ translations_languages: Array<{
+ __typename: "ComponentTranslationsPosts";
+ language: {
+ __typename: "LanguageEntityResponse";
+ data: {
+ __typename: "LanguageEntity";
+ attributes: { __typename: "Language"; code: string };
+ };
+ };
+ }>;
translations: Array<{
__typename: "ComponentTranslationsPosts";
status: Enum_Componenttranslationsposts_Status;
@@ -1833,3 +1859,238 @@ export type GetContentLanguagesQuery = {
}>;
};
};
+
+export type GetLibraryItemScansQueryVariables = Exact<{
+ slug: InputMaybe