1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-30 03:56:01 -04:00

update <PageTitle /> component

This commit is contained in:
2022-01-12 12:56:24 -05:00
parent 3dfe85d5f6
commit e6ead77f5f
14 changed files with 58 additions and 66 deletions

View File

@@ -3,10 +3,15 @@ import { useTheme } from "next-themes";
import Header from "./page-header/Header"; import Header from "./page-header/Header";
import Footer from "./page-footer/Footer"; import Footer from "./page-footer/Footer";
import { themeColors } from "../lib/config"; import { themeColors } from "../lib/config";
import type { ReactNode } from "react";
import styles from "./Layout.module.css"; import styles from "./Layout.module.css";
const Layout = ({ children }) => { type Props = {
children: ReactNode;
};
const Layout = ({ children }: Props) => {
const { resolvedTheme } = useTheme(); const { resolvedTheme } = useTheme();
return ( return (

View File

@@ -15,7 +15,9 @@ const Meta = ({ slug, date, title, htmlTitle = "", tags = [] }: NoteMetaType) =>
<DateIcon className={`icon ${styles.icon}`} /> <DateIcon className={`icon ${styles.icon}`} />
</span> </span>
<span title={format(new Date(date), "PPppp")}> <span title={format(new Date(date), "PPppp")}>
<Link href={`/notes/${slug}/`}>{format(new Date(date), "MMMM d, yyyy")}</Link> <Link href={`/notes/${slug}/`}>
<a>{format(new Date(date), "MMMM d, yyyy")}</a>
</Link>
</span> </span>
</div> </div>
{tags.length > 0 && ( {tags.length > 0 && (

View File

@@ -60,6 +60,7 @@
margin: 0 0.6em; margin: 0 0.6em;
font-size: 1.2em; font-size: 1.2em;
font-weight: 500; font-weight: 500;
line-height: 1;
} }
/*** right side: menu ***/ /*** right side: menu ***/

View File

@@ -1,19 +1,24 @@
import { memo } from "react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import Link from "next/link";
import type { ReactNode } from "react";
import styles from "./PageTitle.module.css"; import styles from "./PageTitle.module.css";
type Props = { type Props = {
title: unknown; children: ReactNode;
}; };
const PageTitle = ({ title }: Props) => { const PageTitle = ({ children }: Props) => {
const router = useRouter(); const router = useRouter();
return ( return (
<h1 className={styles.title}> <h1 className={styles.title}>
<a href={router.asPath}>{title}</a> <Link href={router.asPath}>
<a>{children}</a>
</Link>
</h1> </h1>
); );
}; };
export default PageTitle; export default memo(PageTitle);

View File

@@ -16,13 +16,10 @@ const Birthday = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<TapeIcon /> 1996.MOV <TapeIcon /> 1996.MOV
</> </PageTitle>
}
/>
<Content> <Content>
<Video <Video
url={[ url={[

View File

@@ -16,13 +16,10 @@ const CLI = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<BotIcon /> CLI <BotIcon /> CLI
</> </PageTitle>
}
/>
<Content> <Content>
<blockquote> <blockquote>
<p> <p>

View File

@@ -13,13 +13,10 @@ const Contact = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<MailIcon /> Contact Me <MailIcon /> Contact Me
</> </PageTitle>
}
/>
<Content> <Content>
<div className="wrapper"> <div className="wrapper">
<p> <p>

View File

@@ -15,7 +15,7 @@ const Hillary = () => (
}} }}
/> />
<PageTitle title="My Brief Apperance in Hillary Clinton's DNC Video" /> <PageTitle>My Brief Apperance in Hillary Clinton's DNC Video</PageTitle>
<Content> <Content>
<Video <Video
url={[ url={[

View File

@@ -15,7 +15,8 @@ const Leo = () => (
}} }}
/> />
<PageTitle title='Facebook App on "The Lab with Leo Laporte"' /> <PageTitle>Facebook App on "The Lab with Leo Laporte"</PageTitle>
<Content> <Content>
<Video <Video
url={[ url={[

View File

@@ -12,13 +12,10 @@ const License = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<LicenseIcon /> License <LicenseIcon /> License
</> </PageTitle>
}
/>
<Content> <Content>
<p> <p>
Unless otherwise noted, content on this website is published under the{" "} Unless otherwise noted, content on this website is published under the{" "}

View File

@@ -32,13 +32,10 @@ const Previously = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<FloppyIcon /> Previously on... <FloppyIcon /> Previously on...
</> </PageTitle>
}
/>
<Content> <Content>
<figure> <figure>
<a <a

View File

@@ -16,13 +16,10 @@ const Privacy = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<PrivacyIcon /> Privacy <PrivacyIcon /> Privacy
</> </PageTitle>
}
/>
<Content> <Content>
<p>Okay, this is an easy one. 😉</p> <p>Okay, this is an easy one. 😉</p>
@@ -179,8 +176,11 @@ const Privacy = () => (
<a href="https://www.hcaptcha.com/" target="_blank" rel="noopener noreferrer"> <a href="https://www.hcaptcha.com/" target="_blank" rel="noopener noreferrer">
<strong>hCaptcha</strong> <strong>hCaptcha</strong>
</a>{" "} </a>{" "}
to fight bot spam on the <Link href="/contact/">contact form</Link> was an easy choice over seemingly to fight bot spam on the{" "}
unavoidable alternatives like{" "} <Link href="/contact/" prefetch={false}>
<a>contact form</a>
</Link>{" "}
was an easy choice over seemingly unavoidable alternatives like{" "}
<a href="https://developers.google.com/recaptcha/" target="_blank" rel="noopener noreferrer"> <a href="https://developers.google.com/recaptcha/" target="_blank" rel="noopener noreferrer">
reCAPTCHA reCAPTCHA
</a> </a>

View File

@@ -15,13 +15,9 @@ const Projects = (props: { repos: RepoType[] }) => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
<ProjectsIcon /> Projects <ProjectsIcon /> Projects
</> </PageTitle>
}
/>
<div> <div>
{props.repos.map((repo: RepoType) => ( {props.repos.map((repo: RepoType) => (

View File

@@ -17,13 +17,10 @@ const Uses = () => (
}} }}
/> />
<PageTitle <PageTitle>
title={
<>
/uses <LaptopIcon /> /uses <LaptopIcon />
</> </PageTitle>
}
/>
<Content> <Content>
<p> <p>
<del>I regularly get messages asking about which tools I use to work.</del> <del>I regularly get messages asking about which tools I use to work.</del>