back to article list + read only when time is known

This commit is contained in:
Rick van Lieshout 2022-10-11 19:45:43 +02:00
parent 1c137af313
commit bc03788355
9 changed files with 19 additions and 43 deletions

View File

@ -42,7 +42,7 @@ const Feed: React.FC<Props> = ({ edges }: Props) => (
</h2>
<p className={styles.description}>{edge.node.frontmatter.description}</p>
<Link className={styles.more} to={edge.node.fields.slug}>
Read ({edge.node.fields.readingTime?.text})
{edge.node.fields.readingTime?.text && <>Read ({edge.node.fields.readingTime?.text})</>}
</Link>
</div>
))}

View File

@ -30,10 +30,7 @@ exports[`Feed renders correctly 1`] = `
</p>
<a
href="/posts/perfecting-the-art-of-perfection"
>
Read (
)
</a>
/>
</div>
<div>
<div>
@ -63,10 +60,7 @@ exports[`Feed renders correctly 1`] = `
</p>
<a
href="/posts/the-birth-of-movable-type"
>
Read (
)
</a>
/>
</div>
</div>
`;

View File

@ -30,7 +30,7 @@ exports[`Content renders correctly 1`] = `
className="hideInPrintView"
>
<a
href="/"
onClick={[Function]}
style={
{
"lineHeight": "50px",
@ -38,7 +38,7 @@ exports[`Content renders correctly 1`] = `
}
}
>
All articles
Back to articles
</a>
<span
className="hideInPrintView"

View File

@ -31,7 +31,7 @@ exports[`Post renders correctly 1`] = `
className="hideInPrintView"
>
<a
href="/"
onClick={[Function]}
style={
{
"lineHeight": "50px",
@ -39,7 +39,7 @@ exports[`Post renders correctly 1`] = `
}
}
>
All articles
Back to articles
</a>
<span
className="hideInPrintView"

View File

@ -1,5 +1,5 @@
import { Image } from "@/components/Image";
import { Link } from "gatsby";
import { Link, navigate } from "gatsby";
import React, { FunctionComponent } from "react";
import { ThemeSwitcher } from "../ThemeSwitcher/ThemeSwitcher";
import * as styles from "./PostHeader.module.scss";
@ -24,9 +24,9 @@ export const PostHeader: FunctionComponent<Props> = ({ author }) => {
</span>
<span className="hideInPrintView">
<Link to="/" style={{ lineHeight: "50px", marginRight: "10px" }}>
All articles
</Link>
<a onClick={() => navigate(-1)} style={{ lineHeight: "50px", marginRight: "10px" }}>
Back to articles
</a>
<ThemeSwitcher showLabel={false} />
</span>
</div>

View File

@ -281,10 +281,7 @@ exports[`CategoryTemplate renders correctly 1`] = `
</p>
<a
href="/posts/perfecting-the-art-of-perfection"
>
Read (
)
</a>
/>
</div>
<div>
<div>
@ -314,10 +311,7 @@ exports[`CategoryTemplate renders correctly 1`] = `
</p>
<a
href="/posts/the-birth-of-movable-type"
>
Read (
)
</a>
/>
</div>
</div>
<div

View File

@ -278,10 +278,7 @@ exports[`IndexTemplate renders correctly 1`] = `
</p>
<a
href="/posts/perfecting-the-art-of-perfection"
>
Read (
)
</a>
/>
</div>
<div>
<div>
@ -311,10 +308,7 @@ exports[`IndexTemplate renders correctly 1`] = `
</p>
<a
href="/posts/the-birth-of-movable-type"
>
Read (
)
</a>
/>
</div>
</div>
<div

View File

@ -32,7 +32,7 @@ exports[`PostTemplate renders correctly 1`] = `
className="hideInPrintView"
>
<a
href="/"
onClick={[Function]}
style={
{
"lineHeight": "50px",
@ -40,7 +40,7 @@ exports[`PostTemplate renders correctly 1`] = `
}
}
>
All articles
Back to articles
</a>
<span
className="hideInPrintView"

View File

@ -281,10 +281,7 @@ exports[`TagTemplate renders correctly 1`] = `
</p>
<a
href="/posts/perfecting-the-art-of-perfection"
>
Read (
)
</a>
/>
</div>
<div>
<div>
@ -314,10 +311,7 @@ exports[`TagTemplate renders correctly 1`] = `
</p>
<a
href="/posts/the-birth-of-movable-type"
>
Read (
)
</a>
/>
</div>
</div>
<div