Skip to content

Commit ca32437

Browse files
committed
fix: hero title
1 parent 624c9d5 commit ca32437

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/components/editorial-project/EditorialHero.jsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import ReactMarkdown from 'react-markdown';
33

4-
const EditorialHero = ({ content, repoLink }) => {
4+
const EditorialHero = ({ content, repoLink, title: projectTitle }) => {
55
if (!content) return null;
66

77
const lines = content.split('\n');
@@ -26,7 +26,7 @@ const EditorialHero = ({ content, repoLink }) => {
2626
}
2727
}
2828

29-
const title = titleLines.join('\n\n'); // Join with double newline for markdown paragraph break or <br/> if we want explicit
29+
const heroTitle = titleLines.join('\n\n');
3030
const description = lines.slice(descriptionStartIndex).join('\n');
3131

3232
return (
@@ -35,14 +35,21 @@ const EditorialHero = ({ content, repoLink }) => {
3535

3636
{/* Title Section */}
3737
<div className="md:col-span-2 md:col-start-2 border-l border-white/10 pl-8">
38+
{projectTitle && (
39+
<div className="mb-6">
40+
<span className="font-instr-serif text-xl text-white uppercase tracking-[0.1em] px-4 py-2 border border-white/20 inline-block">
41+
{projectTitle}
42+
</span>
43+
</div>
44+
)}
3845
<h1 className="text-6xl md:text-8xl font-instr-serif leading-[0.9] tracking-tight text-white mb-8">
3946
<ReactMarkdown
4047
components={{
4148
p: ({children}) => <div className="mb-0">{children}</div>,
4249
em: ({children}) => <span className="italic font-light">{children}</span>
4350
}}
4451
>
45-
{title}
52+
{heroTitle}
4653
</ReactMarkdown>
4754
</h1>
4855
</div>
@@ -69,4 +76,5 @@ const EditorialHero = ({ content, repoLink }) => {
6976
</section>
7077
);
7178
};
79+
7280
export default EditorialHero;

src/pages/EditorialProjectDetailsPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const EditorialProjectDetailsPage = () => {
8080
<EditorialNavbar title={projectMetadata?.title || 'Project'} repoLink={projectMetadata?.repo_link} />
8181

8282
<main className="flex-1 flex flex-col">
83-
<EditorialHero content={content.hero} repoLink={projectMetadata?.repo_link} />
83+
<EditorialHero content={content.hero} repoLink={projectMetadata?.repo_link} title={projectMetadata?.title} />
8484
<EditorialTerminal content={content.terminal} />
8585
<EditorialDescription content={content.description} />
8686
<EditorialInstall content={content.install} />

0 commit comments

Comments
 (0)