From acd2d7d482767f58fa7e0a16848aa25373155486 Mon Sep 17 00:00:00 2001
From: DrMint
Date: Sun, 21 Aug 2022 10:20:12 +0200
Subject: [PATCH] Removed horizontal line from Return button
---
src/components/AppLayout.tsx | 10 ++++++----
src/components/PanelComponents/ReturnButton.tsx | 4 ----
src/components/PostPage.tsx | 14 +++++++++-----
src/helpers/openGraph.ts | 5 +++--
src/pages/chronicles/[slug]/index.tsx | 4 +++-
src/pages/library/[slug]/index.tsx | 4 +++-
src/pages/wiki/[slug]/index.tsx | 1 -
src/pages/wiki/chronology.tsx | 4 +++-
8 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx
index 76ac09e..ce1cbda 100644
--- a/src/components/AppLayout.tsx
+++ b/src/components/AppLayout.tsx
@@ -25,7 +25,7 @@ import { cIf, cJoin } from "helpers/className";
import { AppStaticProps } from "graphql/getAppStaticProps";
import { useAppLayout } from "contexts/AppLayoutContext";
import { Button } from "components/Inputs/Button";
-import { OpenGraph, TITLE_PREFIX } from "helpers/openGraph";
+import { OpenGraph, TITLE_PREFIX, TITLE_SEPARATOR } from "helpers/openGraph";
import { getDefaultPreferredLanguages } from "helpers/locales";
/*
@@ -355,10 +355,12 @@ export const AppLayout = ({
)
)}
>
- {isDefinedAndNotEmpty(
- openGraph.title.substring(TITLE_PREFIX.length)
+ {openGraph.title.substring(
+ TITLE_PREFIX.length + TITLE_SEPARATOR.length
)
- ? openGraph.title.substring(TITLE_PREFIX.length)
+ ? openGraph.title.substring(
+ TITLE_PREFIX.length + TITLE_SEPARATOR.length
+ )
: "Accord’s Library"}
{isDefined(subPanel) && !turnSubIntoContent && (
diff --git a/src/components/PanelComponents/ReturnButton.tsx b/src/components/PanelComponents/ReturnButton.tsx
index 78a80b0..d031472 100644
--- a/src/components/PanelComponents/ReturnButton.tsx
+++ b/src/components/PanelComponents/ReturnButton.tsx
@@ -1,5 +1,4 @@
import { useCallback } from "react";
-import { HorizontalLine } from "components/HorizontalLine";
import { Icon } from "components/Ico";
import { Button } from "components/Inputs/Button";
import { useAppLayout } from "contexts/AppLayoutContext";
@@ -18,7 +17,6 @@ interface Props {
title: string | null | undefined;
langui: AppStaticProps["langui"];
displayOn: ReturnButtonType;
- horizontalLine?: boolean;
className?: string;
}
@@ -35,7 +33,6 @@ export const ReturnButton = ({
title,
langui,
displayOn,
- horizontalLine,
className,
}: Props): JSX.Element => {
const { setSubPanelOpen } = useAppLayout();
@@ -54,7 +51,6 @@ export const ReturnButton = ({
text={`${langui.return_to} ${title}`}
icon={Icon.NavigateBefore}
/>
- {horizontalLine === true && }
);
};
diff --git a/src/components/PostPage.tsx b/src/components/PostPage.tsx
index 7da82b1..2085ba6 100644
--- a/src/components/PostPage.tsx
+++ b/src/components/PostPage.tsx
@@ -86,12 +86,13 @@ export const PostPage = ({
title={returnTitle}
langui={langui}
displayOn={ReturnButtonType.Desktop}
- horizontalLine
/>
)}
{displayCredits && (
<>
+
+
{selectedTranslation && (
{langui.status}:
@@ -126,13 +127,16 @@ export const PostPage = ({
)}
-
-
>
)}
{displayToc && (
-
+
)}
) : undefined,
@@ -158,7 +162,7 @@ export const PostPage = ({
title={returnTitle}
langui={langui}
displayOn={ReturnButtonType.Mobile}
- horizontalLine
+ className="mb-10"
/>
)}
diff --git a/src/helpers/openGraph.ts b/src/helpers/openGraph.ts
index 9fb4ad9..566507b 100644
--- a/src/helpers/openGraph.ts
+++ b/src/helpers/openGraph.ts
@@ -15,7 +15,8 @@ const DEFAULT_OG_THUMBNAIL = {
alt: "Accord's Library Logo",
};
-export const TITLE_PREFIX = "Accord’s Library - ";
+export const TITLE_PREFIX = "Accord’s Library";
+export const TITLE_SEPARATOR = " - "
export interface OpenGraph {
title: string;
@@ -29,7 +30,7 @@ export const getOpenGraph = (
description?: string | null | undefined,
thumbnail?: UploadImageFragment | null | undefined
): OpenGraph => ({
- title: `${TITLE_PREFIX}${isDefinedAndNotEmpty(title) ? `${title}` : ""}`,
+ title: `${TITLE_PREFIX}${isDefinedAndNotEmpty(title) ? `${TITLE_SEPARATOR}${title}` : ""}`,
description: isDefinedAndNotEmpty(description)
? description
: langui.default_description ?? "",
diff --git a/src/pages/chronicles/[slug]/index.tsx b/src/pages/chronicles/[slug]/index.tsx
index 337cfc7..472950e 100644
--- a/src/pages/chronicles/[slug]/index.tsx
+++ b/src/pages/chronicles/[slug]/index.tsx
@@ -172,8 +172,10 @@ const Chronicle = ({
href="/chronicles"
title={langui.chronicles}
langui={langui}
- horizontalLine
/>
+
+
+
{filterHasAttributes(chapters, [
"attributes.chronicles",
diff --git a/src/pages/library/[slug]/index.tsx b/src/pages/library/[slug]/index.tsx
index 151a00d..b27d58f 100644
--- a/src/pages/library/[slug]/index.tsx
+++ b/src/pages/library/[slug]/index.tsx
@@ -57,6 +57,7 @@ import { useSmartLanguage } from "hooks/useSmartLanguage";
import { getOpenGraph } from "helpers/openGraph";
import { getDescription } from "helpers/description";
import { useIntersectionList } from "hooks/useIntersectionList";
+import { HorizontalLine } from "components/HorizontalLine";
/*
* ╭─────────────╮
@@ -130,9 +131,10 @@ const LibrarySlug = ({
title={langui.library}
langui={langui}
displayOn={ReturnButtonType.Desktop}
- horizontalLine
/>
+
+
),
diff --git a/src/pages/wiki/chronology.tsx b/src/pages/wiki/chronology.tsx
index a501e8d..bf366eb 100644
--- a/src/pages/wiki/chronology.tsx
+++ b/src/pages/wiki/chronology.tsx
@@ -33,6 +33,7 @@ import { datePickerToDate } from "helpers/date";
import { TranslatedProps } from "helpers/types/TranslatedProps";
import { TranslatedNavOption } from "components/PanelComponents/NavOption";
import { useIntersectionList } from "hooks/useIntersectionList";
+import { HorizontalLine } from "components/HorizontalLine";
/*
* ╭────────╮
@@ -71,9 +72,10 @@ const Chronology = ({
title={langui.wiki}
langui={langui}
displayOn={ReturnButtonType.Desktop}
- horizontalLine
/>
+
+
{filterHasAttributes(chronologyEras, ["attributes", "id"] as const).map(
(era, index) => (