Fixed sequential contents in the wrong order
This commit is contained in:
parent
ca12dc2c29
commit
9e5ad41e5c
@ -36,7 +36,7 @@ export const Markdawn = ({ className, text: rawText }: MarkdawnProps): JSX.Eleme
|
||||
const { showLightBox } = useAtomGetter(atoms.lightBox);
|
||||
|
||||
/* eslint-disable no-irregular-whitespace */
|
||||
const text = `${preprocessMarkDawn(rawText, playerName)}\n
|
||||
const text = `${preprocessMarkDawn(rawText, playerName)}
|
||||
`;
|
||||
/* eslint-enable no-irregular-whitespace */
|
||||
|
||||
|
@ -3,6 +3,7 @@ query getContentsFolder($slug: String, $language_code: String) {
|
||||
data {
|
||||
attributes {
|
||||
slug
|
||||
sequence
|
||||
titles(pagination: { limit: -1 }) {
|
||||
id
|
||||
language {
|
||||
|
@ -282,7 +282,7 @@ const Content = ({ content, ...otherProps }: Props): JSX.Element => {
|
||||
/>,
|
||||
|
||||
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}`}
|
||||
@ -315,7 +315,7 @@ const Content = ({ content, ...otherProps }: Props): JSX.Element => {
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
|
||||
selectedTranslation?.text_set?.text && (
|
||||
@ -418,9 +418,11 @@ export const getStaticProps: GetStaticProps = async (context) => {
|
||||
|
||||
const thumbnail = content.contents.data[0].attributes.thumbnail?.data?.attributes;
|
||||
|
||||
content.contents.data[0].attributes.folder?.data?.attributes?.contents?.data.sort((a, b) =>
|
||||
a.attributes && b.attributes ? naturalCompare(a.attributes.slug, b.attributes.slug) : 0
|
||||
);
|
||||
if (content.contents.data[0].attributes.folder?.data?.attributes?.sequence === false) {
|
||||
content.contents.data[0].attributes.folder.data.attributes.contents?.data.sort((a, b) =>
|
||||
a.attributes && b.attributes ? naturalCompare(a.attributes.slug, b.attributes.slug) : 0
|
||||
);
|
||||
}
|
||||
|
||||
const props: Props = {
|
||||
content: content.contents.data[0].attributes as ContentWithTranslations,
|
||||
|
@ -222,9 +222,11 @@ export const getStaticProps: GetStaticProps = async (context) => {
|
||||
a.attributes && b.attributes ? naturalCompare(a.attributes.slug, b.attributes.slug) : 0
|
||||
);
|
||||
|
||||
folder.contents?.data.sort((a, b) =>
|
||||
a.attributes && b.attributes ? naturalCompare(a.attributes.slug, b.attributes.slug) : 0
|
||||
);
|
||||
if (!folder.sequence) {
|
||||
folder.contents?.data.sort((a, b) =>
|
||||
a.attributes && b.attributes ? naturalCompare(a.attributes.slug, b.attributes.slug) : 0
|
||||
);
|
||||
}
|
||||
|
||||
const title = (() => {
|
||||
if (slug === "root") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user