Renamed prettyinline

This commit is contained in:
DrMint 2022-07-19 20:06:31 +02:00
parent ceaacc8242
commit 74b77431a9
8 changed files with 23 additions and 23 deletions

View File

@ -1,7 +1,7 @@
import { GetChroniclesChaptersQuery } from "graphql/generated"; import { GetChroniclesChaptersQuery } from "graphql/generated";
import { filterHasAttributes } from "helpers/others"; import { filterHasAttributes } from "helpers/others";
import { TranslatedChroniclePreview } from "components/Translated"; import { TranslatedChroniclePreview } from "components/Translated";
import { prettyinlineTitle, prettySlug } from "helpers/formatters"; import { prettyInlineTitle, prettySlug } from "helpers/formatters";
import { Ico, Icon } from "components/Ico"; import { Ico, Icon } from "components/Ico";
import { useBoolean } from "hooks/useBoolean"; import { useBoolean } from "hooks/useBoolean";
import { compareDate } from "helpers/date"; import { compareDate } from "helpers/date";
@ -76,7 +76,7 @@ export const ChroniclesList = ({
content.attributes.translations, content.attributes.translations,
["language.data.attributes.code"] as const ["language.data.attributes.code"] as const
).map((translation) => ({ ).map((translation) => ({
title: prettyinlineTitle( title: prettyInlineTitle(
translation.pre_title, translation.pre_title,
translation.title, translation.title,
translation.subtitle translation.subtitle

View File

@ -4,7 +4,7 @@ import { InsetBox } from "components/InsetBox";
import { Markdawn } from "components/Markdown/Markdawn"; import { Markdawn } from "components/Markdown/Markdawn";
import { GetContentTextQuery, UploadImageFragment } from "graphql/generated"; import { GetContentTextQuery, UploadImageFragment } from "graphql/generated";
import { AppStaticProps } from "graphql/getAppStaticProps"; import { AppStaticProps } from "graphql/getAppStaticProps";
import { prettyinlineTitle, prettySlug, slugify } from "helpers/formatters"; import { prettyInlineTitle, prettySlug, slugify } from "helpers/formatters";
import { getAssetURL, ImageQuality } from "helpers/img"; import { getAssetURL, ImageQuality } from "helpers/img";
import { filterHasAttributes } from "helpers/others"; import { filterHasAttributes } from "helpers/others";
import { useLightBox } from "hooks/useLightBox"; import { useLightBox } from "hooks/useLightBox";
@ -65,7 +65,7 @@ export const ThumbnailHeader = ({
</div> </div>
<div <div
id={slugify( id={slugify(
prettyinlineTitle(pre_title ?? "", title, subtitle ?? "") prettyInlineTitle(pre_title ?? "", title, subtitle ?? "")
)} )}
className="grid place-items-center text-center" className="grid place-items-center text-center"
> >

View File

@ -45,7 +45,7 @@ export const prettySlug = (slug?: string, parentSlug?: string): string => {
return ""; return "";
}; };
export const prettyinlineTitle = ( export const prettyInlineTitle = (
pretitle: string | null | undefined, pretitle: string | null | undefined,
title: string | null | undefined, title: string | null | undefined,
subtitle: string | null | undefined subtitle: string | null | undefined

View File

@ -19,7 +19,7 @@ import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps";
import { getReadySdk } from "graphql/sdk"; import { getReadySdk } from "graphql/sdk";
import { getDescription } from "helpers/description"; import { getDescription } from "helpers/description";
import { import {
prettyinlineTitle, prettyInlineTitle,
prettyLanguage, prettyLanguage,
prettyItemSubType, prettyItemSubType,
prettySlug, prettySlug,
@ -288,7 +288,7 @@ const Content = ({
<HorizontalLine /> <HorizontalLine />
<TableOfContents <TableOfContents
text={selectedTranslation.text_set.text} text={selectedTranslation.text_set.text}
title={prettyinlineTitle( title={prettyInlineTitle(
selectedTranslation.pre_title, selectedTranslation.pre_title,
selectedTranslation.title, selectedTranslation.title,
selectedTranslation.subtitle selectedTranslation.subtitle
@ -459,7 +459,7 @@ const Content = ({
<AppLayout <AppLayout
navTitle={ navTitle={
selectedTranslation selectedTranslation
? prettyinlineTitle( ? prettyInlineTitle(
selectedTranslation.pre_title, selectedTranslation.pre_title,
selectedTranslation.title, selectedTranslation.title,
selectedTranslation.subtitle selectedTranslation.subtitle

View File

@ -11,7 +11,7 @@ import {
import { SubPanel } from "components/Panels/SubPanel"; import { SubPanel } from "components/Panels/SubPanel";
import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps";
import { getReadySdk } from "graphql/sdk"; import { getReadySdk } from "graphql/sdk";
import { prettyinlineTitle, prettySlug } from "helpers/formatters"; import { prettyInlineTitle, prettySlug } from "helpers/formatters";
import { TextInput } from "components/Inputs/TextInput"; import { TextInput } from "components/Inputs/TextInput";
import { WithLabel } from "components/Inputs/WithLabel"; import { WithLabel } from "components/Inputs/WithLabel";
import { Button } from "components/Inputs/Button"; import { Button } from "components/Inputs/Button";
@ -124,7 +124,7 @@ const Contents = ({
if (searchName.length > 1) { if (searchName.length > 1) {
if ( if (
filterDefined(item.attributes.translations).find((translation) => filterDefined(item.attributes.translations).find((translation) =>
prettyinlineTitle( prettyInlineTitle(
translation.pre_title, translation.pre_title,
translation.title, translation.title,
translation.subtitle translation.subtitle
@ -291,7 +291,7 @@ const Contents = ({
${item.attributes.slug} ${item.attributes.slug}
${filterDefined(item.attributes.translations) ${filterDefined(item.attributes.translations)
.map((translation) => .map((translation) =>
prettyinlineTitle( prettyInlineTitle(
translation.pre_title, translation.pre_title,
translation.title, translation.title,
translation.subtitle translation.subtitle

View File

@ -28,7 +28,7 @@ import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps";
import { getReadySdk } from "graphql/sdk"; import { getReadySdk } from "graphql/sdk";
import { import {
prettyDate, prettyDate,
prettyinlineTitle, prettyInlineTitle,
prettyItemSubType, prettyItemSubType,
prettyItemType, prettyItemType,
prettyPrice, prettyPrice,
@ -185,7 +185,7 @@ const LibrarySlug = ({
<p>{langui.subitem_of}</p> <p>{langui.subitem_of}</p>
<Button <Button
href={`/library/${item.subitem_of.data[0].attributes.slug}`} href={`/library/${item.subitem_of.data[0].attributes.slug}`}
text={prettyinlineTitle( text={prettyInlineTitle(
"", "",
item.subitem_of.data[0].attributes.title, item.subitem_of.data[0].attributes.title,
item.subitem_of.data[0].attributes.subtitle item.subitem_of.data[0].attributes.subtitle
@ -585,7 +585,7 @@ const LibrarySlug = ({
return ( return (
<AppLayout <AppLayout
navTitle={prettyinlineTitle("", item.title, item.subtitle)} navTitle={prettyInlineTitle("", item.title, item.subtitle)}
contentPanel={contentPanel} contentPanel={contentPanel}
subPanel={subPanel} subPanel={subPanel}
thumbnail={item.thumbnail?.data?.attributes ?? undefined} thumbnail={item.thumbnail?.data?.attributes ?? undefined}
@ -708,7 +708,7 @@ const ContentLine = ({
<a> <a>
<h3 className="cursor-pointer" onClick={toggleOpened}> <h3 className="cursor-pointer" onClick={toggleOpened}>
{selectedTranslation {selectedTranslation
? prettyinlineTitle( ? prettyInlineTitle(
selectedTranslation.pre_title, selectedTranslation.pre_title,
selectedTranslation.title, selectedTranslation.title,
selectedTranslation.subtitle selectedTranslation.subtitle

View File

@ -15,7 +15,7 @@ import { GetLibraryItemScansQuery } from "graphql/generated";
import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps";
import { getReadySdk } from "graphql/sdk"; import { getReadySdk } from "graphql/sdk";
import { import {
prettyinlineTitle, prettyInlineTitle,
prettySlug, prettySlug,
prettyItemSubType, prettyItemSubType,
} from "helpers/formatters"; } from "helpers/formatters";
@ -120,7 +120,7 @@ const LibrarySlug = ({
["language.data.attributes"] as const ["language.data.attributes"] as const
).map((translation) => ({ ).map((translation) => ({
language: translation.language.data.attributes.code, language: translation.language.data.attributes.code,
title: prettyinlineTitle( title: prettyInlineTitle(
translation.pre_title, translation.pre_title,
translation.title, translation.title,
translation.subtitle translation.subtitle
@ -201,7 +201,7 @@ const LibrarySlug = ({
["language.data.attributes"] as const ["language.data.attributes"] as const
).map((translation) => ({ ).map((translation) => ({
language: translation.language.data.attributes.code, language: translation.language.data.attributes.code,
title: prettyinlineTitle( title: prettyInlineTitle(
translation.pre_title, translation.pre_title,
translation.title, translation.title,
translation.subtitle translation.subtitle
@ -232,7 +232,7 @@ const LibrarySlug = ({
return ( return (
<AppLayout <AppLayout
navTitle={prettyinlineTitle("", item.title, item.subtitle)} navTitle={prettyInlineTitle("", item.title, item.subtitle)}
contentPanel={contentPanel} contentPanel={contentPanel}
subPanel={subPanel} subPanel={subPanel}
thumbnail={item.thumbnail?.data?.attributes ?? undefined} thumbnail={item.thumbnail?.data?.attributes ?? undefined}

View File

@ -14,7 +14,7 @@ import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps";
import { getReadySdk } from "graphql/sdk"; import { getReadySdk } from "graphql/sdk";
import { import {
prettyDate, prettyDate,
prettyinlineTitle, prettyInlineTitle,
prettyItemSubType, prettyItemSubType,
} from "helpers/formatters"; } from "helpers/formatters";
import { LibraryItemUserStatus } from "helpers/types"; import { LibraryItemUserStatus } from "helpers/types";
@ -152,12 +152,12 @@ const Library = ({
) => { ) => {
switch (sortingMethod) { switch (sortingMethod) {
case 0: { case 0: {
const titleA = prettyinlineTitle( const titleA = prettyInlineTitle(
"", "",
a.attributes.title, a.attributes.title,
a.attributes.subtitle a.attributes.subtitle
); );
const titleB = prettyinlineTitle( const titleB = prettyInlineTitle(
"", "",
b.attributes.title, b.attributes.title,
b.attributes.subtitle b.attributes.subtitle
@ -449,7 +449,7 @@ const Library = ({
sortingFunction={sortingFunction} sortingFunction={sortingFunction}
groupingFunction={groupingFunction} groupingFunction={groupingFunction}
searchingBy={(item) => searchingBy={(item) =>
prettyinlineTitle( prettyInlineTitle(
"", "",
item.attributes.title, item.attributes.title,
item.attributes.subtitle item.attributes.subtitle