fixed pagination, fixed cookiebar dark mode, fixed rendering issues during ssr, moved all test blog code to a test folder

This commit is contained in:
2022-09-17 23:16:13 +02:00
parent b82bef5e0f
commit 74082cd463
28 changed files with 176 additions and 237 deletions

View File

@@ -4,14 +4,14 @@ $shadow: 0px -1px 5px rgba(50, 50, 50, 0.75);
.cookieBar {
align-items: baseline;
background: #fff;
border-top: 1px solid #808080;
background: $color-bg;
border-top: 1px solid $color-gray-border;
bottom: 0px;
-webkit-box-shadow: $shadow;
-moz-box-shadow: $shadow;
box-shadow: $shadow;
color: #000;
color: $color-base;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
@@ -27,7 +27,7 @@ $shadow: 0px -1px 5px rgba(50, 50, 50, 0.75);
}
.button {
background: #fff;
background: $color-bg;
border: 1px solid $color-gray-border;
border-radius: $button-border-radius;
color: $color-base;

View File

@@ -19,7 +19,7 @@ exports[`Pagination renders correctly 1`] = `
href="/typography/page/3"
rel="next"
>
NEXT
NEXT
</a>
</div>
</div>

View File

@@ -12,7 +12,11 @@ const Author = () => {
<a href="/pages/about">
<strong>{author.name}</strong>
</a>
<span className="showInPrintView"> {`@ ${window.location}`}</span>
{typeof window !== "undefined" ? (
<span className="showInPrintView"> {window ? `@ ${window.location}` : ""}</span>
) : (
""
)}
</p>
</div>
);

View File

@@ -9,6 +9,9 @@ import { Themes } from "./Themes";
type Props = { showLabel: boolean };
export const ThemeSwitcher: FunctionComponent<Props> = ({ showLabel }) => {
if (typeof document === "undefined") {
return null;
}
const initTheme = document.documentElement.dataset.theme;
const [theme, setTheme] = useState(initTheme);

View File

@@ -1,6 +1,6 @@
const PAGINATION = {
PREV_PAGE: "← PREV",
NEXT_PAGE: "NEXT",
NEXT_PAGE: "NEXT",
};
export default PAGINATION;

View File

@@ -336,7 +336,7 @@ exports[`CategoryTemplate renders correctly 1`] = `
href="/typography/page/3"
rel="next"
>
NEXT
NEXT
</a>
</div>
</div>

View File

@@ -19,14 +19,11 @@ interface Props {
const IndexTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
const { pagination } = pageContext;
const { currentPage, hasNextPage, hasPrevPage, prevPagePath, nextPagePath } =
pagination;
const { currentPage, hasNextPage, hasPrevPage, prevPagePath, nextPagePath } = pagination;
const { edges } = data.allMarkdownRemark;
const pageTitle =
currentPage > 0 ? `Posts - Page ${currentPage} - ${siteTitle}` : siteTitle;
const pageTitle = currentPage > 0 ? `Posts - Page ${currentPage} - ${siteTitle}` : siteTitle;
return (
<Layout title={pageTitle} description={siteSubtitle}>

View File

@@ -333,7 +333,7 @@ exports[`IndexTemplate renders correctly 1`] = `
href="/typography/page/3"
rel="next"
>
NEXT
NEXT
</a>
</div>
</div>

View File

@@ -336,7 +336,7 @@ exports[`TagTemplate renders correctly 1`] = `
href="/typography/page/3"
rel="next"
>
NEXT
NEXT
</a>
</div>
</div>