Updated deps + minor fix for seperator in content pages

This commit is contained in:
DrMint 2023-03-05 13:22:36 +01:00
parent 7eb7495537
commit e39eb316de
4 changed files with 465 additions and 382 deletions

738
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,35 +28,35 @@
"cuid": "^2.1.8",
"intl-messageformat": "^10.3.1",
"isomorphic-dompurify": "^1.0.0",
"jotai": "^2.0.2",
"jotai": "^2.0.3",
"markdown-to-jsx": "^7.1.9",
"marked": "^4.2.12",
"material-symbols": "^0.4.5",
"material-symbols": "^0.4.6",
"meilisearch": "^0.31.1",
"next": "^13.1.6",
"next": "^13.2.3",
"nodemailer": "^6.9.1",
"rc-slider": "^10.1.1",
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-hotkeys-hook": "^3.4.7",
"react-swipeable": "^7.0.0",
"react-zoom-pan-pinch": "^2.6.1",
"react-zoom-pan-pinch": "^3.0.1",
"string-natural-compare": "^3.0.1",
"throttle-debounce": "^5.0.0",
"tippy.js": "^6.3.7",
"turndown": "^7.1.1",
"ua-parser-js": "^1.0.33",
"usehooks-ts": "^2.9.1",
"zod": "^3.20.6"
"zod": "^3.21.0"
},
"devDependencies": {
"@digitak/esrun": "^3.2.19",
"@graphql-codegen/cli": "^3.1.0",
"@digitak/esrun": "3.2.20",
"@graphql-codegen/cli": "^3.2.1",
"@graphql-codegen/typescript": "3.0.1",
"@graphql-codegen/typescript-graphql-request": "^4.5.8",
"@graphql-codegen/typescript-operations": "^3.0.1",
"@types/marked": "^4.0.8",
"@types/node": "18.14.0",
"@types/node": "18.14.6",
"@types/nodemailer": "^6.4.7",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
@ -64,17 +64,17 @@
"@types/throttle-debounce": "^5.0.0",
"@types/turndown": "^5.0.1",
"@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"dotenv": "^16.0.3",
"eslint": "^8.34.0",
"eslint-config-next": "13.1.6",
"eslint": "^8.35.0",
"eslint-config-next": "13.2.3",
"eslint-plugin-import": "^2.27.5",
"graphql": "^16.6.0",
"graphql-request": "^5.1.0",
"next-sitemap": "^3.1.52",
"graphql-request": "5.1.0",
"next-sitemap": "^4.0.2",
"prettier": "^2.8.4",
"prettier-plugin-tailwindcss": "^0.2.3",
"prettier-plugin-tailwindcss": "^0.2.4",
"tailwindcss": "^3.2.7",
"ts-unused-exports": "^9.0.4",
"typescript": "^4.9.5"

View File

@ -15,14 +15,14 @@ export const useFullscreen = (
const elem = isClient ? document.querySelector(`#${id}`) : null;
const requestFullscreen = useCallback(() => elem?.requestFullscreen(), [elem]);
const requestFullscreen = useCallback(async () => elem?.requestFullscreen(), [elem]);
const exitFullscreen = useCallback(
async () => isFullscreen && document.exitFullscreen(),
[isFullscreen]
);
const toggleFullscreen = useCallback(
() => (isFullscreen ? exitFullscreen() : requestFullscreen()),
async () => (isFullscreen ? exitFullscreen() : requestFullscreen()),
[exitFullscreen, isFullscreen, requestFullscreen]
);

View File

@ -280,44 +280,43 @@ const Content = ({ content, ...otherProps }: Props): JSX.Element => {
) : undefined
}
/>,
<>
{previousContent?.attributes && (
<div className="mb-6 w-full">
<h2 className="mb-4 text-center text-2xl">{format("previous_content")}</h2>
<TranslatedPreviewLine
href={`/contents/${previousContent.attributes.slug}`}
translations={filterHasAttributes(previousContent.attributes.translations, [
"language.data.attributes.code",
] as const).map((translation) => ({
pre_title: translation.pre_title,
title: translation.title,
subtitle: translation.subtitle,
language: translation.language.data.attributes.code,
}))}
fallback={{
title: prettySlug(previousContent.attributes.slug),
}}
thumbnail={previousContent.attributes.thumbnail?.data?.attributes}
topChips={
isContentPanelAtLeast2xl && previousContent.attributes.type?.data?.attributes
? [
previousContent.attributes.type.data.attributes.titles?.[0]
? previousContent.attributes.type.data.attributes.titles[0]?.title
: prettySlug(previousContent.attributes.type.data.attributes.slug),
]
: undefined
}
bottomChips={
isContentPanelAtLeast2xl
? previousContent.attributes.categories?.data.map(
(category) => category.attributes?.short ?? ""
)
: undefined
}
/>
</div>
)}
</>,
previousContent?.attributes && (
<div className="mb-6 w-full">
<h2 className="mb-4 text-center text-2xl">{format("previous_content")}</h2>
<TranslatedPreviewLine
href={`/contents/${previousContent.attributes.slug}`}
translations={filterHasAttributes(previousContent.attributes.translations, [
"language.data.attributes.code",
] as const).map((translation) => ({
pre_title: translation.pre_title,
title: translation.title,
subtitle: translation.subtitle,
language: translation.language.data.attributes.code,
}))}
fallback={{
title: prettySlug(previousContent.attributes.slug),
}}
thumbnail={previousContent.attributes.thumbnail?.data?.attributes}
topChips={
isContentPanelAtLeast2xl && previousContent.attributes.type?.data?.attributes
? [
previousContent.attributes.type.data.attributes.titles?.[0]
? previousContent.attributes.type.data.attributes.titles[0]?.title
: prettySlug(previousContent.attributes.type.data.attributes.slug),
]
: undefined
}
bottomChips={
isContentPanelAtLeast2xl
? previousContent.attributes.categories?.data.map(
(category) => category.attributes?.short ?? ""
)
: undefined
}
/>
</div>
),
selectedTranslation?.text_set?.text && (
<Markdawn text={selectedTranslation.text_set.text} />