Skip to content

Commit b68ae5a

Browse files
committed
Change headings to be more consistent
1 parent 1552580 commit b68ae5a

File tree

15 files changed

+118
-49
lines changed

15 files changed

+118
-49
lines changed

src/assets/state/roadmap.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Heading from "@/components/layout/heading";
12
import Link from "@/components/navigation/Link";
23
import { ReactNode } from "react";
34

@@ -11,31 +12,41 @@ export default [
1112
{
1213
title: "Q2 2023",
1314
text: <>
14-
<h4 id="roadmap-designs" className="font-semibold">Designs</h4>
15+
<Heading.H4 id="roadmap-designs">
16+
Designs
17+
</Heading.H4>
1518
<p aria-labelledby="roadmap-designs">
1619
In April, we will begin creating initial designs for the Git client.
1720
Subscribers will receive surveys with each iteration to provide feedback.
1821
Be sure to <Link color="primary" href="/#sign-up" underline>sign up</Link> to have your voice heard!
1922
The designs will also be shared in our blog.
2023
</p>
21-
<h4 id="roadmap-prototyping" className="font-semibold">Prototyping</h4>
24+
<Heading.H4 id="roadmap-prototyping">
25+
Prototyping
26+
</Heading.H4>
2227
<p aria-labelledby="roadmap-prototyping">
2328
We will begin developing early prototype versions of the Git client in addition to creating designs.
2429
This will involve testing various libraries and designs to ensure that we create the best possible product.
2530
We will also decide on licensing and monetization strategies during this month.
2631
</p>
27-
<h4 id="roadmap-discord-server" className="font-semibold">Opening Discord Server</h4>
32+
<Heading.H4 id="roadmap-discord-server">
33+
Opening Discord Server
34+
</Heading.H4>
2835
<p aria-labelledby="roadmap-discord-server">
2936
To encourage an active community, we plan to launch a public Discord server where users can freely exchange ideas and communicate directly with the development team.
3037
</p>
31-
<h4 id="roadmap-active-development" className="font-semibold">Active Development</h4>
38+
<Heading.H4 id="roadmap-active-development">
39+
Active Development
40+
</Heading.H4>
3241
<p aria-labelledby="roadmap-active-development">
3342
During the months of June, July, and August, we will be fully focused on active development of Commit Rocket,
3443
with the goal of releasing an early version of the Git client.
3544
Our team will be working tirelessly during this period to ensure that the client meets our high standards.
3645
We will also continue to provide regular development updates during these months to keep our community informed and engaged.
3746
</p>
38-
<h4 id="roadmap-insight-videos-on-development" className="font-semibold">Insight Videos on Development</h4>
47+
<Heading.H4 id="roadmap-insight-videos-on-development">
48+
Insight Videos on Development
49+
</Heading.H4>
3950
<p aria-labelledby="roadmap-insight-videos-on-development">
4051
Beginning May, we aim to provide regular updates on the development progress through video updates and blog posts to maintain transparency and gather feedback from our community.
4152
</p>
@@ -45,13 +56,17 @@ export default [
4556
title: "Q3 & Q4 2023",
4657
text: <>
4758

48-
<h4 id="roadmap-early-access-release" className="font-semibold">Ealy Access Releases</h4>
59+
<Heading.H4 id="roadmap-early-access-release">
60+
Ealy Access Releases
61+
</Heading.H4>
4962
<p aria-labelledby="roadmap-early-access-release">
5063
Early access versions of Commit Rocket will be made available exclusively to our mailing list subscribers and Discord members.
5164
To ensure a smooth user experience, we encourage users to share their feedback and feature requests with us via our Discord server and <Link color="primary" href="mailto:feedback@commitrocket.com" underline>our email</Link>.
5265
As the product is still subject to changes, we appreciate our users' contributions in helping us shape the final product.
5366
</p>
54-
<h4 id="roadmap-alpha-version" className="font-semibold">Alpha Version</h4>
67+
<Heading.H4 id="roadmap-alpha-version">
68+
Alpha Version
69+
</Heading.H4>
5570
<p aria-labelledby="roadmap-alpha-version">
5671
If everything goes according to plan, our goal is to release a public alpha version of Commit Rocket by September.
5772
While it will be a challenging task, we are not afraid to take it on!

src/components/layout/heading.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React, { ForwardedRef, forwardRef, useMemo } from "react";
2+
import { twMerge } from "tailwind-merge";
3+
4+
export type HeadingProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
5+
6+
const makeHeading = (level: number, defaultClassName: string) => forwardRef((
7+
{
8+
className,
9+
...props
10+
}: HeadingProps,
11+
ref: ForwardedRef<HTMLHeadingElement>
12+
) => {
13+
const Tag = `h${level}`;
14+
15+
const computedClassName = useMemo(
16+
() => twMerge(defaultClassName, className),
17+
[className]
18+
);
19+
20+
return <Tag
21+
ref={ref}
22+
//@ts-ignore
23+
className={computedClassName}
24+
{...props}
25+
/>;
26+
});
27+
28+
export const H1 = makeHeading(1, "text-5xl font-bold md:text-6xl");
29+
export const H2 = makeHeading(2, "text-4xl font-bold md:text-5xl");
30+
export const H3 = makeHeading(3, "text-3xl font-semibold md:text-4xl");
31+
export const H4 = makeHeading(4, "text-2xl font-semibold md:text-3xl");
32+
export const H5 = makeHeading(5, "text-xl font-semibold md:text-2xl");
33+
export const H6 = makeHeading(6, "text-lg font-semibold md:text-xl");
34+
35+
export default { H1, H2, H3, H4, H5, H6 };

src/components/pages/about/Member.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { motion } from "framer-motion";
2-
31
import { IMember } from "@/assets/state/team";
42
import LinkButton from "@/components/controls/LinkButton";
53

src/components/pages/contribute/FeedbackSection.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
import dynamic from "next/dynamic";
21
import { zodResolver } from "@hookform/resolvers/zod";
3-
import { AnimatePresence, motion } from "framer-motion";
42
import { useMemo, useRef, useState } from "react";
53
import { useForm } from "react-hook-form";
64
import { z } from "zod";
75

8-
const ArrowPathIcon = dynamic(() => import("@heroicons/react/24/solid/ArrowPathIcon"));
9-
106
import { BackendResponse } from "@/api/models/Response";
117
import Button from "@/components/controls/Button";
128
import Error from "@/components/controls/Error";
139
import Link from "@/components/navigation/Link";
1410
import { backend } from "@/utils/wretch";
1511
import TextArea from "@/components/controls/TextArea";
1612
import Form from "@/components/controls/Form";
13+
import Heading from "@/components/layout/heading";
1714

1815
const feedbackSchema = z.object({
1916
text: z.string()
@@ -49,12 +46,12 @@ const FeedbackSection = () => {
4946
aria-labelledby="feedback"
5047
className="flex flex-col w-full gap-4 mx-auto text-center max-w-7xl"
5148
>
52-
<h2
49+
<Heading.H2
5350
id="feedback"
5451
className="text-4xl font-bold md:text-5xl text-secondary"
5552
>
5653
Feedback
57-
</h2>
54+
</Heading.H2>
5855
<p>
5956
We welcome your input and ideas!
6057
Feel free to share your feedback and suggestions with us through our anonymous feedback form. <br />

src/components/pages/front/Mission.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IMission } from "@/assets/state/missions";
2+
import Heading from "@/components/layout/heading";
23

34
export interface MissionProps extends IMission {
45

@@ -7,9 +8,9 @@ export interface MissionProps extends IMission {
78
const Mission = ({ title, image, imageAlt, text }: MissionProps) => {
89
return (
910
<li className="flex flex-col items-center flex-1 gap-4 p-8 border-2 rounded-lg border-secondary">
10-
<h3 className="text-2xl text-primary md:text-3xl lg:h-[5ex] motion-safe:transition-all">
11+
<Heading.H3 className="text-primary lg:h-[5ex] motion-safe:transition-all">
1112
{title}
12-
</h3>
13+
</Heading.H3>
1314
<img
1415
className="w-full sm:w-2/3 lg:w-full text-[0px]"
1516
loading="lazy"

src/components/pages/front/RoadmapItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IRoadmapItem } from "@/assets/state/roadmap";
2+
import Heading from "@/components/layout/heading";
23

34
export interface RoadmapItemProps extends IRoadmapItem {
45

@@ -16,9 +17,9 @@ const RoadmapItem = ({ title, text }: RoadmapItemProps) => {
1617
<li aria-labelledby={id} className="relative flex flex-1 group/item">
1718
<Divider />
1819
<div className="relative flex flex-col flex-1 gap-4 py-4 pl-4 md:flex-row md:pl-0 md:py-0 md:gap-0">
19-
<h3 id={id} className="flex items-center text-2xl font-bold md:px-8 md:w-1/4 md:py-4 md:justify-end md:text-end">
20+
<Heading.H3 id={id} className="flex items-center md:px-8 md:w-1/4 md:py-4 md:justify-end md:text-end">
2021
{title}
21-
</h3>
22+
</Heading.H3>
2223
<Divider hideOnSmall />
2324
<div className="md:p-8 md:w-3/4">
2425
<div aria-label="Deliverables" className="flex flex-col gap-2 text-lg">

src/components/pages/front/SignupSection.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Link from "@/components/navigation/Link";
1111
import { backend } from "@/utils/wretch";
1212
import Input from "@/components/controls/Input";
1313
import Form from "@/components/controls/Form";
14+
import Heading from "@/components/layout/heading";
1415

1516

1617
const signupSchema = z.object({
@@ -46,13 +47,13 @@ const SignupSection = () => {
4647
aria-labelledby="sign-up"
4748
className="flex flex-col gap-12 mx-auto text-center max-w-7xl"
4849
>
49-
<h2
50+
<Heading.H2
5051
id="sign-up"
51-
className="text-4xl font-bold md:text-5xl text-secondary"
52+
className="text-secondary"
5253
>
5354
Keep Up to Date <br />
5455
Join Our Mailing List
55-
</h2>
56+
</Heading.H2>
5657
<p className="text-xl">
5758
Do you want to join in on this adventure and help develop Commit Rocket?
5859
We value your input and look forward to involving you in the process of making Commit Rocket as optimal as possible.

src/pages/404.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import HomeModernIcon from "@heroicons/react/24/solid/HomeModernIcon";
66
import { Page } from "@/types/page";
77
import LinkButton from "@/components/controls/LinkButton";
88
import Button from "@/components/controls/Button";
9+
import Heading from "@/components/layout/heading";
910

1011
const NotFound: Page = ({ }) => {
1112
const router = useRouter();
@@ -17,7 +18,9 @@ const NotFound: Page = ({ }) => {
1718
</Head>
1819
<main className="flex items-center justify-center flex-1 w-full pb-8" aria-labelledby="not-found">
1920
<div className="flex flex-col gap-2 p-8 text-center border-2 rounded-md border-primary">
20-
<h1 id="not-found" className="text-5xl text-secondary">Not Found.</h1>
21+
<Heading.H1 id="not-found" className="text-secondary">
22+
Not Found.
23+
</Heading.H1>
2124
<p>There are no commits to be found here!</p>
2225
<div className="grid grid-cols-2 gap-2 mt-4">
2326
<LinkButton href="/" color="secondary">

src/pages/about.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import members from "@/assets/state/team";
44
import Member from "@/components/pages/about/Member";
55
import { Page } from "@/types/page";
66
import projects from "@/assets/state/projects";
7+
8+
import Heading from "@/components/layout/heading";
79
import Project from "@/components/pages/about/Project";
810

911
const AboutPage: Page = () => {
@@ -13,14 +15,16 @@ const AboutPage: Page = () => {
1315
<title>About - Commit Rocket</title>
1416
</Head>
1517
<main aria-labelledby="about" className="flex flex-col flex-1 w-full gap-8 pb-8 max-w-7xl">
16-
<h1 id="about" className="text-4xl font-bold text-center lg:text-6xl text-secondary">About</h1>
18+
<Heading.H1 id="about" className="text-center text-secondary">
19+
About
20+
</Heading.H1>
1721
<section aria-labelledby="our-team" className="flex flex-col gap-8">
18-
<h2
22+
<Heading.H2
1923
id="our-team"
20-
className="text-4xl font-bold text-center md:text-5xl text-secondary"
24+
className="text-center text-secondary"
2125
>
2226
Team
23-
</h2>
27+
</Heading.H2>
2428
<ul
2529
className="flex flex-wrap justify-center gap-8"
2630
aria-label="Members"
@@ -31,12 +35,12 @@ const AboutPage: Page = () => {
3135
</ul>
3236
</section>
3337
<section aria-labelledby="projects" className="flex flex-col gap-8">
34-
<h2
38+
<Heading.H2
3539
id="projects"
36-
className="text-4xl font-bold text-center md:text-5xl text-secondary"
40+
className="text-center text-secondary"
3741
>
3842
Projects
39-
</h2>
43+
</Heading.H2>
4044
<div className="text-lg text-center">
4145
Commit Rocket is the latest addition to our portfolio of projects.
4246
Check out some of our previous work to see what we're capable of. <br />

src/pages/blog/[pid]/[slug].tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { GetStaticPaths, GetStaticProps } from "next";
22
import { Page } from "@/types/page";
3-
import ArticleBrief, { IArticleBrief } from "@/components/pages/blog/ArticleBrief";
43
import { calculateReadtime } from "@/utils/readtime";
54
import IArticle from "@/assets/state/articles/article";
65
import { reactNodeToString } from "@/utils/react";
76
import Head from "next/head";
7+
import Heading from "@/components/layout/heading";
88

99
type ComputedArticle = {
1010
content: string;
@@ -23,7 +23,9 @@ const BlogPostPage: Page<BlogPostPageProps> = ({ article }) => {
2323
<Head>
2424
<title>{article.title} - Commit Rocket</title>
2525
</Head>
26-
<h1 className="text-4xl font-semibold">{article.title}</h1>
26+
<Heading.H1 className="text-4xl font-semibold">
27+
{article.title}
28+
</Heading.H1>
2729
<div dangerouslySetInnerHTML={{
2830
__html: article.content
2931
}} />

0 commit comments

Comments
 (0)